aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/tilcdc/tilcdc_panel.c
diff options
context:
space:
mode:
authorEzequiel Garcia <ezequiel@vanguardiasur.com.ar>2014-09-02 08:51:19 -0400
committerDave Airlie <airlied@redhat.com>2014-09-16 20:55:05 -0400
commit971645d1fd734b8098a5113d61ab9ea93ce83921 (patch)
treeecdecf706d131724b6154bda2800b6f01b549f87 /drivers/gpu/drm/tilcdc/tilcdc_panel.c
parente3a9b04621681d0f07bc8e9935684e6400edef7c (diff)
drm/tilcdc: panel: Use devm_kzalloc to simplify the error path
Using the managed variant to allocate the resource makes the code simpler and less error-prone. Tested-by: Darren Etheridge <detheridge@ti.com> Tested-by: Johannes Pointner <johannes.pointner@br-automation.com> Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/tilcdc/tilcdc_panel.c')
-rw-r--r--drivers/gpu/drm/tilcdc/tilcdc_panel.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_panel.c b/drivers/gpu/drm/tilcdc/tilcdc_panel.c
index 4b36e68158b2..c716c128ded2 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_panel.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_panel.c
@@ -354,7 +354,7 @@ static int panel_probe(struct platform_device *pdev)
354 return -ENXIO; 354 return -ENXIO;
355 } 355 }
356 356
357 panel_mod = kzalloc(sizeof(*panel_mod), GFP_KERNEL); 357 panel_mod = devm_kzalloc(&pdev->dev, sizeof(*panel_mod), GFP_KERNEL);
358 if (!panel_mod) 358 if (!panel_mod)
359 return -ENOMEM; 359 return -ENOMEM;
360 360
@@ -391,7 +391,6 @@ fail_timings:
391 display_timings_release(panel_mod->timings); 391 display_timings_release(panel_mod->timings);
392 392
393fail_free: 393fail_free:
394 kfree(panel_mod);
395 tilcdc_module_cleanup(mod); 394 tilcdc_module_cleanup(mod);
396 return ret; 395 return ret;
397} 396}
@@ -405,7 +404,6 @@ static int panel_remove(struct platform_device *pdev)
405 404
406 tilcdc_module_cleanup(mod); 405 tilcdc_module_cleanup(mod);
407 kfree(panel_mod->info); 406 kfree(panel_mod->info);
408 kfree(panel_mod);
409 407
410 return 0; 408 return 0;
411} 409}