From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 87655E63F1F for ; Sun, 15 Feb 2026 22:55:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=YFkjV39h9bUTsT9T2mmQ33w6bCMkVVVBeqpoOYjV1AY=; b=iG2qnR3cjAvSqFWlHxwUU69VK3 5QzB/S5eUdEAACK8E2z+7LRDpzMlLXMBRqgFMxMHB++58YQ1fuxpNcKjZ3t6X1vji9884pZ5L808K m4zVfppuqVsHyFxD2rv2gugI5PPdTCSCZ6kmQwEIm8sr0/4njFy5wRR87hehycz8aYzY8KwLdwYdP 4CwXKuFCHEosBKPUSM86x+VyOyXE8fV9Sk/ljhoSR9EFzRi2i+v7B2yiXKuIAXGIBpKQqQERX7J+h YeVfpFWmBSBgJ3P/M2VoI9RDghq1U8iu+yhUsSr9EIIqLsXmWjOahfQSLzA8tUOJYz1hMDLe8Xru/ saN/Jprg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vrl1b-00000005jUN-1Y9l; Sun, 15 Feb 2026 22:55:35 +0000 Received: from zeus03.de ([194.117.254.33] helo=mail.zeus03.de) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vrl1U-00000005jMY-00iO for linux-arm-kernel@lists.infradead.org; Sun, 15 Feb 2026 22:55:29 +0000 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=YFkjV39h9bUTsT9T2mmQ33w6bCMkVVVBeqpoOYjV1AY=; b=NtkXmG X18CRt1bIaz1PA5hfD6uvx/rt6Wey1hMiI84/CxBFaF+SkOBQAnUzsDw2yq0/s2N OtIwPB6Hhjxv3PB2c+mohROVCjWBWC8TPRhONWSjuo3EOzpAwJdF30fBFy7VwDUy NrjdI1Uogy26hFLXd9GgMDioKlbCr4OH1FnHJWz9/xoSv0Io6Wo2QY5IT6vSI12k 8KZrANuSkdD9bPejP8OjMvfY/VfqyRf7EJHnBU7DStysrhGJaBoHGtCv6e2phyLG h/+edhXklO56xPKELqEpCbTQcn41SXQ1PpaZBs4ReKXLm9pr+JjrJLPtr9s/DlTw w8kyMeZ8jGaFOVpA== Received: (qmail 3011465 invoked from network); 15 Feb 2026 23:55:12 +0100 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 15 Feb 2026 23:55:12 +0100 X-UD-Smtp-Session: l3s3148p1@mK8Su+RK5MAujns5 From: Wolfram Sang To: linux-renesas-soc@vger.kernel.org Cc: Andy Shevchenko , linux-arm-kernel@lists.infradead.org, Wolfram Sang , Wilken Gottwalt , Bjorn Andersson , Baolin Wang , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , linux-remoteproc@vger.kernel.org, linux-sunxi@lists.linux.dev Subject: [RFC PATCH v2 07/13] hwspinlock: sun6i: use new callback to initialize hwspinlock priv Date: Sun, 15 Feb 2026 23:54:47 +0100 Message-ID: <20260215225501.6365-8-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260215225501.6365-1-wsa+renesas@sang-engineering.com> References: <20260215225501.6365-1-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260215_145528_647700_4EBC2AA4 X-CRM114-Status: GOOD ( 13.16 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Apply the new helper to avoid using internal structures from the core. Remove superfluous setting of drvdata while here. Signed-off-by: Wolfram Sang --- drivers/hwspinlock/sun6i_hwspinlock.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/hwspinlock/sun6i_hwspinlock.c b/drivers/hwspinlock/sun6i_hwspinlock.c index 8ff81cb5880a..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 *lock) writel(SPINLOCK_NOTTAKEN, lock_addr); } +static void *sun6i_hwspinlock_init_priv(int local_id, void *init_data) +{ + void __iomem *io_base_ofs = init_data; + + return io_base_ofs + sizeof(u32) * local_id; +} + static const struct hwspinlock_ops sun6i_hwspinlock_ops = { .trylock = sun6i_hwspinlock_trylock, .unlock = sun6i_hwspinlock_unlock, + .init_priv = sun6i_hwspinlock_init_priv, }; 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; io_base = devm_platform_ioremap_resource(pdev, SPINLOCK_BASE_ID); if (IS_ERR(io_base)) @@ -161,11 +168,6 @@ static int sun6i_hwspinlock_probe(struct platform_device *pdev) goto bank_fail; } - for (i = 0; i < priv->nlocks; ++i) { - hwlock = &priv->bank->lock[i]; - hwlock->priv = 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_device *pdev) goto bank_fail; } - platform_set_drvdata(pdev, priv); - return devm_hwspin_lock_register(&pdev->dev, priv->bank, &sun6i_hwspinlock_ops, - SPINLOCK_BASE_ID, priv->nlocks); + SPINLOCK_BASE_ID, priv->nlocks, io_base + SPINLOCK_LOCK_REGN); bank_fail: clk_disable_unprepare(priv->ahb_clk); -- 2.51.0