From nobody Mon Apr 6 13:30:31 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 6556D3C6A37 for ; Thu, 19 Mar 2026 11:00:23 +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=1773918030; cv=none; b=dh9TW48HMBvutT01WtQRk2vX2jsHvfJk/U3MN13+Dqg9vV32cZsngWI9mJ4w+frOM4pVt57kR+fw+AZOF2svZVcOMQWQjz+xqzT+EjUq86fv6gRBLuHVEzhgV0Vawx0thfo0ZMaoEHai5DZlU37c33xB6TrOkryjlJGHmFGRQN0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773918030; c=relaxed/simple; bh=KzyLEUFyySml/W/QoWMCTJFa5ir/a4hjtyApO1sVLuQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AeTxWOLVtexbgTPFGqD8KPWdZ850VzScTg7kCHAH8L4ZVpQ4yv6r/yQBpjM3/YAQQr9L9JKtd/sqPsTf3Co+OVjwdF7GePkWTefg3PAlMArrg5xHPoK+FVSIL8kZcg9kUYJGqoihwYvZZjqPlkfv5rEddH/9v3FsaRpQOkrH3N0= 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=i3a2eKDx; 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="i3a2eKDx" 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=zJPnV6sWCqcikZmuYtUvxsV1HgXNWyKzDo8+0458in4=; b=i3a2eK DxSBMURYHxV4OXoM+UKykTDNhOCzRHayQxgVcIUd+QIen0ieRn56eQCrHfQvUD4R uKZN/6u1fTHyr9YMdeKvdk/VWP4tz4AwGIVh4ZSuVDKTzGIy6zZy2W4jcYfNWH2Q 4BDHHl5PW96xUcmGZq6EdSohg46AJr+0HpY6PC8wGT3z1PLjF/yMaSIRFLCPgmyE C5jJw/5W5DEdIfrxFYvlGpqYWbdqDA/GwcvC/Fco3N4voWMu3ZzML0Rr/JlCYHNn WqYuE1gq6Z6BLTBY9g3nXbniafKoA7lhbRGUVXV1KWffXQuzsuvsrH0iA6jmp3ba nvywWZbfAF3MKLPg== Received: (qmail 1099602 invoked from network); 19 Mar 2026 11:59:59 +0100 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 19 Mar 2026 11:59:59 +0100 X-UD-Smtp-Session: l3s3148p1@PFs7eF5NbJsgAwDPXzF+ANZpdrMKUeLI 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 v5 08/15] hwspinlock: stm32: use new callback to initialize hwspinlock priv Date: Thu, 19 Mar 2026 11:59:30 +0100 Message-ID: <20260319105947.6237-9-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260319105947.6237-1-wsa+renesas@sang-engineering.com> References: <20260319105947.6237-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.51.0