summaryrefslogtreecommitdiff
path: root/drivers/video/omap2/displays
diff options
context:
space:
mode:
authorArchit Taneja <archit@ti.com>2012-11-30 13:39:07 +0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2013-04-03 16:19:46 +0400
commite4dace469fa2244e3bff07707b79ef0e1a5d13db (patch)
treef45dd248fd8c8a89a42bcc078a14b6fc3e8c7336 /drivers/video/omap2/displays
parentf5e484d8abd06d4d82bd556780746414f2f56988 (diff)
downloadlinux-e4dace469fa2244e3bff07707b79ef0e1a5d13db.tar.xz
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')
-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)
static int lb035q02_panel_probe(struct omap_dss_device *dssdev)
{
struct lb035q02_data *ld;
- int r;
dssdev->panel.timings = lb035q02_timings;
- ld = kzalloc(sizeof(*ld), GFP_KERNEL);
- if (!ld) {
- r = -ENOMEM;
- goto err;
- }
+ ld = devm_kzalloc(&dssdev->dev, sizeof(*ld), GFP_KERNEL);
+ if (!ld)
+ return -ENOMEM;
+
mutex_init(&ld->lock);
dev_set_drvdata(&dssdev->dev, ld);
+
return 0;
-err:
- return r;
}
static void lb035q02_panel_remove(struct omap_dss_device *dssdev)
{
- struct lb035q02_data *ld = dev_get_drvdata(&dssdev->dev);
-
- kfree(ld);
}
static int lb035q02_panel_enable(struct omap_dss_device *dssdev)