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>
This commit is contained in:
Родитель
1d7976b24d
Коммит
c9023492b4
|
@ -545,44 +545,26 @@ static int ams369fg06_remove(struct spi_device *spi)
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CONFIG_PM)
|
#if defined(CONFIG_PM)
|
||||||
static unsigned int before_power;
|
|
||||||
|
|
||||||
static int ams369fg06_suspend(struct spi_device *spi, pm_message_t mesg)
|
static int ams369fg06_suspend(struct spi_device *spi, pm_message_t mesg)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
|
||||||
struct ams369fg06 *lcd = dev_get_drvdata(&spi->dev);
|
struct ams369fg06 *lcd = dev_get_drvdata(&spi->dev);
|
||||||
|
|
||||||
dev_dbg(&spi->dev, "lcd->power = %d\n", lcd->power);
|
dev_dbg(&spi->dev, "lcd->power = %d\n", lcd->power);
|
||||||
|
|
||||||
before_power = lcd->power;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* when lcd panel is suspend, lcd panel becomes off
|
* when lcd panel is suspend, lcd panel becomes off
|
||||||
* regardless of status.
|
* regardless of status.
|
||||||
*/
|
*/
|
||||||
ret = ams369fg06_power(lcd, FB_BLANK_POWERDOWN);
|
return ams369fg06_power(lcd, FB_BLANK_POWERDOWN);
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ams369fg06_resume(struct spi_device *spi)
|
static int ams369fg06_resume(struct spi_device *spi)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
|
||||||
struct ams369fg06 *lcd = dev_get_drvdata(&spi->dev);
|
struct ams369fg06 *lcd = dev_get_drvdata(&spi->dev);
|
||||||
|
|
||||||
/*
|
lcd->power = FB_BLANK_POWERDOWN;
|
||||||
* 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;
|
|
||||||
|
|
||||||
dev_dbg(&spi->dev, "before_power = %d\n", before_power);
|
return ams369fg06_power(lcd, FB_BLANK_UNBLANK);
|
||||||
|
|
||||||
ret = ams369fg06_power(lcd, before_power);
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#define ams369fg06_suspend NULL
|
#define ams369fg06_suspend NULL
|
||||||
|
|
Загрузка…
Ссылка в новой задаче