mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 21:51:05 +00:00
toshiba_acpi: Use struct dev_pm_ops for power management
Make the toshiba_acpi driver define its PM callbacks through a struct dev_pm_ops object rather than by using legacy PM hooks in struct acpi_device_ops. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
This commit is contained in:
parent
d202f77d2e
commit
43d2fd3b9d
1 changed files with 8 additions and 6 deletions
|
@ -1296,9 +1296,9 @@ static void toshiba_acpi_notify(struct acpi_device *acpi_dev, u32 event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int toshiba_acpi_suspend(struct acpi_device *acpi_dev)
|
static int toshiba_acpi_suspend(struct device *device)
|
||||||
{
|
{
|
||||||
struct toshiba_acpi_dev *dev = acpi_driver_data(acpi_dev);
|
struct toshiba_acpi_dev *dev = acpi_driver_data(to_acpi_device(device));
|
||||||
u32 result;
|
u32 result;
|
||||||
|
|
||||||
if (dev->hotkey_dev)
|
if (dev->hotkey_dev)
|
||||||
|
@ -1307,9 +1307,9 @@ static int toshiba_acpi_suspend(struct acpi_device *acpi_dev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int toshiba_acpi_resume(struct acpi_device *acpi_dev)
|
static int toshiba_acpi_resume(struct device *device)
|
||||||
{
|
{
|
||||||
struct toshiba_acpi_dev *dev = acpi_driver_data(acpi_dev);
|
struct toshiba_acpi_dev *dev = acpi_driver_data(to_acpi_device(device));
|
||||||
u32 result;
|
u32 result;
|
||||||
|
|
||||||
if (dev->hotkey_dev)
|
if (dev->hotkey_dev)
|
||||||
|
@ -1318,6 +1318,9 @@ static int toshiba_acpi_resume(struct acpi_device *acpi_dev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static SIMPLE_DEV_PM_OPS(toshiba_acpi_pm,
|
||||||
|
toshiba_acpi_suspend, toshiba_acpi_resume);
|
||||||
|
|
||||||
static struct acpi_driver toshiba_acpi_driver = {
|
static struct acpi_driver toshiba_acpi_driver = {
|
||||||
.name = "Toshiba ACPI driver",
|
.name = "Toshiba ACPI driver",
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
|
@ -1327,9 +1330,8 @@ static struct acpi_driver toshiba_acpi_driver = {
|
||||||
.add = toshiba_acpi_add,
|
.add = toshiba_acpi_add,
|
||||||
.remove = toshiba_acpi_remove,
|
.remove = toshiba_acpi_remove,
|
||||||
.notify = toshiba_acpi_notify,
|
.notify = toshiba_acpi_notify,
|
||||||
.suspend = toshiba_acpi_suspend,
|
|
||||||
.resume = toshiba_acpi_resume,
|
|
||||||
},
|
},
|
||||||
|
.drv.pm = &toshiba_acpi_pm,
|
||||||
};
|
};
|
||||||
|
|
||||||
static int __init toshiba_acpi_init(void)
|
static int __init toshiba_acpi_init(void)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue