diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2012-12-25 17:27:31 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-02-05 14:49:17 -0200 |
commit | cf2b4cf661bd183791ebc0a7ab091de77a1748b0 (patch) | |
tree | f46112fb67c7f8cca87abe7788bb4ff5d0d90bc0 /drivers/media/platform/omap3isp/isph3a_af.c | |
parent | 3d5a71ef32742298f9022043160a2c6cbfdf30ac (diff) |
[media] omap3isp: Use devm_* managed functions
Replace kzalloc, request_mem_region, ioremap, clk_get and regulator_get
with their devm_* managed replacement.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/platform/omap3isp/isph3a_af.c')
-rw-r--r-- | drivers/media/platform/omap3isp/isph3a_af.c | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/drivers/media/platform/omap3isp/isph3a_af.c b/drivers/media/platform/omap3isp/isph3a_af.c index d645b418ca6a..a0bf5af32438 100644 --- a/drivers/media/platform/omap3isp/isph3a_af.c +++ b/drivers/media/platform/omap3isp/isph3a_af.c @@ -363,9 +363,8 @@ int omap3isp_h3a_af_init(struct isp_device *isp) struct ispstat *af = &isp->isp_af; struct omap3isp_h3a_af_config *af_cfg; struct omap3isp_h3a_af_config *af_recover_cfg; - int ret; - af_cfg = kzalloc(sizeof(*af_cfg), GFP_KERNEL); + af_cfg = devm_kzalloc(isp->dev, sizeof(*af_cfg), GFP_KERNEL); if (af_cfg == NULL) return -ENOMEM; @@ -376,12 +375,12 @@ int omap3isp_h3a_af_init(struct isp_device *isp) af->isp = isp; /* Set recover state configuration */ - af_recover_cfg = kzalloc(sizeof(*af_recover_cfg), GFP_KERNEL); + af_recover_cfg = devm_kzalloc(isp->dev, sizeof(*af_recover_cfg), + GFP_KERNEL); if (!af_recover_cfg) { dev_err(af->isp->dev, "AF: cannot allocate memory for recover " "configuration.\n"); - ret = -ENOMEM; - goto err_recover_alloc; + return -ENOMEM; } af_recover_cfg->paxel.h_start = OMAP3ISP_AF_PAXEL_HZSTART_MIN; @@ -393,30 +392,16 @@ int omap3isp_h3a_af_init(struct isp_device *isp) if (h3a_af_validate_params(af, af_recover_cfg)) { dev_err(af->isp->dev, "AF: recover configuration is " "invalid.\n"); - ret = -EINVAL; - goto err_conf; + return -EINVAL; } af_recover_cfg->buf_size = h3a_af_get_buf_size(af_recover_cfg); af->recover_priv = af_recover_cfg; - ret = omap3isp_stat_init(af, "AF", &h3a_af_subdev_ops); - if (ret) - goto err_conf; - - return 0; - -err_conf: - kfree(af_recover_cfg); -err_recover_alloc: - kfree(af_cfg); - - return ret; + return omap3isp_stat_init(af, "AF", &h3a_af_subdev_ops); } void omap3isp_h3a_af_cleanup(struct isp_device *isp) { - kfree(isp->isp_af.priv); - kfree(isp->isp_af.recover_priv); omap3isp_stat_cleanup(&isp->isp_af); } |