From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796242394; b=zUxevFbL5Nqv8k66gfDOaiWZZcpNfwcid4d3YGgOSBysSdqE1NocO/y45BPjQ6txyzBO Ge4BFH9P7XPXtb7tYzdYmseuDfm+TVlfPwqAnztc3yX86DdVFEbhNR61sdEdAAchT0etj Tbk1WguycWdYcXQzUJzRMHys9oJxKOFMYiaYXOUjeguDPDTuUwLzi08wHW+ACVst5z1sT ZVSHp+XvsUc2eVtTcx0+MWtzDc98Ooiw8fWJsO/lTJBzGfjrai8l1UBItJZiIFOhlMLGD RoKSNmaS0dH6JK5T6fsXdyft+0Zj4k0URjTjr88at/JpdzEH/w4+/oY8WxID/2vsddA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796242394; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition: Content-Transfer-Encoding:In-Reply-To; bh=wVY7un5IDH5HpmbLfMPEziDnLnm3L6pCi3CzvSpiWtg=; b=tQ7WMUueXFLfd5DNG3m+kqKrqj6GbuEFfCnV3exxt9nW060xhhIzAJbyE0XtHRwinIip 69ABTy17/sC+66E+XbADTfaNFBikWrDJFW3VMfoTLs8fndDERjHdDlDhKK/dqH8CZ4dAF XjUxORcllra5jcnOvHVrg9ulwcA78kAC2WTfWQfPL7S/158J08zjGg4A65h8pArPGHNhM mXr1Tv6QN0WpFUQgioAB8KM+I6MCQ7rrFxDmnz/hu3axqixxHB73Vvhwhi+K4roAZNOyk xpvkDTIkg8LXHCb02SHbx0xlE8iBVM2CZyA6S+v0l4dBCrDKllE2epgyUyDXnkkhARA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="AdMZiif/"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C3349606A32C; Wed, 2 Dec 2026 20:13:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=AdMZiif/ Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A4781F00896; Wed, 2 Dec 2026 20:13:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796242394; bh=wVY7un5IDH5HpmbLfMPEziDnLnm3L6pCi3CzvSpiWtg=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=AdMZiif/gC6mC8gtjf1ua9vqBeUboIm6PUgpKXsww1ATrMKw8dgkG9JF3fMMs19se oqVwvhp9Z/i7NYC7+UF8l66a/syZdFtrJPt1Tjej9wwl9tf+VYgT6bDhgV7QGQ/ZoM ns87gsETKR2Q2xcJit3244XgxpnSkkqG8/PhzDpGKMA8Qtg/6Mmn2julO26Hb7XMwh HRfoFMItfSGDOpf34hf+HjGbOWk7njzjPJsytI+pvvoX8FWCJ9YIcy+5AzGrtBxMnj yXCfjGO31OL+V123sKsD9IUtt5Ok7inLObjoIUn33XH+AOlURdTcAh0RDsFSAJZyTv lpbrlQkMqvhuQ== Date: Wed, 2 Dec 2026 20:13:09 +0000 From: Lee Jones To: Svyatoslav Ryhel Cc: Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, mfd@lists.linux.dev Subject: Re: [PATCH v6 2/5] mfd: max8907: Remove platform_data based probing Message-ID: <20261202201309.GF98551@kernel.org> References: <20261123150224.199601-1-clamor95@gmail.com> <20261123150224.199601-3-clamor95@gmail.com> <179568533810.32537.9645200165381940400@kernel.org> X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Wed, 02 Dec 2026, Svyatoslav Ryhel wrote: > ср, 2 груд. 2026 р. о 18:48 Svyatoslav Ryhel пише: > > > > ср, 2 груд. 2026 р. о 18:44 Lee Jones пише: > > > > > > On Mon, 23 Nov 2026, Svyatoslav Ryhel wrote: > > > > There are no in-tree users of this driver, but it supports devicetree > > > > based probing, which means external dtb files may exist that work with > > > > this. > > > > > > > > Remove the unused legacy code and make this a DT-only driver. > > > > > > > > Signed-off-by: Svyatoslav Ryhel > > > > --- > > > > drivers/mfd/max8907.c | 8 +------- > > > > drivers/regulator/max8907-regulator.c | 8 +++----- > > > > include/linux/mfd/max8907.h | 5 ----- > > > > 3 files changed, 4 insertions(+), 17 deletions(-) > > > > > > > > diff --git a/drivers/mfd/max8907.c b/drivers/mfd/max8907.c > > > > index 2f91791410538..a0e0c480ff43e 100644 > > > > --- a/drivers/mfd/max8907.c > > > > +++ b/drivers/mfd/max8907.c > > > > @@ -188,13 +188,7 @@ static int max8907_i2c_probe(struct i2c_client *i2c) > > > > { > > > > struct max8907 *max8907; > > > > int ret; > > > > - struct max8907_platform_data *pdata = dev_get_platdata(&i2c->dev); > > > > - bool pm_off = false; > > > > - > > > > - if (pdata) > > > > - pm_off = pdata->pm_off; > > > > - else if (i2c->dev.of_node) > > > > - pm_off = of_property_read_bool(i2c->dev.of_node, > > > > + bool pm_off = of_property_read_bool(i2c->dev.of_node, > > > > "maxim,system-power-controller"); > > > > > > > > max8907 = devm_kzalloc_obj(&i2c->dev, struct max8907); > > > > diff --git a/drivers/regulator/max8907-regulator.c b/drivers/regulator/max8907-regulator.c > > > > index fd227fd136121..84de0c443c945 100644 > > > > --- a/drivers/regulator/max8907-regulator.c > > > > +++ b/drivers/regulator/max8907-regulator.c > > > > @@ -274,7 +274,6 @@ static inline struct device_node *match_of_node(int index) > > > > static int max8907_regulator_probe(struct platform_device *pdev) > > > > { > > > > struct max8907 *max8907 = dev_get_drvdata(pdev->dev.parent); > > > > - struct max8907_platform_data *pdata = dev_get_platdata(max8907->dev); > > > > int ret; > > > > struct max8907_regulator *pmic; > > > > unsigned int val; > > > > @@ -312,10 +311,9 @@ static int max8907_regulator_probe(struct platform_device *pdev) > > > > struct regulator_dev *rdev; > > > > > > > > config.dev = pdev->dev.parent; > > > > - if (pdata) > > > > - idata = pdata->init_data[i]; > > > > - else > > > > - idata = match_init_data(i); > > > > + > > > > + idata = match_init_data(i); > > > > > > In v3's changelog you noted: > > > > > > "added idata check in max8907_regulator_probe() for BBAT/SDBY/VRTC" > > > > > > ... but that NULL guard around 'idata->supply_regulator' seems to have > > > been dropped here? When a DT omits the 'bbat', 'sdby', or 'vrtc' child > > > node, match_init_data() returns NULL and it will dereference a NULL > > > pointer, no? > > > > > > > It was accidentally removed between v5 and v6. > > > > LOOL, it was fixed BY YOU! > > https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/drivers/regulator/max8907-regulator.c?id=8c7542439d56f734fb6598b141c14e69b705e2fc Ha ha! That _is_ funny! =:-D I won't be able to apply this without an immutable pull from Mark. -- Lee Jones