Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

reset: ath79: 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>

authored by

Andrew Davis and committed by
Philipp Zabel
59ad2fb0 6de23f81

+3 -9
+3 -9
drivers/reset/reset-ath79.c
··· 15 15 16 16 struct ath79_reset { 17 17 struct reset_controller_dev rcdev; 18 - struct notifier_block restart_nb; 19 18 void __iomem *base; 20 19 spinlock_t lock; 21 20 }; ··· 71 72 .status = ath79_reset_status, 72 73 }; 73 74 74 - static int ath79_reset_restart_handler(struct notifier_block *nb, 75 - unsigned long action, void *data) 75 + static int ath79_reset_restart_handler(struct sys_off_data *data) 76 76 { 77 - struct ath79_reset *ath79_reset = 78 - container_of(nb, struct ath79_reset, restart_nb); 77 + struct ath79_reset *ath79_reset = data->cb_data; 79 78 80 79 ath79_reset_assert(&ath79_reset->rcdev, FULL_CHIP_RESET); 81 80 ··· 105 108 if (err) 106 109 return err; 107 110 108 - ath79_reset->restart_nb.notifier_call = ath79_reset_restart_handler; 109 - ath79_reset->restart_nb.priority = 128; 110 - 111 - err = register_restart_handler(&ath79_reset->restart_nb); 111 + err = devm_register_restart_handler(&pdev->dev, ath79_reset_restart_handler, ath79_reset); 112 112 if (err) 113 113 dev_warn(&pdev->dev, "Failed to register restart handler\n"); 114 114