diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-11-12 18:09:23 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-12 22:09:18 -0500 |
commit | c423a7712170f2ce51a71cc117cd2d588664bebe (patch) | |
tree | aedbbbc88ced1040b04672d7425cb55f9eba2a17 | |
parent | 75d4baec9becbf1ed9c8804bd94004622f38cb11 (diff) |
backlight: pcf50633: use devm_backlight_device_register()
Use devm_backlight_device_register() to make cleanup paths simpler, and
remove unnecessary remove().
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/video/backlight/pcf50633-backlight.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/video/backlight/pcf50633-backlight.c b/drivers/video/backlight/pcf50633-backlight.c index b2184cf70b92..b95d3b0aaffe 100644 --- a/drivers/video/backlight/pcf50633-backlight.c +++ b/drivers/video/backlight/pcf50633-backlight.c | |||
@@ -126,7 +126,8 @@ static int pcf50633_bl_probe(struct platform_device *pdev) | |||
126 | 126 | ||
127 | pcf_bl->pcf = dev_to_pcf50633(pdev->dev.parent); | 127 | pcf_bl->pcf = dev_to_pcf50633(pdev->dev.parent); |
128 | 128 | ||
129 | pcf_bl->bl = backlight_device_register(pdev->name, &pdev->dev, pcf_bl, | 129 | pcf_bl->bl = devm_backlight_device_register(&pdev->dev, pdev->name, |
130 | &pdev->dev, pcf_bl, | ||
130 | &pcf50633_bl_ops, &bl_props); | 131 | &pcf50633_bl_ops, &bl_props); |
131 | 132 | ||
132 | if (IS_ERR(pcf_bl->bl)) | 133 | if (IS_ERR(pcf_bl->bl)) |
@@ -147,18 +148,8 @@ static int pcf50633_bl_probe(struct platform_device *pdev) | |||
147 | return 0; | 148 | return 0; |
148 | } | 149 | } |
149 | 150 | ||
150 | static int pcf50633_bl_remove(struct platform_device *pdev) | ||
151 | { | ||
152 | struct pcf50633_bl *pcf_bl = platform_get_drvdata(pdev); | ||
153 | |||
154 | backlight_device_unregister(pcf_bl->bl); | ||
155 | |||
156 | return 0; | ||
157 | } | ||
158 | |||
159 | static struct platform_driver pcf50633_bl_driver = { | 151 | static struct platform_driver pcf50633_bl_driver = { |
160 | .probe = pcf50633_bl_probe, | 152 | .probe = pcf50633_bl_probe, |
161 | .remove = pcf50633_bl_remove, | ||
162 | .driver = { | 153 | .driver = { |
163 | .name = "pcf50633-backlight", | 154 | .name = "pcf50633-backlight", |
164 | }, | 155 | }, |