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

backlight: ep93xx: 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
23741ada 02f0092c

+2 -11
+2 -11
drivers/video/backlight/ep93xx_bl.c
··· 92 92 memset(&props, 0, sizeof(struct backlight_properties)); 93 93 props.type = BACKLIGHT_RAW; 94 94 props.max_brightness = EP93XX_MAX_BRIGHT; 95 - bl = backlight_device_register(dev->name, &dev->dev, ep93xxbl, 96 - &ep93xxbl_ops, &props); 95 + bl = devm_backlight_device_register(&dev->dev, dev->name, &dev->dev, 96 + ep93xxbl, &ep93xxbl_ops, &props); 97 97 if (IS_ERR(bl)) 98 98 return PTR_ERR(bl); 99 99 ··· 103 103 104 104 ep93xxbl_update_status(bl); 105 105 106 - return 0; 107 - } 108 - 109 - static int ep93xxbl_remove(struct platform_device *dev) 110 - { 111 - struct backlight_device *bl = platform_get_drvdata(dev); 112 - 113 - backlight_device_unregister(bl); 114 106 return 0; 115 107 } 116 108 ··· 132 140 .pm = &ep93xxbl_pm_ops, 133 141 }, 134 142 .probe = ep93xxbl_probe, 135 - .remove = ep93xxbl_remove, 136 143 }; 137 144 138 145 module_platform_driver(ep93xxbl_driver);