summaryrefslogtreecommitdiff
path: root/drivers/platform/x86
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2023-04-30 18:57:54 +0200
committerHans de Goede <hdegoede@redhat.com>2023-05-09 12:29:50 +0200
commit2c437ed302d4ad47cf325a4367e535639f3f16f9 (patch)
tree0ca6ad262c2dcf9b1fd8ff30a6b0ef2c65f9ec6a /drivers/platform/x86
parent017ad809680c1e59d0b744ccd28e2e94899b4099 (diff)
downloadlinux-next-2c437ed302d4ad47cf325a4367e535639f3f16f9.tar.gz
platform/x86: lenovo-yogabook: Switch to DEFINE_SIMPLE_DEV_PM_OPS()
Switch to DEFINE_SIMPLE_DEV_PM_OPS() so that the __maybe_unused can be dropped from the suspend/resume callbacks. While at it also drop the _wmi_ part from the callback names in preparation for making lenovo-yogabook-wmi also work on the Android version of the Yoga Book 1 which does not have a WMI interface to deal with toggling the keyboard half between touch-keyboard and wacom-digitizer mode. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20230430165807.472798-7-hdegoede@redhat.com
Diffstat (limited to 'drivers/platform/x86')
-rw-r--r--drivers/platform/x86/lenovo-yogabook-wmi.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/platform/x86/lenovo-yogabook-wmi.c b/drivers/platform/x86/lenovo-yogabook-wmi.c
index 0b49c7a54bfc..2a46e19893e8 100644
--- a/drivers/platform/x86/lenovo-yogabook-wmi.c
+++ b/drivers/platform/x86/lenovo-yogabook-wmi.c
@@ -346,7 +346,7 @@ static void yogabook_wmi_remove(struct wmi_device *wdev)
acpi_dev_put(data->kbd_adev);
}
-static int __maybe_unused yogabook_wmi_suspend(struct device *dev)
+static int yogabook_suspend(struct device *dev)
{
struct wmi_device *wdev = container_of(dev, struct wmi_device, dev);
struct yogabook_wmi *data = dev_get_drvdata(dev);
@@ -362,7 +362,7 @@ static int __maybe_unused yogabook_wmi_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused yogabook_wmi_resume(struct device *dev)
+static int yogabook_resume(struct device *dev)
{
struct wmi_device *wdev = container_of(dev, struct wmi_device, dev);
struct yogabook_wmi *data = dev_get_drvdata(dev);
@@ -391,13 +391,12 @@ static const struct wmi_device_id yogabook_wmi_id_table[] = {
{ } /* Terminating entry */
};
-static SIMPLE_DEV_PM_OPS(yogabook_wmi_pm_ops,
- yogabook_wmi_suspend, yogabook_wmi_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(yogabook_pm_ops, yogabook_suspend, yogabook_resume);
static struct wmi_driver yogabook_wmi_driver = {
.driver = {
.name = "yogabook-wmi",
- .pm = &yogabook_wmi_pm_ops,
+ .pm = pm_sleep_ptr(&yogabook_pm_ops),
},
.no_notify_data = true,
.id_table = yogabook_wmi_id_table,