From: Svyatoslav Ryhel <clamor95@gmail.com>
To: Lee Jones <lee@kernel.org>, Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
Svyatoslav Ryhel <clamor95@gmail.com>
Cc: linux-kernel@vger.kernel.org, mfd@lists.linux.dev
Subject: [PATCH v1 3/6] mfd: max8907: Convert to use device managed poweroff handler
Date: Fri, 27 Nov 2026 18:40:41 +0200 [thread overview]
Message-ID: <20261127164044.285910-4-clamor95@gmail.com> (raw)
In-Reply-To: <20261127164044.285910-1-clamor95@gmail.com>
Replace devm_register_sys_off_handler() function with the dedicated
devm_register_power_off_handler() helper.
There are no in-kernel users of maxim,system-power-controller property and
all new users will use generic system-power-controller so check for the
legacy property can be removed.
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
---
drivers/mfd/max8907.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/drivers/mfd/max8907.c b/drivers/mfd/max8907.c
index 8091514c28aa1..f6eeefb419622 100644
--- a/drivers/mfd/max8907.c
+++ b/drivers/mfd/max8907.c
@@ -190,8 +190,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)
@@ -242,12 +240,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) {
- ret = devm_register_sys_off_handler(dev, SYS_OFF_MODE_POWER_OFF,
- SYS_OFF_PRIO_DEFAULT,
- max8907_power_off, max8907);
+ 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 sys-off handler\n");
+ return dev_err_probe(dev, ret, "failed to register power-off handler\n");
}
return 0;
--
2.53.0
next prev parent reply other threads:[~2026-11-27 16:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 16:40 [PATCH v1 0/6] mfd: max8907: for Lee Svyatoslav Ryhel
2026-11-27 16:40 ` [PATCH v1 1/6] mfd: max8907: Remove platform_data based probing Svyatoslav Ryhel
2026-11-27 16:40 ` [PATCH v1 2/6] mfd: max8907: Switch to resource-managed versions of helpers Svyatoslav Ryhel
2026-11-27 16:40 ` Svyatoslav Ryhel [this message]
2026-11-27 16:40 ` [PATCH v1 4/6] mfd: max8907: Add restart handler Svyatoslav Ryhel
2026-11-27 16:40 ` [PATCH v1 5/6] mfd: max8907: Add ADC client support Svyatoslav Ryhel
2026-11-27 16:40 ` [PATCH v1 6/6] mfd: max8907: Add ADC cell 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=20261127164044.285910-4-clamor95@gmail.com \
--to=clamor95@gmail.com \
--cc=broonie@kernel.org \
--cc=lee@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mfd@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
all inboxes | Powered by JetHome®