summaryrefslogtreecommitdiff
path: root/drivers/video/backlight/cr_bllcd.c
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2008-11-17 15:21:32 +0000
committerRichard Purdie <rpurdie@linux.intel.com>2009-01-08 12:37:28 +0000
commitb4a11d3da20db62f31b3133a6eca8a35633e0838 (patch)
tree4c9fcc6f88c1b45589d389a2a4e30cb0ddda2e19 /drivers/video/backlight/cr_bllcd.c
parent6cd6f35a4b0ff86638df986efaa307de91f88ae8 (diff)
backlight: crbllcd_bl - Use platform_device_register_simple()
Use platform_device_register_simple() and also fix error handling when platform_device_alloc() fails (cr_backlight_driver is left registered). Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'drivers/video/backlight/cr_bllcd.c')
-rw-r--r--drivers/video/backlight/cr_bllcd.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/video/backlight/cr_bllcd.c b/drivers/video/backlight/cr_bllcd.c
index 26add8898605..b9fe62b475c6 100644
--- a/drivers/video/backlight/cr_bllcd.c
+++ b/drivers/video/backlight/cr_bllcd.c
@@ -259,22 +259,18 @@ static int __init cr_backlight_init(void)
{
int ret = platform_driver_register(&cr_backlight_driver);
- if (!ret) {
- crp = platform_device_alloc("cr_backlight", -1);
- if (!crp)
- return -ENOMEM;
+ if (ret)
+ return ret;
- ret = platform_device_add(crp);
-
- if (ret) {
- platform_device_put(crp);
- platform_driver_unregister(&cr_backlight_driver);
- }
+ crp = platform_device_register_simple("cr_backlight", -1, NULL, 0);
+ if (IS_ERR(crp)) {
+ platform_driver_unregister(&cr_backlight_driver);
+ return PTR_ERR(crp);
}
printk("Carillo Ranch Backlight Driver Initialized.\n");
- return ret;
+ return 0;
}
static void __exit cr_backlight_exit(void)