Skip to content

Commit ad87aee

Browse files
glneosre
authored andcommitted
power: reset: brcmstb: 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. Signed-off-by: Andrew Davis <[email protected]> Reviewed-by: Dhruva Gole <[email protected]> Acked-by: Florian Fainelli <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sebastian Reichel <[email protected]>
1 parent a4ceaab commit ad87aee

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

drivers/power/reset/brcmstb-reboot.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ struct reset_reg_mask {
2929

3030
static const struct reset_reg_mask *reset_masks;
3131

32-
static int brcmstb_restart_handler(struct notifier_block *this,
33-
unsigned long mode, void *cmd)
32+
static int brcmstb_restart_handler(struct sys_off_data *data)
3433
{
3534
int rc;
3635
u32 tmp;
@@ -65,11 +64,6 @@ static int brcmstb_restart_handler(struct notifier_block *this,
6564
return NOTIFY_DONE;
6665
}
6766

68-
static struct notifier_block brcmstb_restart_nb = {
69-
.notifier_call = brcmstb_restart_handler,
70-
.priority = 128,
71-
};
72-
7367
static const struct reset_reg_mask reset_bits_40nm = {
7468
.rst_src_en_mask = BIT(0),
7569
.sw_mstr_rst_mask = BIT(0),
@@ -100,7 +94,8 @@ static int brcmstb_reboot_probe(struct platform_device *pdev)
10094
rst_src_en = args[0];
10195
sw_mstr_rst = args[1];
10296

103-
rc = register_restart_handler(&brcmstb_restart_nb);
97+
rc = devm_register_sys_off_handler(&pdev->dev, SYS_OFF_MODE_RESTART,
98+
128, brcmstb_restart_handler, NULL);
10499
if (rc)
105100
dev_err(&pdev->dev,
106101
"cannot register restart handler (err=%d)\n", rc);

0 commit comments

Comments
 (0)