Commit e4dace46 authored by Archit Taneja's avatar Archit Taneja Committed by Tomi Valkeinen

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: default avatarArchit Taneja <archit@ti.com>
parent f5e484d8
...@@ -89,27 +89,21 @@ static void lb035q02_panel_power_off(struct omap_dss_device *dssdev) ...@@ -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) static int lb035q02_panel_probe(struct omap_dss_device *dssdev)
{ {
struct lb035q02_data *ld; struct lb035q02_data *ld;
int r;
dssdev->panel.timings = lb035q02_timings; dssdev->panel.timings = lb035q02_timings;
ld = kzalloc(sizeof(*ld), GFP_KERNEL); ld = devm_kzalloc(&dssdev->dev, sizeof(*ld), GFP_KERNEL);
if (!ld) { if (!ld)
r = -ENOMEM; return -ENOMEM;
goto err;
}
mutex_init(&ld->lock); mutex_init(&ld->lock);
dev_set_drvdata(&dssdev->dev, ld); dev_set_drvdata(&dssdev->dev, ld);
return 0; return 0;
err:
return r;
} }
static void lb035q02_panel_remove(struct omap_dss_device *dssdev) 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) static int lb035q02_panel_enable(struct omap_dss_device *dssdev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment