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

x86/platform/olpc: Use register_platform_power_off()


Utilize new register_platform_power_off() API that allows to register
multiple power-off handlers and deprecates global pm_power_off callback.

Signed-off-by: default avatarDmitry Osipenko <dmitry.osipenko@collabora.com>
parent 24cd048a
No related branches found
No related tags found
No related merge requests found
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <linux/cs5535.h> #include <linux/cs5535.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/reboot.h>
#include <linux/export.h> #include <linux/export.h>
#include <linux/pm.h> #include <linux/pm.h>
#include <linux/suspend.h> #include <linux/suspend.h>
...@@ -137,7 +138,7 @@ static int xo1_pm_probe(struct platform_device *pdev) ...@@ -137,7 +138,7 @@ static int xo1_pm_probe(struct platform_device *pdev)
/* If we have both addresses, we can override the poweroff hook */ /* If we have both addresses, we can override the poweroff hook */
if (pms_base && acpi_base) { if (pms_base && acpi_base) {
suspend_set_ops(&xo1_suspend_ops); suspend_set_ops(&xo1_suspend_ops);
pm_power_off = xo1_power_off; register_platform_power_off(xo1_power_off);
printk(KERN_INFO "OLPC XO-1 support registered\n"); printk(KERN_INFO "OLPC XO-1 support registered\n");
} }
...@@ -146,12 +147,15 @@ static int xo1_pm_probe(struct platform_device *pdev) ...@@ -146,12 +147,15 @@ static int xo1_pm_probe(struct platform_device *pdev)
static int xo1_pm_remove(struct platform_device *pdev) static int xo1_pm_remove(struct platform_device *pdev)
{ {
if (pms_base && acpi_base) {
unregister_platform_power_off(xo1_power_off);
suspend_set_ops(NULL);
}
if (strcmp(pdev->name, "cs5535-pms") == 0) if (strcmp(pdev->name, "cs5535-pms") == 0)
pms_base = 0; pms_base = 0;
else if (strcmp(pdev->name, "olpc-xo1-pm-acpi") == 0) else if (strcmp(pdev->name, "olpc-xo1-pm-acpi") == 0)
acpi_base = 0; acpi_base = 0;
pm_power_off = NULL;
return 0; return 0;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment