All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Svyatoslav Ryhel" <clamor95@gmail.com>
Cc: devicetree@vger.kernel.org, mfd@lists.linux.dev, robh@kernel.org,
	conor+dt@kernel.org, lee@kernel.org
Subject: Re: [PATCH v5 4/5] mfd: max8907: Convert to use device managed poweroff handler
Date: Sun, 15 Nov 2026 09:14:55 +0000	[thread overview]
Message-ID: <sashiko-outbox-215334@kernel.org> (raw)
In-Reply-To: <20261115090147.95337-5-clamor95@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] mfd: max8907: max8907_i2c_probe() drops
  maxim,system-power-controller check
--

commit fb2af9972c7fa309fa63776f15c1fc76c0092afe
Author: Svyatoslav Ryhel <clamor95@gmail.com>

mfd: max8907: Convert to use device managed poweroff handler

This commit replaces the global pm_power_off assignment in max8907 with
devm_register_power_off_handler() and switches the DT property check from
"maxim,system-power-controller" to of_device_is_system_power_controller().

> diff --git a/drivers/mfd/max8907.c b/drivers/mfd/max8907.c
> index f6d7a4ce9712f..8412dab2133e3 100644
> --- a/drivers/mfd/max8907.c
> +++ b/drivers/mfd/max8907.c

[ ... ]

> @@ -185,8 +192,6 @@ static int max8907_i2c_probe(struct i2c_client *i2c)
>  	struct device *dev = &i2c->dev;
>  	struct max8907 *max8907;
>  	int ret;
> -	bool pm_off = of_property_read_bool(dev->of_node,
> -					"maxim,system-power-controller");
>  
>  	max8907 = devm_kzalloc_obj(dev, struct max8907);
>  	if (!max8907)
> @@ -237,9 +242,10 @@ static int max8907_i2c_probe(struct i2c_client *i2c)
>  	if (ret)
>  		return dev_err_probe(dev, ret, "Failed to add MFD devices\n");
>  
> -	if (pm_off && !pm_power_off) {
> -		max8907_pm_off = max8907;
> -		pm_power_off = max8907_power_off;
> +	if (of_device_is_system_power_controller(dev->of_node)) {
> +		ret = devm_register_power_off_handler(dev, max8907_power_off, max8907);
> +		if (ret)
> +			return dev_err_probe(dev, ret, "failed to register power-off handler\n");
>  	}
>  
>  	return 0;

[Severity: Medium]
Should max8907_i2c_probe() still check for "maxim,system-power-controller"
as a fallback alongside of_device_is_system_power_controller()?

of_device_is_system_power_controller() only checks for the standard
"system-power-controller" property.  In commit "regulator: dt-bindings:
maxim,max8907: Convert to DT schema", Documentation/devicetree/bindings/
regulator/maxim,max8907.yaml marks "maxim,system-power-controller" as
deprecated rather than removed, and commit "mfd: max8907: Remove
platform_data based probing" notes that external DTBs may exist for this
driver.  On any system booting with an existing DTB that uses
"maxim,system-power-controller", this regression causes max8907_i2c_probe()
to skip registering the power-off handler, leaving the board unable to
power off via the PMIC.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261115090147.95337-1-clamor95@gmail.com?part=4

  reply	other threads:[~2026-11-15  9:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-15  9:01 [PATCH v5 0/5] mfd: max8907: Schema, pdata and poweroff Svyatoslav Ryhel
2026-11-15  9:01 ` [PATCH v5 1/5] regulator: dt-bindings: maxim,max8907: Convert to DT schema Svyatoslav Ryhel
2026-11-15  9:01 ` [PATCH v5 2/5] mfd: max8907: Remove platform_data based probing Svyatoslav Ryhel
2026-11-15  9:01 ` [PATCH v5 3/5] mfd: max8907: Switch to resource-managed versions of helpers Svyatoslav Ryhel
2026-11-15  9:01 ` [PATCH v5 4/5] mfd: max8907: Convert to use device managed poweroff handler Svyatoslav Ryhel
2026-11-15  9:14   ` sashiko-bot [this message]
2026-11-15  9:01 ` [PATCH v5 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=sashiko-outbox-215334@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=clamor95@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=lee@kernel.org \
    --cc=mfd@lists.linux.dev \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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.