Patchwork leds-mc13892: fix suspend/resume

login
register
mail settings
Submitter Bryan Wu
Date March 18, 2010, 3:38 a.m.
Message ID <1268883495-9382-1-git-send-email-bryan.wu@canonical.com>
Download mbox | patch
Permalink /patch/47985/
State Accepted
Delegated to: Andy Whitcroft
Headers show

Comments

Bryan Wu - March 18, 2010, 3:38 a.m.
From: Jeremy Kerr <jeremy.kerr@canonical.com>

BugLink: http://bugs.launchpad.net/bugs/537083

The workqueue update for the leds-mc13892 driver introduced a regression
where machine would no longer suspend and resume, as the wrong type was
being retrieved from the platform drvdata.

This change updates the suspend and resume functions to use the struct
mc13892_led type.

Signed-off-by: Jeremy Kerr <jeremy.kerr@canonical.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
---
 drivers/leds/leds-mc13892.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
Andy Whitcroft - March 19, 2010, 3:49 p.m.
On Thu, Mar 18, 2010 at 11:38:15AM +0800, Bryan Wu wrote:
> From: Jeremy Kerr <jeremy.kerr@canonical.com>
> 
> BugLink: http://bugs.launchpad.net/bugs/537083
> 
> The workqueue update for the leds-mc13892 driver introduced a regression
> where machine would no longer suspend and resume, as the wrong type was
> being retrieved from the platform drvdata.
> 
> This change updates the suspend and resume functions to use the struct
> mc13892_led type.
> 
> Signed-off-by: Jeremy Kerr <jeremy.kerr@canonical.com>
> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
> ---
>  drivers/leds/leds-mc13892.c |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/leds/leds-mc13892.c b/drivers/leds/leds-mc13892.c
> index 464bec9..02e7c9d 100644
> --- a/drivers/leds/leds-mc13892.c
> +++ b/drivers/leds/leds-mc13892.c
> @@ -121,17 +121,17 @@ err_free:
>  #ifdef CONFIG_PM
>  static int mc13892_led_suspend(struct platform_device *dev, pm_message_t state)
>  {
> -	struct led_classdev *led_cdev = platform_get_drvdata(dev);
> +	struct mc13892_led *led = platform_get_drvdata(dev);
>  
> -	led_classdev_suspend(led_cdev);
> +	led_classdev_suspend(&led->cdev);
>  	return 0;
>  }
>  
>  static int mc13892_led_resume(struct platform_device *dev)
>  {
> -	struct led_classdev *led_cdev = platform_get_drvdata(dev);
> +	struct mc13892_led *led = platform_get_drvdata(dev);
>  
> -	led_classdev_resume(led_cdev);
> +	led_classdev_resume(&led->cdev);
>  	return 0;
>  }
>  #else

Looks reasonable.

Acked-by: Andy Whitcroft <apw@canonical.com>

-apw
Andy Whitcroft - March 19, 2010, 4:17 p.m.
Applied to Lucid.

-apw

Patch

diff --git a/drivers/leds/leds-mc13892.c b/drivers/leds/leds-mc13892.c
index 464bec9..02e7c9d 100644
--- a/drivers/leds/leds-mc13892.c
+++ b/drivers/leds/leds-mc13892.c
@@ -121,17 +121,17 @@  err_free:
 #ifdef CONFIG_PM
 static int mc13892_led_suspend(struct platform_device *dev, pm_message_t state)
 {
-	struct led_classdev *led_cdev = platform_get_drvdata(dev);
+	struct mc13892_led *led = platform_get_drvdata(dev);
 
-	led_classdev_suspend(led_cdev);
+	led_classdev_suspend(&led->cdev);
 	return 0;
 }
 
 static int mc13892_led_resume(struct platform_device *dev)
 {
-	struct led_classdev *led_cdev = platform_get_drvdata(dev);
+	struct mc13892_led *led = platform_get_drvdata(dev);
 
-	led_classdev_resume(led_cdev);
+	led_classdev_resume(&led->cdev);
 	return 0;
 }
 #else