diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-02-21 19:43:28 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-21 20:22:22 -0500 |
commit | 66ecc11dfc3c9b47f9f78b7455c3d498329e891a (patch) | |
tree | 20700ec243b01e9b574fb58a4e7bc461786a4923 /drivers/video | |
parent | 51976436169ebb607e16a971e3a391480de710d1 (diff) |
backlight: ams369fg06: remove unnecessary NULL deference check
Remove unnecessary NULL deference check, because it was already checked in
ams369fg06_probe(). Also, unnecessary parentheses are removed in
ams369fg06_power_is_on().
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 | 32 |
1 files changed, 8 insertions, 24 deletions
diff --git a/drivers/video/backlight/ams369fg06.c b/drivers/video/backlight/ams369fg06.c index 55b27921bf9e..b4bf130bc203 100644 --- a/drivers/video/backlight/ams369fg06.c +++ b/drivers/video/backlight/ams369fg06.c | |||
@@ -314,26 +314,17 @@ static int ams369fg06_ldi_disable(struct ams369fg06 *lcd) | |||
314 | 314 | ||
315 | static int ams369fg06_power_is_on(int power) | 315 | static int ams369fg06_power_is_on(int power) |
316 | { | 316 | { |
317 | return ((power) <= FB_BLANK_NORMAL); | 317 | return power <= FB_BLANK_NORMAL; |
318 | } | 318 | } |
319 | 319 | ||
320 | static int ams369fg06_power_on(struct ams369fg06 *lcd) | 320 | static int ams369fg06_power_on(struct ams369fg06 *lcd) |
321 | { | 321 | { |
322 | int ret = 0; | 322 | int ret = 0; |
323 | struct lcd_platform_data *pd = NULL; | 323 | struct lcd_platform_data *pd; |
324 | struct backlight_device *bd = NULL; | 324 | struct backlight_device *bd; |
325 | 325 | ||
326 | pd = lcd->lcd_pd; | 326 | pd = lcd->lcd_pd; |
327 | if (!pd) { | ||
328 | dev_err(lcd->dev, "platform data is NULL.\n"); | ||
329 | return -EFAULT; | ||
330 | } | ||
331 | |||
332 | bd = lcd->bd; | 327 | bd = lcd->bd; |
333 | if (!bd) { | ||
334 | dev_err(lcd->dev, "backlight device is NULL.\n"); | ||
335 | return -EFAULT; | ||
336 | } | ||
337 | 328 | ||
338 | if (!pd->power_on) { | 329 | if (!pd->power_on) { |
339 | dev_err(lcd->dev, "power_on is NULL.\n"); | 330 | dev_err(lcd->dev, "power_on is NULL.\n"); |
@@ -375,14 +366,10 @@ static int ams369fg06_power_on(struct ams369fg06 *lcd) | |||
375 | 366 | ||
376 | static int ams369fg06_power_off(struct ams369fg06 *lcd) | 367 | static int ams369fg06_power_off(struct ams369fg06 *lcd) |
377 | { | 368 | { |
378 | int ret = 0; | 369 | int ret; |
379 | struct lcd_platform_data *pd = NULL; | 370 | struct lcd_platform_data *pd; |
380 | 371 | ||
381 | pd = lcd->lcd_pd; | 372 | pd = lcd->lcd_pd; |
382 | if (!pd) { | ||
383 | dev_err(lcd->dev, "platform data is NULL\n"); | ||
384 | return -EFAULT; | ||
385 | } | ||
386 | 373 | ||
387 | ret = ams369fg06_ldi_disable(lcd); | 374 | ret = ams369fg06_ldi_disable(lcd); |
388 | if (ret) { | 375 | if (ret) { |
@@ -392,11 +379,7 @@ static int ams369fg06_power_off(struct ams369fg06 *lcd) | |||
392 | 379 | ||
393 | msleep(pd->power_off_delay); | 380 | msleep(pd->power_off_delay); |
394 | 381 | ||
395 | if (!pd->power_on) { | 382 | pd->power_on(lcd->ld, 0); |
396 | dev_err(lcd->dev, "power_on is NULL.\n"); | ||
397 | return -EFAULT; | ||
398 | } else | ||
399 | pd->power_on(lcd->ld, 0); | ||
400 | 383 | ||
401 | return 0; | 384 | return 0; |
402 | } | 385 | } |
@@ -535,8 +518,9 @@ static int ams369fg06_probe(struct spi_device *spi) | |||
535 | lcd->power = FB_BLANK_POWERDOWN; | 518 | lcd->power = FB_BLANK_POWERDOWN; |
536 | 519 | ||
537 | ams369fg06_power(lcd, FB_BLANK_UNBLANK); | 520 | ams369fg06_power(lcd, FB_BLANK_UNBLANK); |
538 | } else | 521 | } else { |
539 | lcd->power = FB_BLANK_UNBLANK; | 522 | lcd->power = FB_BLANK_UNBLANK; |
523 | } | ||
540 | 524 | ||
541 | dev_set_drvdata(&spi->dev, lcd); | 525 | dev_set_drvdata(&spi->dev, lcd); |
542 | 526 | ||