From nobody Mon Jun 8 09:47:56 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 74B3034041B for ; Thu, 4 Jun 2026 12:00:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780574456; cv=none; b=ILHkasmizqo2KxDMgOKLIn2fuuATp1Rbg7EJ9q7yR1GwJSdCzpTs7iaqtjDVGthDD3lbaF+Gewe/qzQX/E8XHVBJJ8POhLNIl/s4nbBgcEdqtsGpHPjme4jc7VnL4aBX3VyhDqdmqMEpej1tkoEFNs7gnvpT95z/ZwREIujhx2w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780574456; c=relaxed/simple; bh=8Fh9zYhjD/gFy78LvRj0LDP5iT0f5wjRi4b1Ovv1UJQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=nVWjYYtnAihSluboePNQ9jKs7foWf61GKdQylRdeKnTIAElHiZaNWZ29uCREBVQokAUcJ5eYtZGbANrU9FOPdz6JRCXL65+BgAOoFD846PzomQC8ufwcdIaGXbZEbP8tAMonsHVIyTeyeK1s+wWAFlTylfRXcbErjXCuQXX0E8I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=l34X1w7O; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="l34X1w7O" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 208C61F00893; Thu, 4 Jun 2026 12:00:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1780574455; bh=hvaXT+WS3+28Ms5em4eRx5zLhQaOjQgN3HrLND6HJc8=; h=From:To:Cc:Subject:Date; b=l34X1w7Ozb15WoCEL/b7AlzJc9hBBI8VIe5RMTAyOb64KLYeLNV8U5ehJUf/hMLjK iEPN5CSVht8qKfsAoZY2Ag0wGyafxWyjM9OqWtdwWF3GZjpnaeSAbKNyDYHhbh3Yn5 Uc8QNE49a0utv5KLlhEtYwZMB46MtNe9R2nQovb5cxfSkh6o1wqDPNSE5cSBYvilRt OqdU9pYWdXvwryDnvBDH6lDoCmWtRmIGw1EQs+LIAo5Qa1YlChs7YstyDyKuOA1pQ8 Y0cWouXnWBHWqAIVqI954+1X67RNBmOOJp1IVpDzhLOGBLrCMhzFFjUEUwWh1ln/j+ z8hPC/r7HUe4g== Received: from johan by xi.lan with local (Exim 4.99.3) (envelope-from ) id 1wV6kn-0000000BTKE-0KLh; Thu, 04 Jun 2026 14:00:53 +0200 From: Johan Hovold To: Mark Brown Cc: Liam Girdwood , linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH v2] regulator: bq257xx: drop confusing configuration of_node Date: Thu, 4 Jun 2026 13:59:12 +0200 Message-ID: <20260604115912.2734074-1-johan@kernel.org> X-Mailer: git-send-email 2.53.0 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" The driver reuses the OF node of the parent multi-function device but still sets the of_node field of the regulator configuration to any prior OF node. Since the MFD child device does not have an OF node set until probe is called, this field is set to NULL on first probe and to the reused OF node if the driver is later rebound. As the device_set_of_node_from_dev() helper drops a reference to any prior OF node before taking a reference to the new one this can apparently also confuse LLMs like Sashiko which flags it as a potential use-after-free (which it is not). Drop the confusing and redundant configuration of_node assignment. Link: https://sashiko.dev/#/patchset/20260408073055.5183-1-johan%40kernel.o= rg Signed-off-by: Johan Hovold --- Changes in v2: - rebase against 7.1-rc6 (and linux-next) drivers/regulator/bq257xx-regulator.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/regulator/bq257xx-regulator.c b/drivers/regulator/bq25= 7xx-regulator.c index 09c466052c04..577b277efd7f 100644 --- a/drivers/regulator/bq257xx-regulator.c +++ b/drivers/regulator/bq257xx-regulator.c @@ -143,7 +143,6 @@ static int bq257xx_regulator_probe(struct platform_devi= ce *pdev) { struct device *dev =3D &pdev->dev; struct bq257xx_reg_data *pdata; - struct device_node *np =3D dev->of_node; struct regulator_config cfg =3D {}; =20 device_set_of_node_from_dev(&pdev->dev, pdev->dev.parent); @@ -159,7 +158,6 @@ static int bq257xx_regulator_probe(struct platform_devi= ce *pdev) =20 cfg.dev =3D &pdev->dev; cfg.driver_data =3D pdata; - cfg.of_node =3D np; cfg.regmap =3D dev_get_regmap(pdev->dev.parent, NULL); if (!cfg.regmap) return -ENODEV; --=20 2.53.0