diff options
author | Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> | 2014-09-02 12:51:19 (GMT) |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2014-09-17 00:55:05 (GMT) |
commit | 971645d1fd734b8098a5113d61ab9ea93ce83921 (patch) | |
tree | ecdecf706d131724b6154bda2800b6f01b549f87 /drivers | |
parent | e3a9b04621681d0f07bc8e9935684e6400edef7c (diff) | |
download | linux-971645d1fd734b8098a5113d61ab9ea93ce83921.tar.xz |
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')
-rw-r--r-- | drivers/gpu/drm/tilcdc/tilcdc_panel.c | 4 |
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 4b36e68..c716c12 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) return -ENXIO; } - panel_mod = kzalloc(sizeof(*panel_mod), GFP_KERNEL); + panel_mod = devm_kzalloc(&pdev->dev, sizeof(*panel_mod), GFP_KERNEL); if (!panel_mod) return -ENOMEM; @@ -391,7 +391,6 @@ fail_timings: display_timings_release(panel_mod->timings); fail_free: - kfree(panel_mod); tilcdc_module_cleanup(mod); return ret; } @@ -405,7 +404,6 @@ static int panel_remove(struct platform_device *pdev) tilcdc_module_cleanup(mod); kfree(panel_mod->info); - kfree(panel_mod); return 0; } |