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 67E3BE63F08 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=0Mnv5asIBgC16zhxO0+XRgGoOGoi/I6OSdCNLF9zGEg=; b=OqbLCmrDgADHmGWvOMo7Iha/Jn vAMwUxlfMd9WySeo24cYivylcYdYc85kTiIO0u/pce/z7LcXiHhKZ+VP6BbAu1lAfguZoCjlX4+Yj FwVRuq63eoeJtcbUaj7fRVmiKR2S+1Rb+k+T+j9L1Thj5ocQ9xrICpryYDRHepskRI/szsuzDPLiX OQBkPWn8hHQGd4IxiS8OH7WkaW9rtK617zf8tgvBeR5x3/t50tdt2eirO7bN3FtSmYsT0qC4WHRjg p5w/sqRm2oWQj6jpI56q6QVYoBlp/WR6KVUbnxl/ebY66zcXRzE+miPPr4NlY/zQM3/CWz72Qstd5 Xgi46Q/w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vrl1a-00000005jTo-3xJV; Sun, 15 Feb 2026 22:55:34 +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 1vrl1S-00000005jLC-35Qt for linux-arm-kernel@lists.infradead.org; Sun, 15 Feb 2026 22:55:28 +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=0Mnv5asIBgC16zhxO0+XRgGoOGoi/I6OSdCNLF9zGEg=; b=C7JCQ9 xIFW2wc3Y10PJ5E7MEYeu4mHIB8vW5LmsPMOaLIMCjrsfZI/OKwH7H+ieKF37W+t ZbSxEccxuWlkuT176kNsGBtUle3s7yGihWOs+gO13w1Wcd42FeXpSf3iA0oBhz6p 3sAvaxt0fIF2mao8thJHgokDRqbZtE+Mvy/0SRBNw513XM/7XJ3JJ/Dp4pgdFwUi TnP0v8EmzQiUzyqGbSRiwzEONJYkbAyz3u9CuaHiFh9T5kqbg/XjVmdE8Pou3NjL rEWd4cpI7Si9c59mTIhZlYwaVxBIOrvR4/zrB6SKWv9S6/SB3gzy7VdEdlP3YV1B H30t+FfC+OcHVuwA== Received: (qmail 3011446 invoked from network); 15 Feb 2026 23:55:11 +0100 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 15 Feb 2026 23:55:11 +0100 X-UD-Smtp-Session: l3s3148p1@EaEGu+RK1sAujns5 From: Wolfram Sang To: linux-renesas-soc@vger.kernel.org Cc: Andy Shevchenko , linux-arm-kernel@lists.infradead.org, Wolfram Sang , Bjorn Andersson , Baolin Wang , Maxime Coquelin , Alexandre Torgue , linux-remoteproc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com Subject: [RFC PATCH v2 06/13] hwspinlock: stm32: use new callback to initialize hwspinlock priv Date: Sun, 15 Feb 2026 23:54:46 +0100 Message-ID: <20260215225501.6365-7-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_145527_282374_B9CE22F7 X-CRM114-Status: GOOD ( 13.40 ) 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. Signed-off-by: Wolfram Sang --- drivers/hwspinlock/stm32_hwspinlock.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/hwspinlock/stm32_hwspinlock.c b/drivers/hwspinlock/stm32_hwspinlock.c index 1d75dc03f4ad..02db950c9450 100644 --- a/drivers/hwspinlock/stm32_hwspinlock.c +++ b/drivers/hwspinlock/stm32_hwspinlock.c @@ -48,10 +48,18 @@ static void stm32_hwspinlock_relax(struct hwspinlock *lock) ndelay(50); } +static void *stm32_hwspinlock_init_priv(int local_id, void *init_data) +{ + void __iomem *io_base = init_data; + + return io_base + local_id * sizeof(u32); +} + static const struct hwspinlock_ops stm32_hwspinlock_ops = { .trylock = stm32_hwspinlock_trylock, .unlock = stm32_hwspinlock_unlock, .relax = stm32_hwspinlock_relax, + .init_priv = stm32_hwspinlock_init_priv, }; static void stm32_hwspinlock_disable_clk(void *data) @@ -73,7 +81,7 @@ static int stm32_hwspinlock_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct stm32_hwspinlock *hw; void __iomem *io_base; - int i, ret; + int ret; io_base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(io_base)) @@ -106,11 +114,8 @@ static int stm32_hwspinlock_probe(struct platform_device *pdev) return ret; } - for (i = 0; i < STM32_MUTEX_NUM_LOCKS; i++) - hw->bank.lock[i].priv = io_base + i * sizeof(u32); - ret = devm_hwspin_lock_register(dev, &hw->bank, &stm32_hwspinlock_ops, - 0, STM32_MUTEX_NUM_LOCKS); + 0, STM32_MUTEX_NUM_LOCKS, io_base); if (ret) dev_err(dev, "Failed to register hwspinlock\n"); -- 2.51.0