From: Lee Jones <lee@kernel.org>
To: Svyatoslav Ryhel <clamor95@gmail.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
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
Date: Wed, 2 Dec 2026 20:13:09 +0000 [thread overview]
Message-ID: <20261202201309.GF98551@kernel.org> (raw)
In-Reply-To: <CAPVz0n2yqS-UEzuMHDvxGeW+GBXhsHy603yaBEmQM0NkSZuTLg@mail.gmail.com>
On Wed, 02 Dec 2026, Svyatoslav Ryhel wrote:
> ср, 2 груд. 2026 р. о 18:48 Svyatoslav Ryhel <clamor95@gmail.com> пише:
> >
> > ср, 2 груд. 2026 р. о 18:44 Lee Jones <lee@kernel.org> пише:
> > >
> > > 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 <clamor95@gmail.com>
> > > > ---
> > > > 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
next prev parent reply other threads:[~2026-12-02 20:13 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-23 15:02 [PATCH v6 0/5] mfd: max8907: Schema, pdata and poweroff Svyatoslav Ryhel
2026-11-23 15:02 ` [PATCH v6 1/5] regulator: dt-bindings: maxim,max8907: Convert to DT schema Svyatoslav Ryhel
2026-11-26 15:52 ` Svyatoslav Ryhel
2026-11-26 16:03 ` Mark Brown
2026-11-26 16:05 ` Svyatoslav Ryhel
2026-12-02 16:41 ` Lee Jones
2026-12-02 16:43 ` Svyatoslav Ryhel
2026-11-23 15:02 ` [PATCH v6 2/5] mfd: max8907: Remove platform_data based probing Svyatoslav Ryhel
2026-12-02 16:44 ` Lee Jones
2026-12-02 16:48 ` Svyatoslav Ryhel
2026-12-02 17:16 ` Svyatoslav Ryhel
2026-12-02 20:13 ` Lee Jones [this message]
2026-11-23 15:02 ` [PATCH v6 3/5] mfd: max8907: Switch to resource-managed versions of helpers Svyatoslav Ryhel
2026-11-23 15:02 ` [PATCH v6 4/5] mfd: max8907: Convert to use device managed poweroff handler Svyatoslav Ryhel
2026-11-23 15:10 ` sashiko-bot
2026-12-02 16:42 ` Lee Jones
2026-12-02 16:44 ` Svyatoslav Ryhel
2026-12-02 20:14 ` Lee Jones
2026-11-23 15:02 ` [PATCH v6 5/5] mfd: max8907: Add restart handler Svyatoslav Ryhel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261202201309.GF98551@kernel.org \
--to=lee@kernel.org \
--cc=broonie@kernel.org \
--cc=clamor95@gmail.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mfd@lists.linux.dev \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.