Skip to contentSkip to conversation

backlight: tps65217_bl: Add missing platform_set_drvdata in tps65217_bl_probe

PATCH Applied Axel Lin 2 participants 2 messages Sep 30, 2012

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 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.

---
 drivers/video/backlight/tps65217_bl.c |   14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)
drivers/video/backlight/tps65217_bl.c +2 -12
index 6ac2ef5..7088163 100644
@@ -312,6 +312,7 @@ static int tps65217_bl_probe(struct platform_device *pdev)
 	}
 
 	tps65217_bl->bl->props.brightness = 0;
+	platform_set_drvdata(pdev, tps65217_bl);
 
 	return 0;
 }
@@ -334,18 +335,7 @@ static struct platform_driver tps65217_bl_driver = {
 	},
 };
 
-static int __init tps65217_bl_init(void)
-{
-	return platform_driver_register(&tps65217_bl_driver);
-}
-
-static void __exit tps65217_bl_exit(void)
-{
-	platform_driver_unregister(&tps65217_bl_driver);
-}
-
-module_init(tps65217_bl_init);
-module_exit(tps65217_bl_exit);
+module_platform_driver(tps65217_bl_driver);
 
 MODULE_DESCRIPTION("TPS65217 Backlight driver");
 MODULE_LICENSE("GPL v2");
Signature · 1 line
1.7.9.5
Applied
#1 lore raw

Hi Axel,

Quoted 9 lines · Axel Lin

Otherwise, we got NULL derefernce while calling backlight_device_unregister() in tps65217_bl_remove().

Also convert to use module_platform_driver.

---
 drivers/video/backlight/tps65217_bl.c |   14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

Applied, thanks.

Cheers,
Samuel.

Signature · 2 lines
Intel Open Source Technology Centre
http://oss.intel.com/