linux-pwm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Thierry Reding" <thierry.reding@gmail.com>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Hans de Goede <hdegoede@redhat.com>,
	Yauhen Kharuzhy <jekhor@gmail.com>,
	platform-driver-x86@vger.kernel.org, linux-pwm@vger.kernel.org
Subject: [PATCH v2 06/19] platform/x86: lenovo-yogabook: Switch to DEFINE_SIMPLE_DEV_PM_OPS()
Date: Sun, 30 Apr 2023 18:57:54 +0200	[thread overview]
Message-ID: <20230430165807.472798-7-hdegoede@redhat.com> (raw)
In-Reply-To: <20230430165807.472798-1-hdegoede@redhat.com>

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>
---
 drivers/platform/x86/lenovo-yogabook-wmi.c | 9 ++++-----
 1 file 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,
-- 
2.39.2


  parent reply	other threads:[~2023-04-30 16:59 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-30 16:57 [PATCH v2 00/19] platform/x86: lenovo-yogabook: Modify to also work on Android version Hans de Goede
2023-04-30 16:57 ` [PATCH v2 01/19] pwm: Export pwm_add_table() / pwm_remove_table() Hans de Goede
2023-04-30 16:57 ` [PATCH v2 02/19] platform/x86: lenovo-yogabook: Fix work race on remove() Hans de Goede
2023-04-30 16:57 ` [PATCH v2 03/19] platform/x86: lenovo-yogabook: Reprobe devices " Hans de Goede
2023-04-30 16:57 ` [PATCH v2 04/19] platform/x86: lenovo-yogabook: Set default keyboard backligh brightness on probe() Hans de Goede
2023-04-30 16:57 ` [PATCH v2 05/19] platform/x86: lenovo-yogabook: Simplify gpio lookup table cleanup Hans de Goede
2023-04-30 16:57 ` Hans de Goede [this message]
2023-04-30 16:57 ` [PATCH v2 07/19] platform/x86: lenovo-yogabook: Store dev instead of wdev in drvdata struct Hans de Goede
2023-04-30 16:57 ` [PATCH v2 08/19] platform/x86: lenovo-yogabook: Add dev local variable to probe() Hans de Goede
2023-04-30 16:57 ` [PATCH v2 09/19] platform/x86: lenovo-yogabook: Use PMIC LED driver for pen icon LED control Hans de Goede
2023-04-30 16:57 ` [PATCH v2 10/19] platform/x86: lenovo-yogabook: Split probe() into generic and WMI specific parts Hans de Goede
2023-05-01  9:53   ` Andy Shevchenko
2023-05-09 10:32     ` Hans de Goede
2023-04-30 16:57 ` [PATCH v2 11/19] platform/x86: lenovo-yogabook: Stop checking adev->power.state Hans de Goede
2023-04-30 16:58 ` [PATCH v2 12/19] platform/x86: lenovo-yogabook: Abstract kbd backlight setting Hans de Goede
2023-04-30 16:58 ` [PATCH v2 13/19] platform/x86: lenovo-yogabook: Add a yogabook_toggle_digitizer_mode() helper function Hans de Goede
2023-04-30 16:58 ` [PATCH v2 14/19] platform/x86: lenovo-yogabook: Drop _wmi_ from remaining generic symbols Hans de Goede
2023-04-30 16:58 ` [PATCH v2 15/19] platform/x86: lenovo-yogabook: Group WMI specific code together Hans de Goede
2023-04-30 16:58 ` [PATCH v2 16/19] platform/x86: lenovo-yogabook: Add YB_KBD_BL_MAX define Hans de Goede
2023-04-30 16:58 ` [PATCH v2 17/19] platform/x86: lenovo-yogabook: Add platform driver support Hans de Goede
2023-04-30 16:58 ` [PATCH v2 18/19] platform/x86: lenovo-yogabook: Add keyboard backlight control to platform driver Hans de Goede
2023-05-04 16:53   ` Uwe Kleine-König
2023-05-05  9:07     ` Andy Shevchenko
2023-05-05  9:21       ` Uwe Kleine-König
2023-05-05 11:43         ` Andy Shevchenko
2023-05-06 11:26         ` Hans de Goede
2023-05-09 10:39           ` Hans de Goede
2023-04-30 16:58 ` [PATCH v2 19/19] platform/x86: lenovo-yogabook: Rename lenovo-yogabook-wmi to lenovo-yogabook Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230430165807.472798-7-hdegoede@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=andy@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=jekhor@gmail.com \
    --cc=linux-pwm@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=thierry.reding@gmail.com \
    --cc=u.kleine-koenig@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).