diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-02-21 19:43:30 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-21 20:22:22 -0500 |
commit | c9023492b49b2a9506ae2f054167da02c71ef2b6 (patch) | |
tree | 69bdd093ae07e27cbe673981322a8fe250598b35 /drivers/video | |
parent | 1d7976b24d11f1ba971b95382735b300be80f3df (diff) |
backlight: ams369fg06: remove redundant variable 'before_power'
'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>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/backlight/ams369fg06.c | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/drivers/video/backlight/ams369fg06.c b/drivers/video/backlight/ams369fg06.c index 22756dda8682..4794a9aba3fa 100644 --- a/drivers/video/backlight/ams369fg06.c +++ b/drivers/video/backlight/ams369fg06.c | |||
@@ -545,44 +545,26 @@ static int ams369fg06_remove(struct spi_device *spi) | |||
545 | } | 545 | } |
546 | 546 | ||
547 | #if defined(CONFIG_PM) | 547 | #if defined(CONFIG_PM) |
548 | static unsigned int before_power; | ||
549 | |||
550 | static int ams369fg06_suspend(struct spi_device *spi, pm_message_t mesg) | 548 | static int ams369fg06_suspend(struct spi_device *spi, pm_message_t mesg) |
551 | { | 549 | { |
552 | int ret = 0; | ||
553 | struct ams369fg06 *lcd = dev_get_drvdata(&spi->dev); | 550 | struct ams369fg06 *lcd = dev_get_drvdata(&spi->dev); |
554 | 551 | ||
555 | dev_dbg(&spi->dev, "lcd->power = %d\n", lcd->power); | 552 | dev_dbg(&spi->dev, "lcd->power = %d\n", lcd->power); |
556 | 553 | ||
557 | before_power = lcd->power; | ||
558 | |||
559 | /* | 554 | /* |
560 | * when lcd panel is suspend, lcd panel becomes off | 555 | * when lcd panel is suspend, lcd panel becomes off |
561 | * regardless of status. | 556 | * regardless of status. |
562 | */ | 557 | */ |
563 | ret = ams369fg06_power(lcd, FB_BLANK_POWERDOWN); | 558 | return ams369fg06_power(lcd, FB_BLANK_POWERDOWN); |
564 | |||
565 | return ret; | ||
566 | } | 559 | } |
567 | 560 | ||
568 | static int ams369fg06_resume(struct spi_device *spi) | 561 | static int ams369fg06_resume(struct spi_device *spi) |
569 | { | 562 | { |
570 | int ret = 0; | ||
571 | struct ams369fg06 *lcd = dev_get_drvdata(&spi->dev); | 563 | struct ams369fg06 *lcd = dev_get_drvdata(&spi->dev); |
572 | 564 | ||
573 | /* | 565 | lcd->power = FB_BLANK_POWERDOWN; |
574 | * after suspended, if lcd panel status is FB_BLANK_UNBLANK | ||
575 | * (at that time, before_power is FB_BLANK_UNBLANK) then | ||
576 | * it changes that status to FB_BLANK_POWERDOWN to get lcd on. | ||
577 | */ | ||
578 | if (before_power == FB_BLANK_UNBLANK) | ||
579 | lcd->power = FB_BLANK_POWERDOWN; | ||
580 | 566 | ||
581 | dev_dbg(&spi->dev, "before_power = %d\n", before_power); | 567 | return ams369fg06_power(lcd, FB_BLANK_UNBLANK); |
582 | |||
583 | ret = ams369fg06_power(lcd, before_power); | ||
584 | |||
585 | return ret; | ||
586 | } | 568 | } |
587 | #else | 569 | #else |
588 | #define ams369fg06_suspend NULL | 570 | #define ams369fg06_suspend NULL |