aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/backlight/ams369fg06.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-05-29 21:05:31 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-05-29 21:05:31 -0400
commit7d36014b972a3833b883a7ef41e6bd3b0d187850 (patch)
tree5c828b0de1cd357288135cc04461d31386b89c26 /drivers/video/backlight/ams369fg06.c
parent442a9ffabb21f175027e93e72ea05159818271a6 (diff)
parentecb41a77411358d385e3fde5b4e98a5f3d9cfdd5 (diff)
Merge branch 'akpm' (Andrew's patch-bomb)
Merge patches through Andrew Morton: "180 patches - err 181 - listed below: - most of MM. I held back the (large) "memcg: add hugetlb extension" series because a bunfight has recently broken out. - leds. After this, Bryan Wu will be handling drivers/leds/ - backlight - lib/ - rtc" * emailed from Andrew Morton <akpm@linux-foundation.org>: (181 patches) drivers/rtc/rtc-s3c.c: fix compiler warning drivers/rtc/rtc-tegra.c: clean up probe/remove routines drivers/rtc/rtc-pl031.c: remove RTC timer interrupt handling drivers/rtc/rtc-lpc32xx.c: add device tree support drivers/rtc/rtc-m41t93.c: don't let get_time() reset M41T93_FLAG_OF rtc: ds1307: add trickle charger support rtc: ds1307: remove superfluous initialization rtc: rename CONFIG_RTC_MXC to CONFIG_RTC_DRV_MXC drivers/rtc/Kconfig: place RTC_DRV_IMXDI and RTC_MXC under "on-CPU RTC drivers" drivers/rtc/rtc-pcf8563.c: add RTC_VL_READ/RTC_VL_CLR ioctl feature rtc: add ioctl to get/clear battery low voltage status drivers/rtc/rtc-ep93xx.c: convert to use module_platform_driver() rtc/spear: add Device Tree probing capability lib/vsprintf.c: "%#o",0 becomes '0' instead of '00' radix-tree: fix preload vector size spinlock_debug: print kallsyms name for lock vsprintf: fix %ps on non symbols when using kallsyms lib/bitmap.c: fix documentation for scnprintf() functions lib/string_helpers.c: make arrays static lib/test-kstrtox.c: mark const init data with __initconst instead of __initdata ...
Diffstat (limited to 'drivers/video/backlight/ams369fg06.c')
-rw-r--r--drivers/video/backlight/ams369fg06.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/video/backlight/ams369fg06.c b/drivers/video/backlight/ams369fg06.c
index 7bdadc790117..3729238e7096 100644
--- a/drivers/video/backlight/ams369fg06.c
+++ b/drivers/video/backlight/ams369fg06.c
@@ -482,7 +482,7 @@ static int __devinit ams369fg06_probe(struct spi_device *spi)
482 struct backlight_device *bd = NULL; 482 struct backlight_device *bd = NULL;
483 struct backlight_properties props; 483 struct backlight_properties props;
484 484
485 lcd = kzalloc(sizeof(struct ams369fg06), GFP_KERNEL); 485 lcd = devm_kzalloc(&spi->dev, sizeof(struct ams369fg06), GFP_KERNEL);
486 if (!lcd) 486 if (!lcd)
487 return -ENOMEM; 487 return -ENOMEM;
488 488
@@ -492,7 +492,7 @@ static int __devinit ams369fg06_probe(struct spi_device *spi)
492 ret = spi_setup(spi); 492 ret = spi_setup(spi);
493 if (ret < 0) { 493 if (ret < 0) {
494 dev_err(&spi->dev, "spi setup failed.\n"); 494 dev_err(&spi->dev, "spi setup failed.\n");
495 goto out_free_lcd; 495 return ret;
496 } 496 }
497 497
498 lcd->spi = spi; 498 lcd->spi = spi;
@@ -501,15 +501,13 @@ static int __devinit ams369fg06_probe(struct spi_device *spi)
501 lcd->lcd_pd = spi->dev.platform_data; 501 lcd->lcd_pd = spi->dev.platform_data;
502 if (!lcd->lcd_pd) { 502 if (!lcd->lcd_pd) {
503 dev_err(&spi->dev, "platform data is NULL\n"); 503 dev_err(&spi->dev, "platform data is NULL\n");
504 goto out_free_lcd; 504 return -EFAULT;
505 } 505 }
506 506
507 ld = lcd_device_register("ams369fg06", &spi->dev, lcd, 507 ld = lcd_device_register("ams369fg06", &spi->dev, lcd,
508 &ams369fg06_lcd_ops); 508 &ams369fg06_lcd_ops);
509 if (IS_ERR(ld)) { 509 if (IS_ERR(ld))
510 ret = PTR_ERR(ld); 510 return PTR_ERR(ld);
511 goto out_free_lcd;
512 }
513 511
514 lcd->ld = ld; 512 lcd->ld = ld;
515 513
@@ -547,8 +545,6 @@ static int __devinit ams369fg06_probe(struct spi_device *spi)
547 545
548out_lcd_unregister: 546out_lcd_unregister:
549 lcd_device_unregister(ld); 547 lcd_device_unregister(ld);
550out_free_lcd:
551 kfree(lcd);
552 return ret; 548 return ret;
553} 549}
554 550
@@ -559,7 +555,6 @@ static int __devexit ams369fg06_remove(struct spi_device *spi)
559 ams369fg06_power(lcd, FB_BLANK_POWERDOWN); 555 ams369fg06_power(lcd, FB_BLANK_POWERDOWN);
560 backlight_device_unregister(lcd->bd); 556 backlight_device_unregister(lcd->bd);
561 lcd_device_unregister(lcd->ld); 557 lcd_device_unregister(lcd->ld);
562 kfree(lcd);
563 558
564 return 0; 559 return 0;
565} 560}
@@ -619,7 +614,6 @@ static void ams369fg06_shutdown(struct spi_device *spi)
619static struct spi_driver ams369fg06_driver = { 614static struct spi_driver ams369fg06_driver = {
620 .driver = { 615 .driver = {
621 .name = "ams369fg06", 616 .name = "ams369fg06",
622 .bus = &spi_bus_type,
623 .owner = THIS_MODULE, 617 .owner = THIS_MODULE,
624 }, 618 },
625 .probe = ams369fg06_probe, 619 .probe = ams369fg06_probe,