diff options
author | Axel Lin <axel.lin@ingics.com> | 2012-09-30 06:28:26 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-09-30 18:56:12 -0400 |
commit | c6bed9deb6047179a6c58ace847f8b2129085e37 (patch) | |
tree | 30351413fca5cd2883e806cfcf4c5941e8e27b26 /drivers/video/backlight | |
parent | 2896434cf272acace1b7093d5e4ba8022ed11ac8 (diff) |
backlight: tps65217_bl: Add missing platform_set_drvdata in tps65217_bl_probe
Otherwise, we got NULL derefernce while calling backlight_device_unregister()
in tps65217_bl_remove().
Also convert to use module_platform_driver.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/video/backlight')
-rw-r--r-- | drivers/video/backlight/tps65217_bl.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/drivers/video/backlight/tps65217_bl.c b/drivers/video/backlight/tps65217_bl.c index 6ac2ef5da32c..70881633b45a 100644 --- a/drivers/video/backlight/tps65217_bl.c +++ b/drivers/video/backlight/tps65217_bl.c | |||
@@ -312,6 +312,7 @@ static int tps65217_bl_probe(struct platform_device *pdev) | |||
312 | } | 312 | } |
313 | 313 | ||
314 | tps65217_bl->bl->props.brightness = 0; | 314 | tps65217_bl->bl->props.brightness = 0; |
315 | platform_set_drvdata(pdev, tps65217_bl); | ||
315 | 316 | ||
316 | return 0; | 317 | return 0; |
317 | } | 318 | } |
@@ -334,18 +335,7 @@ static struct platform_driver tps65217_bl_driver = { | |||
334 | }, | 335 | }, |
335 | }; | 336 | }; |
336 | 337 | ||
337 | static int __init tps65217_bl_init(void) | 338 | module_platform_driver(tps65217_bl_driver); |
338 | { | ||
339 | return platform_driver_register(&tps65217_bl_driver); | ||
340 | } | ||
341 | |||
342 | static void __exit tps65217_bl_exit(void) | ||
343 | { | ||
344 | platform_driver_unregister(&tps65217_bl_driver); | ||
345 | } | ||
346 | |||
347 | module_init(tps65217_bl_init); | ||
348 | module_exit(tps65217_bl_exit); | ||
349 | 339 | ||
350 | MODULE_DESCRIPTION("TPS65217 Backlight driver"); | 340 | MODULE_DESCRIPTION("TPS65217 Backlight driver"); |
351 | MODULE_LICENSE("GPL v2"); | 341 | MODULE_LICENSE("GPL v2"); |