Skip to content
Snippets Groups Projects
Commit 8a7a83c8 authored by Dmitry Osipenko's avatar Dmitry Osipenko
Browse files

powerpc/fsl: Use sys-off handler


Replace restart handler with sys-off handler. Restart handler might become
deprecated once all users are switched to sys-off handler, this allows to
removes some boilerplate code and provides more features.

Signed-off-by: default avatarDmitry Osipenko <dmitry.osipenko@collabora.com>
parent 4e7f8b73
No related branches found
No related tags found
No related merge requests found
...@@ -155,23 +155,19 @@ EXPORT_SYMBOL(get_baudrate); ...@@ -155,23 +155,19 @@ EXPORT_SYMBOL(get_baudrate);
#if defined(CONFIG_FSL_SOC_BOOKE) || defined(CONFIG_PPC_86xx) #if defined(CONFIG_FSL_SOC_BOOKE) || defined(CONFIG_PPC_86xx)
static __be32 __iomem *rstcr; static __be32 __iomem *rstcr;
static int fsl_rstcr_restart(struct notifier_block *this, static void fsl_rstcr_restart(struct restart_data *data)
unsigned long mode, void *cmd)
{ {
local_irq_disable(); local_irq_disable();
/* set reset control register */ /* set reset control register */
out_be32(rstcr, 0x2); /* HRESET_REQ */ out_be32(rstcr, 0x2); /* HRESET_REQ */
return NOTIFY_DONE;
} }
static int __init setup_rstcr(void) static int __init setup_rstcr(void)
{ {
struct device_node *np; struct device_node *np;
static struct notifier_block restart_handler = { static struct sys_off_handler restart_handler = {
.notifier_call = fsl_rstcr_restart, .restart_cb = fsl_rstcr_restart,
.priority = 128,
}; };
for_each_node_by_name(np, "global-utilities") { for_each_node_by_name(np, "global-utilities") {
...@@ -181,7 +177,7 @@ static int __init setup_rstcr(void) ...@@ -181,7 +177,7 @@ static int __init setup_rstcr(void)
printk (KERN_ERR "Error: reset control " printk (KERN_ERR "Error: reset control "
"register not mapped!\n"); "register not mapped!\n");
} else { } else {
register_restart_handler(&restart_handler); register_sys_off_handler(&restart_handler);
} }
break; break;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment