diff options
Diffstat (limited to 'drivers/media/platform/omap3isp/isph3a_aewb.c')
-rw-r--r-- | drivers/media/platform/omap3isp/isph3a_aewb.c | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/drivers/media/platform/omap3isp/isph3a_aewb.c b/drivers/media/platform/omap3isp/isph3a_aewb.c index 036e9961d027..75fd82b152ba 100644 --- a/drivers/media/platform/omap3isp/isph3a_aewb.c +++ b/drivers/media/platform/omap3isp/isph3a_aewb.c @@ -300,13 +300,11 @@ int omap3isp_h3a_aewb_init(struct isp_device *isp) struct ispstat *aewb = &isp->isp_aewb; struct omap3isp_h3a_aewb_config *aewb_cfg; struct omap3isp_h3a_aewb_config *aewb_recover_cfg; - int ret; - aewb_cfg = kzalloc(sizeof(*aewb_cfg), GFP_KERNEL); + aewb_cfg = devm_kzalloc(isp->dev, sizeof(*aewb_cfg), GFP_KERNEL); if (!aewb_cfg) return -ENOMEM; - memset(aewb, 0, sizeof(*aewb)); aewb->ops = &h3a_aewb_ops; aewb->priv = aewb_cfg; aewb->dma_ch = -1; @@ -314,12 +312,12 @@ int omap3isp_h3a_aewb_init(struct isp_device *isp) aewb->isp = isp; /* Set recover state configuration */ - aewb_recover_cfg = kzalloc(sizeof(*aewb_recover_cfg), GFP_KERNEL); + aewb_recover_cfg = devm_kzalloc(isp->dev, sizeof(*aewb_recover_cfg), + GFP_KERNEL); if (!aewb_recover_cfg) { dev_err(aewb->isp->dev, "AEWB: cannot allocate memory for " "recover configuration.\n"); - ret = -ENOMEM; - goto err_recover_alloc; + return -ENOMEM; } aewb_recover_cfg->saturation_limit = OMAP3ISP_AEWB_MAX_SATURATION_LIM; @@ -336,25 +334,13 @@ int omap3isp_h3a_aewb_init(struct isp_device *isp) if (h3a_aewb_validate_params(aewb, aewb_recover_cfg)) { dev_err(aewb->isp->dev, "AEWB: recover configuration is " "invalid.\n"); - ret = -EINVAL; - goto err_conf; + return -EINVAL; } aewb_recover_cfg->buf_size = h3a_aewb_get_buf_size(aewb_recover_cfg); aewb->recover_priv = aewb_recover_cfg; - ret = omap3isp_stat_init(aewb, "AEWB", &h3a_aewb_subdev_ops); - if (ret) - goto err_conf; - - return 0; - -err_conf: - kfree(aewb_recover_cfg); -err_recover_alloc: - kfree(aewb_cfg); - - return ret; + return omap3isp_stat_init(aewb, "AEWB", &h3a_aewb_subdev_ops); } /* @@ -362,7 +348,5 @@ err_recover_alloc: */ void omap3isp_h3a_aewb_cleanup(struct isp_device *isp) { - kfree(isp->isp_aewb.priv); - kfree(isp->isp_aewb.recover_priv); omap3isp_stat_cleanup(&isp->isp_aewb); } |