Devicetree
 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 v4 4/4] mfd: max8907: Convert to use device managed poweroff handler
Date: Tue, 27 Oct 2026 11:54:45 +0000	[thread overview]
Message-ID: <sashiko-outbox-186485@kernel.org> (raw)
In-Reply-To: <20261027114634.79706-5-clamor95@gmail.com>

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

commit 5deb6448298f2829c11e1c8af86067bd08a79d7f
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 the max8907
MFD driver with devm_register_power_off_handler().

> diff --git a/drivers/mfd/max8907.c b/drivers/mfd/max8907.c
> index 2a38e00a10c3b..e282dd82ece69 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(dev, sizeof(*max8907), GFP_KERNEL);
>  	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");
>  	}

[Severity: High]
Does replacing the maxim,system-power-controller property check with only
of_device_is_system_power_controller() break system power-off on existing
DTBs?

In include/linux/of.h, of_device_is_system_power_controller() only checks
for the unprefixed property:

static inline bool of_device_is_system_power_controller(const struct device_node *np)
{
	return of_property_read_bool(np, "system-power-controller");
}

In Documentation/devicetree/bindings/regulator/maxim,max8907.yaml (added in
commit c254fcc966ae), maxim,system-power-controller is still documented as a
deprecated property for backward compatibility alongside
system-power-controller:

  maxim,system-power-controller:
    type: boolean
    deprecated: true
    description:
      Telling whether or not this PMIC is controlling the system power.

  system-power-controller: true

Should max8907_i2c_probe() check both
of_device_is_system_power_controller(dev->of_node) and
of_property_read_bool(dev->of_node, "maxim,system-power-controller") so
existing DTBs using the vendor-prefixed property continue to register the
power-off handler?

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

      reply	other threads:[~2026-10-27 11:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-27 11:46 [PATCH v4 0/4] mfd: max8907: Schema, pdata and poweroff Svyatoslav Ryhel
2026-10-27 11:46 ` [PATCH v4 1/4] regulator: dt-bindings: maxim,max8907: Convert to DT schema Svyatoslav Ryhel
2026-10-27 17:47   ` Mark Brown
2026-10-27 11:46 ` [PATCH v4 2/4] mfd: max8907: Remove platform_data based probing Svyatoslav Ryhel
2026-10-27 11:46 ` [PATCH v4 3/4] mfd: max8907: Switch to resource-managed versions of helpers Svyatoslav Ryhel
2026-10-27 11:46 ` [PATCH v4 4/4] mfd: max8907: Convert to use device managed poweroff handler Svyatoslav Ryhel
2026-10-27 11:54   ` sashiko-bot [this message]

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-186485@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox