Merge tag 'media/v5.3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab...
[linux-2.6-block.git] / drivers / media / platform / omap3isp / isp.c
index 38849f0ba09d399522075100f2b437e4c43a49d9..83216fc7156b373fed3217896614d1f3c22675c6 100644 (file)
@@ -2003,6 +2003,8 @@ static int isp_remove(struct platform_device *pdev)
        media_entity_enum_cleanup(&isp->crashed);
        v4l2_async_notifier_cleanup(&isp->notifier);
 
+       kfree(isp);
+
        return 0;
 }
 
@@ -2193,7 +2195,7 @@ static int isp_probe(struct platform_device *pdev)
        int ret;
        int i, m;
 
-       isp = devm_kzalloc(&pdev->dev, sizeof(*isp), GFP_KERNEL);
+       isp = kzalloc(sizeof(*isp), GFP_KERNEL);
        if (!isp) {
                dev_err(&pdev->dev, "could not allocate memory\n");
                return -ENOMEM;
@@ -2202,17 +2204,19 @@ static int isp_probe(struct platform_device *pdev)
        ret = fwnode_property_read_u32(of_fwnode_handle(pdev->dev.of_node),
                                       "ti,phy-type", &isp->phy_type);
        if (ret)
-               return ret;
+               goto error_release_isp;
 
        isp->syscon = syscon_regmap_lookup_by_phandle(pdev->dev.of_node,
                                                      "syscon");
-       if (IS_ERR(isp->syscon))
-               return PTR_ERR(isp->syscon);
+       if (IS_ERR(isp->syscon)) {
+               ret = PTR_ERR(isp->syscon);
+               goto error_release_isp;
+       }
 
        ret = of_property_read_u32_index(pdev->dev.of_node,
                                         "syscon", 1, &isp->syscon_offset);
        if (ret)
-               return ret;
+               goto error_release_isp;
 
        isp->autoidle = autoidle;
 
@@ -2369,6 +2373,8 @@ error_isp:
 error:
        v4l2_async_notifier_cleanup(&isp->notifier);
        mutex_destroy(&isp->isp_mutex);
+error_release_isp:
+       kfree(isp);
 
        return ret;
 }
@@ -2380,7 +2386,7 @@ static const struct dev_pm_ops omap3isp_pm_ops = {
        .complete = isp_pm_complete,
 };
 
-static struct platform_device_id omap3isp_id_table[] = {
+static const struct platform_device_id omap3isp_id_table[] = {
        { "omap3isp", 0 },
        { },
 };