From nobody Thu Apr 9 19:20:16 2026 Received: from mail.zeus03.de (zeus03.de [194.117.254.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 95FDA38911A for ; Tue, 3 Mar 2026 19:31:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=194.117.254.33 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772566315; cv=none; b=GHXOTLsASdlqMHnJQYni9f3BK9DQqBZ1+JcB+++XMbbF4oJTcW7sGe+ih30Cqlik1PL4T9/NaU4AiPDRH3/IF4GxpFIkUbh2sW33eLQdHiu9SWFd1j5kG+Jsqk0juweFSmtjde5KFNWG5BSLiZtTMgK2+kyBgHnTAMsrXk0rvt8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772566315; c=relaxed/simple; bh=vQS9LYcAzje+MMpRYEd6nRDdwiMOA9YItnDfriXH1aw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YKTOi+bvJhGxAim+YWNXtqwtXbtXrmhq5Yv5dHpCQ+c5GJ7MNWCTU2FyXyeU9xQ3N7hE3FpmavwrIJtlnEDrvAZGM5T3QflPDRyyRzSaKy72KKc3aXOm4fcGfargQNx6hxd8EHg4rFMonRBQfaYHaZMIxjgQtCqac2eVsRs+cO4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sang-engineering.com; spf=pass smtp.mailfrom=sang-engineering.com; dkim=pass (2048-bit key) header.d=sang-engineering.com header.i=@sang-engineering.com header.b=B/ZGnjC3; arc=none smtp.client-ip=194.117.254.33 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sang-engineering.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sang-engineering.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sang-engineering.com header.i=@sang-engineering.com header.b="B/ZGnjC3" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= sang-engineering.com; h=from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; s=k1; bh=E+W3aoDhRerxB8MlZR6L5l3+W5MIlzwxE6xhU7iwtJA=; b=B/ZGnj C3l+XhjK3COy5XM3TUIW+1V7TKWUYJg0j0Q3wBPwFk3gcPOe5YCdf8IG0pZuicUA lLjX4jsBDeAVsRX31fza3w11z3ZShkhatmIvnpPsSXtZHLlBs/xmB6jwjdMHo3Za BKIOAI8e2yw8j8a0P3r8WI1D+C1zfYnJF+vufTeLceqyBGwAx3UE3wXks+2Vim2g CgIU7dxNZjeSCO8Rk0eXHJvI5WvAm8inrmD1AX4BkM6Qh/iT9a6zH/OoOXOcFJ13 CHAWCkgtsuWssssgjoOAidleQMczZ/29pfpywgRZqoHOukMS9JjDovNXOMK3PnzQ brLl3yR5VJw54uqQ== Received: (qmail 430645 invoked from network); 3 Mar 2026 20:31:34 +0100 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 3 Mar 2026 20:31:34 +0100 X-UD-Smtp-Session: l3s3148p1@DwhUwCNMZJEujnu+ From: Wolfram Sang To: linux-renesas-soc@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Wolfram Sang , Wilken Gottwalt , Bjorn Andersson , Baolin Wang , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , linux-remoteproc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev Subject: [PATCH v3 09/15] hwspinlock: sun6i: use new callback to initialize hwspinlock priv Date: Tue, 3 Mar 2026 20:26:01 +0100 Message-ID: <20260303192600.7224-26-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260303192600.7224-17-wsa+renesas@sang-engineering.com> References: <20260303192600.7224-17-wsa+renesas@sang-engineering.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Apply the new helper to avoid using internal structures from the core. Remove superfluous setting of drvdata while here. Signed-off-by: Wolfram Sang Reviewed-by: Chen-Yu Tsai --- drivers/hwspinlock/sun6i_hwspinlock.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/hwspinlock/sun6i_hwspinlock.c b/drivers/hwspinlock/sun= 6i_hwspinlock.c index a0c76bba3f05..7d0c639c0e82 100644 --- a/drivers/hwspinlock/sun6i_hwspinlock.c +++ b/drivers/hwspinlock/sun6i_hwspinlock.c @@ -74,9 +74,17 @@ static void sun6i_hwspinlock_unlock(struct hwspinlock *l= ock) writel(SPINLOCK_NOTTAKEN, lock_addr); } =20 +static void *sun6i_hwspinlock_init_priv(int local_id, void *init_data) +{ + void __iomem *io_base_ofs =3D init_data; + + return io_base_ofs + sizeof(u32) * local_id; +} + static const struct hwspinlock_ops sun6i_hwspinlock_ops =3D { .trylock =3D sun6i_hwspinlock_trylock, .unlock =3D sun6i_hwspinlock_unlock, + .init_priv =3D sun6i_hwspinlock_init_priv, }; =20 static void sun6i_hwspinlock_disable(void *data) @@ -91,10 +99,9 @@ static void sun6i_hwspinlock_disable(void *data) static int sun6i_hwspinlock_probe(struct platform_device *pdev) { struct sun6i_hwspinlock_data *priv; - struct hwspinlock *hwlock; void __iomem *io_base; u32 num_banks; - int err, i; + int err; =20 io_base =3D devm_platform_ioremap_resource(pdev, SPINLOCK_BASE_ID); if (IS_ERR(io_base)) @@ -161,11 +168,6 @@ static int sun6i_hwspinlock_probe(struct platform_devi= ce *pdev) goto bank_fail; } =20 - for (i =3D 0; i < priv->nlocks; ++i) { - hwlock =3D &priv->bank->lock[i]; - hwlock->priv =3D io_base + SPINLOCK_LOCK_REGN + sizeof(u32) * i; - } - /* failure of debugfs is considered non-fatal */ sun6i_hwspinlock_debugfs_init(priv); if (IS_ERR(priv->debugfs)) @@ -177,10 +179,8 @@ static int sun6i_hwspinlock_probe(struct platform_devi= ce *pdev) goto bank_fail; } =20 - platform_set_drvdata(pdev, priv); - return devm_hwspin_lock_register(&pdev->dev, priv->bank, &sun6i_hwspinloc= k_ops, - SPINLOCK_BASE_ID, priv->nlocks, NULL); + SPINLOCK_BASE_ID, priv->nlocks, io_base + SPINLOCK_LOCK_REGN); =20 bank_fail: clk_disable_unprepare(priv->ahb_clk); --=20 2.51.0