All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] backlight: tps65217_bl: Add missing platform_set_drvdata in tps65217_bl_probe
@ 2012-09-30 10:28 Axel Lin
  2012-09-30 22:56 ` Samuel Ortiz
  0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2012-09-30 10:28 UTC (permalink / raw)
  To: Samuel Ortiz
  Cc: Matthias Kaehlcke, Richard Purdie, Andrew Morton, linux-kernel

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>
---
 drivers/video/backlight/tps65217_bl.c |   14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/drivers/video/backlight/tps65217_bl.c b/drivers/video/backlight/tps65217_bl.c
index 6ac2ef5..7088163 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)
 	}
 
 	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");
-- 
1.7.9.5




^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] backlight: tps65217_bl: Add missing platform_set_drvdata in tps65217_bl_probe
  2012-09-30 10:28 [PATCH] backlight: tps65217_bl: Add missing platform_set_drvdata in tps65217_bl_probe Axel Lin
@ 2012-09-30 22:56 ` Samuel Ortiz
  0 siblings, 0 replies; 2+ messages in thread
From: Samuel Ortiz @ 2012-09-30 22:56 UTC (permalink / raw)
  To: Axel Lin; +Cc: Matthias Kaehlcke, Richard Purdie, Andrew Morton, linux-kernel

Hi Axel,

On Sun, Sep 30, 2012 at 06:28:26PM +0800, Axel Lin wrote:
> 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>
> ---
>  drivers/video/backlight/tps65217_bl.c |   14 ++------------
>  1 file changed, 2 insertions(+), 12 deletions(-)
Applied, thanks.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-09-30 22:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-30 10:28 [PATCH] backlight: tps65217_bl: Add missing platform_set_drvdata in tps65217_bl_probe Axel Lin
2012-09-30 22:56 ` Samuel Ortiz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.