]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
reset: intel: Use devm_register_restart_handler()
authorAndrew Davis <afd@ti.com>
Wed, 13 Aug 2025 21:41:34 +0000 (16:41 -0500)
committerPhilipp Zabel <p.zabel@pengutronix.de>
Fri, 6 Mar 2026 10:03:28 +0000 (11:03 +0100)
Function register_restart_handler() is deprecated. Using this new API
removes our need to keep and manage a struct notifier_block and to
later unregister the handler.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
drivers/reset/reset-intel-gw.c

index a5ce3350cb5ea5cdbf1f8a6167bd0ddc842f013c..0db64cc8a2822e2dc1b870792a8dc316a402ffb1 100644 (file)
@@ -28,7 +28,6 @@ struct intel_reset_soc {
 
 struct intel_reset_data {
        struct reset_controller_dev rcdev;
-       struct notifier_block restart_nb;
        const struct intel_reset_soc *soc_data;
        struct regmap *regmap;
        struct device *dev;
@@ -153,12 +152,10 @@ static int intel_reset_xlate(struct reset_controller_dev *rcdev,
        return id;
 }
 
-static int intel_reset_restart_handler(struct notifier_block *nb,
-                                      unsigned long action, void *data)
+static int intel_reset_restart_handler(struct sys_off_data *data)
 {
-       struct intel_reset_data *reset_data;
+       struct intel_reset_data *reset_data = data->cb_data;
 
-       reset_data = container_of(nb, struct intel_reset_data, restart_nb);
        intel_assert_device(&reset_data->rcdev, reset_data->reboot_id);
 
        return NOTIFY_DONE;
@@ -215,9 +212,7 @@ static int intel_reset_probe(struct platform_device *pdev)
        if (data->soc_data->legacy)
                data->reboot_id |= FIELD_PREP(STAT_BIT_OFFSET_MASK, rb_id[2]);
 
-       data->restart_nb.notifier_call =        intel_reset_restart_handler;
-       data->restart_nb.priority =             128;
-       register_restart_handler(&data->restart_nb);
+       devm_register_restart_handler(&pdev->dev, intel_reset_restart_handler, data);
 
        return 0;
 }