Skip to contentSkip to conversation

platform / x86: Convert remaining drivers to dev_pm_ops-based PM

PATCH In review Rafael J. Wysocki 2 participants 4 messages Jun 30, 2012 – Jul 6, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover platform / x86: Convert remaining drivers to dev_pm_ops-based PM

Hi all,

After the changes I've sent recently there are two more drivers still using legacy power management callbacks, so convert them too:

[1/2] hdaps: Use struct dev_pm_ops for power management [2/2] msi-laptop: Use struct dev_pm_ops for power management

Thanks,
Rafael

#2 lore raw

PATCH 2/2 msi-laptop: Use struct dev_pm_ops for power management

From: Rafael J. Wysocki <[email protected]>

Make the msi-laptop driver define its PM callbacks through a struct dev_pm_ops object rather than by using legacy PM hooks in struct platform_driver.

---
 drivers/platform/x86/msi-laptop.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/platform/x86/msi-laptop.c +4 -3
Index: linux/drivers/platform/x86/msi-laptop.c
===================================================================
@@ -85,7 +85,8 @@
 #define MSI_STANDARD_EC_TOUCHPAD_ADDRESS	0xe4
 #define MSI_STANDARD_EC_TOUCHPAD_MASK		(1 << 4)
 
-static int msi_laptop_resume(struct platform_device *device);
+static int msi_laptop_resume(struct device *device);
+static SIMPLE_DEV_PM_OPS(msi_laptop_pm, NULL, msi_laptop_resume);
 
 #define MSI_STANDARD_EC_DEVICES_EXISTS_ADDRESS	0x2f
 
@@ -437,8 +438,8 @@ static struct platform_driver msipf_driv
 	.driver = {
 		.name = "msi-laptop-pf",
 		.owner = THIS_MODULE,
+		.pm = &msi_laptop_pm,
 	},
-	.resume = msi_laptop_resume,
 };
 
 static struct platform_device *msipf_device;
@@ -752,7 +753,7 @@ err_bluetooth:
 	return retval;
 }
 
-static int msi_laptop_resume(struct platform_device *device)
+static int msi_laptop_resume(struct device *device)
 {
 	u8 data;
 	int result;
#1 lore raw

PATCH 1/2 hdaps: Use struct dev_pm_ops for power management

In reply to Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

Make the HDAPS driver define its PM callbacks through a struct dev_pm_ops object rather than by using legacy PM hooks in struct platform_driver.

---
 drivers/platform/x86/hdaps.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/platform/x86/hdaps.c +4 -2
Index: linux/drivers/platform/x86/hdaps.c
===================================================================
@@ -305,17 +305,19 @@ static int hdaps_probe(struct platform_d
 	return 0;
 }
 
-static int hdaps_resume(struct platform_device *dev)
+static int hdaps_resume(struct device *dev)
 {
 	return hdaps_device_init();
 }
 
+static SIMPLE_DEV_PM_OPS(hdaps_pm, NULL, hdaps_resume);
+
 static struct platform_driver hdaps_driver = {
 	.probe = hdaps_probe,
-	.resume = hdaps_resume,
 	.driver	= {
 		.name = "hdaps",
 		.owner = THIS_MODULE,
+		.pm = &hdaps_pm,
 	},
 };
 
maintainer Acked-by on v1 2/2
#3 lore raw

Re: [PATCH 2/2] msi-laptop: Use struct dev_pm_ops for power management

In reply to Rafael J. Wysocki

於 六,2012-06-30 於 23:57 +0200,Rafael J. Wysocki 提到:

Quoted 7 lines

From: Rafael J. Wysocki <[email protected]>

Make the msi-laptop driver define its PM callbacks through a struct dev_pm_ops object rather than by using legacy PM hooks in struct platform_driver.

This patch good to me.

Thanks a lot!
Joey Lee

Quoted 44 lines
---
 drivers/platform/x86/msi-laptop.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Index: linux/drivers/platform/x86/msi-laptop.c
===================================================================

drivers/platform/x86/msi-laptop.c +4 -4
@@ -85,7 +85,8 @@
 #define MSI_STANDARD_EC_TOUCHPAD_ADDRESS	0xe4
 #define MSI_STANDARD_EC_TOUCHPAD_MASK		(1 << 4)
 
-static int msi_laptop_resume(struct platform_device *device);
+static int msi_laptop_resume(struct device *device);
+static SIMPLE_DEV_PM_OPS(msi_laptop_pm, NULL, msi_laptop_resume);
 
 #define MSI_STANDARD_EC_DEVICES_EXISTS_ADDRESS	0x2f
 
@@ -437,8 +438,8 @@ static struct platform_driver msipf_driv
 	.driver = {
 		.name = "msi-laptop-pf",
 		.owner = THIS_MODULE,
+		.pm = &msi_laptop_pm,
 	},
-	.resume = msi_laptop_resume,
 };
 
 static struct platform_device *msipf_device;
@@ -752,7 +753,7 @@ err_bluetooth:
 	return retval;
 }
 
-static int msi_laptop_resume(struct platform_device *device)
+static int msi_laptop_resume(struct device *device)
 {
 	u8 data;
 	int result;
 
--

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/