From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 E0B3B2EA48F for ; Wed, 8 Apr 2026 12:53:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775652840; cv=none; b=VL0yBpM9syZm6oo7xvcQpQaKwDrUJOE1ou8MgCi9uoJkHgwc+SPHM+pud4MUw1vNdIQ3k+TZyhN45aqT+HZ10kE42XxIad9UAkDfAKbKEg8lukzLhva8+pZkekjZqSTPYOFANzFq2y5r12rWcahXPNX5TI7YeigF+VGNqtYru7E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775652840; c=relaxed/simple; bh=cnRrHS6BEk8qi2httDG+96oV2ZHV453lgqq0zJaYz4A=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=UfED26lLdBcD3AFOjc346iLJcP6uiVIY8CJr2s2Cnfn6bulg18epK0vkWAVjMWP87PcZqGNyokyMncimtgZm2ZY0x7QfmRMqwrO9WxflLF8bI8cWBSmcnZyT4yvYYmCotYSi1lWTTtsMUFGLGbaL4mTUYPzv6KvIj9iRlcUrrDM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=CAmtF03k; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="CAmtF03k" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 76CDAC19421; Wed, 8 Apr 2026 12:53:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775652839; bh=cnRrHS6BEk8qi2httDG+96oV2ZHV453lgqq0zJaYz4A=; h=From:To:Cc:Subject:Date:From; b=CAmtF03kiCN7Nln2NA6m9F8anOjFaYUy8JVloerPW6WA5S07f2r1RIzl/Bjwg7FlJ hsSkAur3/bMXHm2gjD8i1lYOK7U/TWCOBRCb2DpaqeHAY39SHaRA/WWPBcwIDoFKIU ZRO0CLFIjy6keUWSKmIDQdMVNGKn2xEnjc9z0SLOEL1jFabRfv+tSHC9TrP3jF5VMl kn9OSDhZpVYb4khAPdxOwNOBd2H1S9oNytzZ6nI0D/qP1n4+wUt9KQlFXw9Rhkev1r SEHJ77EmgYZKvynXJMYnwQxfDkT4z4fv/FSrVdie8+Rb0xhpmiBG/aQUy2WeWlBDTO CK/oBY5uA55Nw== Received: from johan by xi.lan with local (Exim 4.98.2) (envelope-from ) id 1wASPt-00000000nGE-1SqW; Wed, 08 Apr 2026 14:53:57 +0200 From: Johan Hovold To: Mark Brown Cc: Liam Girdwood , linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH] regulator: bq257xx: drop confusing configuration of_node Date: Wed, 8 Apr 2026 14:53:47 +0200 Message-ID: <20260408125347.189345-1-johan@kernel.org> X-Mailer: git-send-email 2.52.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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.org Signed-off-by: Johan Hovold --- This is a follow-up to the reused OF node imbalance series: https://lore.kernel.org/lkml/20260408073055.5183-1-johan@kernel.org/ to address a false-positive Sashiko report. Johan drivers/regulator/bq257xx-regulator.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/regulator/bq257xx-regulator.c b/drivers/regulator/bq257xx-regulator.c index 711dbe045383..86225566e10a 100644 --- a/drivers/regulator/bq257xx-regulator.c +++ b/drivers/regulator/bq257xx-regulator.c @@ -139,7 +139,6 @@ static int bq257xx_regulator_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct bq257xx_device *bq = dev_get_drvdata(pdev->dev.parent); struct bq257xx_reg_data *pdata; - struct device_node *np = dev->of_node; struct regulator_config cfg = {}; device_set_of_node_from_dev(&pdev->dev, pdev->dev.parent); @@ -156,7 +155,6 @@ static int bq257xx_regulator_probe(struct platform_device *pdev) cfg.dev = &pdev->dev; cfg.driver_data = pdata; - cfg.of_node = np; cfg.regmap = dev_get_regmap(pdev->dev.parent, NULL); if (!cfg.regmap) return -ENODEV; -- 2.52.0