From nobody Thu Apr 9 08:55:25 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 937663659ED for ; Tue, 10 Mar 2026 07:56:16 +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=1773129381; cv=none; b=ZDavZqsswy7eObeB6UItholYtvl8PrMIzMO7EP/NDyc1kVyRkDuDDHthGlAVRiLd9tCwuR7rkxLTJJ5xQtkvY2sbefvgw/ZIR+77fKLqcVTPvknb6tT3w7w1cF1gB5BY2IUgTS7mIAh7p5yKMiZd9YCgw0NV6VvoAgkgFO0k2lA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773129381; c=relaxed/simple; bh=U1qZ9jIrkPpwE5zid3eu2tzycTF41Kp+jVWr8Ch5bjM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Z2gE8tfIBmi5yIBVsy28EfaGI7Lozg5XgVclNmOa3mS4QTd9MVj3aeVnneob5jR/JczScAiwiZOuZmHV4VDeBXHO8wdD4g7k7X9f1eWad5+L/PRkwdJ+3jxqG6EyZDu5WYVahS3hIff/+4jtlkiVA2JzlpOpRByXedoKNujdViI= 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=QWR0TbGP; 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="QWR0TbGP" 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=LDIMIHD5xh8qvwSFq+3EkqfTJhIyn7kfCnloFC1bgFA=; b=QWR0Tb GPPxLY8rjfvrErDgwaDJyfSR/zyQ6OQr5MfiQGSSDrhzqw6CwcaJpHeD+etoMke4 QJyXZdgzva9hfM75WMz6wcTswK9PttUr/aDqlc1PR4KoKbZ5/0SfkpMDbA606OFD Tj0EXLbBukqtyWuZffCTURrF0E8HTwFH+bEPBEAUsOsVPcSINqR6/ZD1bKAmUlbg eq49RS+CzOy7i4yd0qnbL/yi+SW5MH6y72eOaLc7KjOiG+8oOAB0TVhNrcqP33jj S1b/nOqLAytbE3QBWAOYpy8EWzFymGyPo4HMEjr7375/TvDA13p+aliIbAcUCe7x N3OP0TO7eW9EWL9A== Received: (qmail 3112715 invoked from network); 10 Mar 2026 08:55:54 +0100 Received: by mail.zeus03.de with UTF8SMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 10 Mar 2026 08:55:54 +0100 X-UD-Smtp-Session: l3s3148p1@I0tS2aZMytIujntP From: Wolfram Sang To: linux-renesas-soc@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Wolfram Sang , Bjorn Andersson , Baolin Wang , Maxime Coquelin , Alexandre Torgue , linux-remoteproc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH v4 08/15] hwspinlock: stm32: use new callback to initialize hwspinlock priv Date: Tue, 10 Mar 2026 08:55:23 +0100 Message-ID: <20260310075539.11701-9-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260310075539.11701-1-wsa+renesas@sang-engineering.com> References: <20260310075539.11701-1-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. Signed-off-by: Wolfram Sang --- drivers/hwspinlock/stm32_hwspinlock.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/hwspinlock/stm32_hwspinlock.c b/drivers/hwspinlock/stm= 32_hwspinlock.c index 51e8e533ac31..62214f31f909 100644 --- a/drivers/hwspinlock/stm32_hwspinlock.c +++ b/drivers/hwspinlock/stm32_hwspinlock.c @@ -48,10 +48,16 @@ static void stm32_hwspinlock_relax(struct hwspinlock *l= ock) ndelay(50); } =20 +static void *stm32_hwspinlock_init_priv(int local_id, void *init_data) +{ + return init_data + local_id * sizeof(u32); +} + static const struct hwspinlock_ops stm32_hwspinlock_ops =3D { .trylock =3D stm32_hwspinlock_trylock, .unlock =3D stm32_hwspinlock_unlock, .relax =3D stm32_hwspinlock_relax, + .init_priv =3D stm32_hwspinlock_init_priv, }; =20 static void stm32_hwspinlock_disable_clk(void *data) @@ -73,7 +79,7 @@ static int stm32_hwspinlock_probe(struct platform_device = *pdev) struct device *dev =3D &pdev->dev; struct stm32_hwspinlock *hw; void __iomem *io_base; - int i, ret; + int ret; =20 io_base =3D devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(io_base)) @@ -106,11 +112,8 @@ static int stm32_hwspinlock_probe(struct platform_devi= ce *pdev) return ret; } =20 - for (i =3D 0; i < STM32_MUTEX_NUM_LOCKS; i++) - hw->bank.lock[i].priv =3D io_base + i * sizeof(u32); - ret =3D devm_hwspin_lock_register(dev, &hw->bank, &stm32_hwspinlock_ops, - 0, STM32_MUTEX_NUM_LOCKS, NULL); + 0, STM32_MUTEX_NUM_LOCKS, io_base); =20 if (ret) dev_err(dev, "Failed to register hwspinlock\n"); --=20 2.47.3