mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
reset: intel: Use devm_register_restart_handler()
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>
This commit is contained in:
committed by
Philipp Zabel
parent
59ad2fb0be
commit
8bfef0c243
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user