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: lpc18xx: Use devm_register_sys_off_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
09f16612 8bfef0c2

+4 -8
+4 -8
drivers/reset/reset-lpc18xx.c
··· 31 31 32 32 struct lpc18xx_rgu_data { 33 33 struct reset_controller_dev rcdev; 34 - struct notifier_block restart_nb; 35 34 struct clk *clk_delay; 36 35 struct clk *clk_reg; 37 36 void __iomem *base; ··· 40 41 41 42 #define to_rgu_data(p) container_of(p, struct lpc18xx_rgu_data, rcdev) 42 43 43 - static int lpc18xx_rgu_restart(struct notifier_block *nb, unsigned long mode, 44 - void *cmd) 44 + static int lpc18xx_rgu_restart(struct sys_off_data *data) 45 45 { 46 - struct lpc18xx_rgu_data *rc = container_of(nb, struct lpc18xx_rgu_data, 47 - restart_nb); 46 + struct lpc18xx_rgu_data *rc = data->cb_data; 48 47 49 48 writel(BIT(LPC18XX_RGU_CORE_RST), rc->base + LPC18XX_RGU_CTRL0); 50 49 mdelay(2000); ··· 175 178 if (ret) 176 179 return dev_err_probe(&pdev->dev, ret, "unable to register device\n"); 177 180 178 - rc->restart_nb.priority = 192, 179 - rc->restart_nb.notifier_call = lpc18xx_rgu_restart, 180 - ret = register_restart_handler(&rc->restart_nb); 181 + ret = devm_register_sys_off_handler(&pdev->dev, SYS_OFF_MODE_RESTART, 192, 182 + lpc18xx_rgu_restart, rc); 181 183 if (ret) 182 184 dev_warn(&pdev->dev, "failed to register restart handler\n"); 183 185