diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-11-12 18:09:32 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-12 22:09:20 -0500 |
commit | ebc41e43b2b72e236019580490044604a48824e5 (patch) | |
tree | 4925bfc71ee1fbc39bcc96e282f2ce4f0e53fc12 | |
parent | 0524fc5194e548a4fe32d87850b976e0ec4e9007 (diff) |
backlight: ams369fg06: use devm_{backlight,lcd}_device_register()
Use devm_backlight_device_register() and devm_lcd_device_register() to
make cleanup paths simpler.
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>
-rw-r--r-- | drivers/video/backlight/ams369fg06.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/drivers/video/backlight/ams369fg06.c b/drivers/video/backlight/ams369fg06.c index df5507b2b492..d8952c4aa689 100644 --- a/drivers/video/backlight/ams369fg06.c +++ b/drivers/video/backlight/ams369fg06.c | |||
@@ -477,8 +477,8 @@ static int ams369fg06_probe(struct spi_device *spi) | |||
477 | return -EINVAL; | 477 | return -EINVAL; |
478 | } | 478 | } |
479 | 479 | ||
480 | ld = lcd_device_register("ams369fg06", &spi->dev, lcd, | 480 | ld = devm_lcd_device_register(&spi->dev, "ams369fg06", &spi->dev, lcd, |
481 | &ams369fg06_lcd_ops); | 481 | &ams369fg06_lcd_ops); |
482 | if (IS_ERR(ld)) | 482 | if (IS_ERR(ld)) |
483 | return PTR_ERR(ld); | 483 | return PTR_ERR(ld); |
484 | 484 | ||
@@ -488,12 +488,11 @@ static int ams369fg06_probe(struct spi_device *spi) | |||
488 | props.type = BACKLIGHT_RAW; | 488 | props.type = BACKLIGHT_RAW; |
489 | props.max_brightness = MAX_BRIGHTNESS; | 489 | props.max_brightness = MAX_BRIGHTNESS; |
490 | 490 | ||
491 | bd = backlight_device_register("ams369fg06-bl", &spi->dev, lcd, | 491 | bd = devm_backlight_device_register(&spi->dev, "ams369fg06-bl", |
492 | &ams369fg06_backlight_ops, &props); | 492 | &spi->dev, lcd, |
493 | if (IS_ERR(bd)) { | 493 | &ams369fg06_backlight_ops, &props); |
494 | ret = PTR_ERR(bd); | 494 | if (IS_ERR(bd)) |
495 | goto out_lcd_unregister; | 495 | return PTR_ERR(bd); |
496 | } | ||
497 | 496 | ||
498 | bd->props.brightness = DEFAULT_BRIGHTNESS; | 497 | bd->props.brightness = DEFAULT_BRIGHTNESS; |
499 | lcd->bd = bd; | 498 | lcd->bd = bd; |
@@ -516,10 +515,6 @@ static int ams369fg06_probe(struct spi_device *spi) | |||
516 | dev_info(&spi->dev, "ams369fg06 panel driver has been probed.\n"); | 515 | dev_info(&spi->dev, "ams369fg06 panel driver has been probed.\n"); |
517 | 516 | ||
518 | return 0; | 517 | return 0; |
519 | |||
520 | out_lcd_unregister: | ||
521 | lcd_device_unregister(ld); | ||
522 | return ret; | ||
523 | } | 518 | } |
524 | 519 | ||
525 | static int ams369fg06_remove(struct spi_device *spi) | 520 | static int ams369fg06_remove(struct spi_device *spi) |
@@ -527,9 +522,6 @@ static int ams369fg06_remove(struct spi_device *spi) | |||
527 | struct ams369fg06 *lcd = spi_get_drvdata(spi); | 522 | struct ams369fg06 *lcd = spi_get_drvdata(spi); |
528 | 523 | ||
529 | ams369fg06_power(lcd, FB_BLANK_POWERDOWN); | 524 | ams369fg06_power(lcd, FB_BLANK_POWERDOWN); |
530 | backlight_device_unregister(lcd->bd); | ||
531 | lcd_device_unregister(lcd->ld); | ||
532 | |||
533 | return 0; | 525 | return 0; |
534 | } | 526 | } |
535 | 527 | ||