From 8318fde4ac78f6793b1cbaf57659902253a61617 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Wed, 3 Jul 2013 15:05:13 -0700 Subject: backlight: add devm_backlight_device_{register,unregister}() These functions allow the driver core to automatically clean up any allocation made by backlight drivers. Thus it simplifies the error paths. Signed-off-by: Jingoo Han Cc: Tejun Heo Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/backlight.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/linux/backlight.h') diff --git a/include/linux/backlight.h b/include/linux/backlight.h index da9a0825e007..53b77949c79d 100644 --- a/include/linux/backlight.h +++ b/include/linux/backlight.h @@ -114,7 +114,13 @@ static inline void backlight_update_status(struct backlight_device *bd) extern struct backlight_device *backlight_device_register(const char *name, struct device *dev, void *devdata, const struct backlight_ops *ops, const struct backlight_properties *props); +extern struct backlight_device *devm_backlight_device_register( + struct device *dev, const char *name, struct device *parent, + void *devdata, const struct backlight_ops *ops, + const struct backlight_properties *props); extern void backlight_device_unregister(struct backlight_device *bd); +extern void devm_backlight_device_unregister(struct device *dev, + struct backlight_device *bd); extern void backlight_force_update(struct backlight_device *bd, enum backlight_update_reason reason); -- cgit v1.2.3-59-g8ed1b