Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jingoo Han and committed by
Linus Torvalds
c423a771 75d4baec

+2 -11
+2 -11
drivers/video/backlight/pcf50633-backlight.c
··· 126 126 127 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 131 &pcf50633_bl_ops, &bl_props); 131 132 132 133 if (IS_ERR(pcf_bl->bl)) ··· 148 147 return 0; 149 148 } 150 149 151 - static int pcf50633_bl_remove(struct platform_device *pdev) 152 - { 153 - struct pcf50633_bl *pcf_bl = platform_get_drvdata(pdev); 154 - 155 - backlight_device_unregister(pcf_bl->bl); 156 - 157 - return 0; 158 - } 159 - 160 150 static struct platform_driver pcf50633_bl_driver = { 161 151 .probe = pcf50633_bl_probe, 162 - .remove = pcf50633_bl_remove, 163 152 .driver = { 164 153 .name = "pcf50633-backlight", 165 154 },