Thread (22 messages) 22 messages, 6 authors, 2013-04-10

Re: [PATCH 08/14] media: soc-camera: use managed devm_regulator_bulk_get()

From: Sachin Kamat <hidden>
Date: 2012-09-27 17:38:57
Also in: linux-sh

Hi Guennadi,

On 27 September 2012 19:37, Guennadi Liakhovetski [off-list ref] wrote:
quoted hunk ↗ jump to hunk
Using device-managed devm_regulator_bulk_get() eliminates the need to
release regulators explicitly.

Signed-off-by: Guennadi Liakhovetski <redacted>
---
 drivers/media/platform/soc_camera/soc_camera.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/media/platform/soc_camera/soc_camera.c b/drivers/media/platform/soc_camera/soc_camera.c
index 997be15..c2a5fa3 100644
--- a/drivers/media/platform/soc_camera/soc_camera.c
+++ b/drivers/media/platform/soc_camera/soc_camera.c
@@ -1249,7 +1249,6 @@ static int soc_camera_i2c_notify(struct notifier_block *nb,
                video_device_release(icd->vdev);
                icd->vdev = NULL;
        }
-       regulator_bulk_free(icl->num_regulators, icl->regulators);
        v4l2_ctrl_handler_free(&icd->ctrl_handler);

        return NOTIFY_DONE;
@@ -1358,8 +1357,8 @@ static int soc_camera_probe(struct soc_camera_device *icd)
        if (ret < 0)
                return ret;

-       ret = regulator_bulk_get(icd->pdev, icl->num_regulators,
-                                icl->regulators);
+       ret = devm_regulator_bulk_get(icd->pdev, icl->num_regulators,
+                                     icl->regulators);
        if (ret < 0)
                goto ereg;
@@ -1423,7 +1422,6 @@ eadddev:
                icd->vdev = NULL;
        }
 evdc:
Perhaps we could get rid of this label as well?
quoted hunk ↗ jump to hunk
-       regulator_bulk_free(icl->num_regulators, icl->regulators);
 ereg:
        v4l2_ctrl_handler_free(&icd->ctrl_handler);
        return ret;
@@ -1460,8 +1458,6 @@ static int soc_camera_remove(struct soc_camera_device *icd)
        }
        soc_camera_free_user_formats(icd);

-       regulator_bulk_free(icl->num_regulators, icl->regulators);
-
        return 0;
 }

--
1.7.2.5

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


-- 
With warm regards,
Sachin
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help