backlight: s6e63m0: remove redundant variable 'before_power'
authorJingoo Han <jg1.han@samsung.com>
Fri, 22 Feb 2013 00:43:25 +0000 (16:43 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 22 Feb 2013 01:22:22 +0000 (17:22 -0800)
'before_power' was used to check the previous status when resume() is
called.  However, FB_BLANK_POWERDOWN was used in suspend() all the time,
so there is no need to check the previous status.  Also, redundant return
variables are removed to reduce the code.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/video/backlight/s6e63m0.c

index 87831bba7a895b75ce4f0182390bdf560aa1577a..92e53e20b2eaa7c8b2fb025cd2d2625499bc1cad 100644 (file)
@@ -827,44 +827,26 @@ static int s6e63m0_remove(struct spi_device *spi)
 }
 
 #if defined(CONFIG_PM)
 }
 
 #if defined(CONFIG_PM)
-static unsigned int before_power;
-
 static int s6e63m0_suspend(struct spi_device *spi, pm_message_t mesg)
 {
 static int s6e63m0_suspend(struct spi_device *spi, pm_message_t mesg)
 {
-       int ret = 0;
        struct s6e63m0 *lcd = dev_get_drvdata(&spi->dev);
 
        dev_dbg(&spi->dev, "lcd->power = %d\n", lcd->power);
 
        struct s6e63m0 *lcd = dev_get_drvdata(&spi->dev);
 
        dev_dbg(&spi->dev, "lcd->power = %d\n", lcd->power);
 
-       before_power = lcd->power;
-
        /*
         * when lcd panel is suspend, lcd panel becomes off
         * regardless of status.
         */
        /*
         * when lcd panel is suspend, lcd panel becomes off
         * regardless of status.
         */
-       ret = s6e63m0_power(lcd, FB_BLANK_POWERDOWN);
-
-       return ret;
+       return s6e63m0_power(lcd, FB_BLANK_POWERDOWN);
 }
 
 static int s6e63m0_resume(struct spi_device *spi)
 {
 }
 
 static int s6e63m0_resume(struct spi_device *spi)
 {
-       int ret = 0;
        struct s6e63m0 *lcd = dev_get_drvdata(&spi->dev);
 
        struct s6e63m0 *lcd = dev_get_drvdata(&spi->dev);
 
-       /*
-        * after suspended, if lcd panel status is FB_BLANK_UNBLANK
-        * (at that time, before_power is FB_BLANK_UNBLANK) then
-        * it changes that status to FB_BLANK_POWERDOWN to get lcd on.
-        */
-       if (before_power == FB_BLANK_UNBLANK)
-               lcd->power = FB_BLANK_POWERDOWN;
+       lcd->power = FB_BLANK_POWERDOWN;
 
 
-       dev_dbg(&spi->dev, "before_power = %d\n", before_power);
-
-       ret = s6e63m0_power(lcd, before_power);
-
-       return ret;
+       return s6e63m0_power(lcd, FB_BLANK_UNBLANK);
 }
 #else
 #define s6e63m0_suspend                NULL
 }
 #else
 #define s6e63m0_suspend                NULL