lcd: add devm_lcd_device_{register,unregister}()
These functions allow the driver core to automatically clean up any allocation made by lcd drivers. Thus it simplifies the error paths. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Cc: Tejun Heo <tj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:

committed by
Linus Torvalds

parent
8318fde4ac
commit
1d0c48e66b
@@ -112,7 +112,12 @@ static inline void lcd_set_power(struct lcd_device *ld, int power)
|
||||
|
||||
extern struct lcd_device *lcd_device_register(const char *name,
|
||||
struct device *parent, void *devdata, struct lcd_ops *ops);
|
||||
extern struct lcd_device *devm_lcd_device_register(struct device *dev,
|
||||
const char *name, struct device *parent,
|
||||
void *devdata, struct lcd_ops *ops);
|
||||
extern void lcd_device_unregister(struct lcd_device *ld);
|
||||
extern void devm_lcd_device_unregister(struct device *dev,
|
||||
struct lcd_device *ld);
|
||||
|
||||
#define to_lcd_device(obj) container_of(obj, struct lcd_device, dev)
|
||||
|
||||
|
Reference in New Issue
Block a user