[media] omap3isp: Use devm_* managed functions
[deliverable/linux.git] / drivers / media / platform / omap3isp / isphist.c
index 2d759c56f37c33f4f4b09362acf8125344a34937..2ccc4e5702b21a007684edeb382ecbe066bf74d9 100644 (file)
@@ -477,11 +477,10 @@ int omap3isp_hist_init(struct isp_device *isp)
        struct omap3isp_hist_config *hist_cfg;
        int ret = -1;
 
-       hist_cfg = kzalloc(sizeof(*hist_cfg), GFP_KERNEL);
+       hist_cfg = devm_kzalloc(isp->dev, sizeof(*hist_cfg), GFP_KERNEL);
        if (hist_cfg == NULL)
                return -ENOMEM;
 
-       memset(hist, 0, sizeof(*hist));
        hist->isp = isp;
 
        if (HIST_CONFIG_DMA)
@@ -504,7 +503,6 @@ int omap3isp_hist_init(struct isp_device *isp)
 
        ret = omap3isp_stat_init(hist, "histogram", &hist_subdev_ops);
        if (ret) {
-               kfree(hist_cfg);
                if (HIST_USING_DMA(hist))
                        omap_free_dma(hist->dma_ch);
        }
@@ -519,6 +517,5 @@ void omap3isp_hist_cleanup(struct isp_device *isp)
 {
        if (HIST_USING_DMA(&isp->isp_hist))
                omap_free_dma(isp->isp_hist.dma_ch);
-       kfree(isp->isp_hist.priv);
        omap3isp_stat_cleanup(&isp->isp_hist);
 }
This page took 0.071192 seconds and 5 git commands to generate.