aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/displays/panel-lgphilips-lb035q02.c
diff options
context:
space:
mode:
authorArchit Taneja <archit@ti.com>2012-11-30 04:39:07 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2013-04-03 08:19:46 -0400
commite4dace469fa2244e3bff07707b79ef0e1a5d13db (patch)
treef45dd248fd8c8a89a42bcc078a14b6fc3e8c7336 /drivers/video/omap2/displays/panel-lgphilips-lb035q02.c
parentf5e484d8abd06d4d82bd556780746414f2f56988 (diff)
OMAPDSS: lb035q02: use devm_kzalloc for allocating driver data
Use devm_kzalloc instead of kzalloc to allocate driver data for the lg phillips panel driver. This simplifies the driver's probe and remove functions. Cc: Steve Sakoman <steve@sakoman.com> Signed-off-by: Archit Taneja <archit@ti.com>
Diffstat (limited to 'drivers/video/omap2/displays/panel-lgphilips-lb035q02.c')
-rw-r--r--drivers/video/omap2/displays/panel-lgphilips-lb035q02.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/video/omap2/displays/panel-lgphilips-lb035q02.c b/drivers/video/omap2/displays/panel-lgphilips-lb035q02.c
index 6e5abe8fd2dd..8effea8f2259 100644
--- a/drivers/video/omap2/displays/panel-lgphilips-lb035q02.c
+++ b/drivers/video/omap2/displays/panel-lgphilips-lb035q02.c
@@ -89,27 +89,21 @@ static void lb035q02_panel_power_off(struct omap_dss_device *dssdev)
89static int lb035q02_panel_probe(struct omap_dss_device *dssdev) 89static int lb035q02_panel_probe(struct omap_dss_device *dssdev)
90{ 90{
91 struct lb035q02_data *ld; 91 struct lb035q02_data *ld;
92 int r;
93 92
94 dssdev->panel.timings = lb035q02_timings; 93 dssdev->panel.timings = lb035q02_timings;
95 94
96 ld = kzalloc(sizeof(*ld), GFP_KERNEL); 95 ld = devm_kzalloc(&dssdev->dev, sizeof(*ld), GFP_KERNEL);
97 if (!ld) { 96 if (!ld)
98 r = -ENOMEM; 97 return -ENOMEM;
99 goto err; 98
100 }
101 mutex_init(&ld->lock); 99 mutex_init(&ld->lock);
102 dev_set_drvdata(&dssdev->dev, ld); 100 dev_set_drvdata(&dssdev->dev, ld);
101
103 return 0; 102 return 0;
104err:
105 return r;
106} 103}
107 104
108static void lb035q02_panel_remove(struct omap_dss_device *dssdev) 105static void lb035q02_panel_remove(struct omap_dss_device *dssdev)
109{ 106{
110 struct lb035q02_data *ld = dev_get_drvdata(&dssdev->dev);
111
112 kfree(ld);
113} 107}
114 108
115static int lb035q02_panel_enable(struct omap_dss_device *dssdev) 109static int lb035q02_panel_enable(struct omap_dss_device *dssdev)