diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2013-05-02 07:29:43 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-05-21 06:54:43 -0400 |
commit | 07e0e5b287421fcc4f4dbe2c0c8bfbc02e23a51e (patch) | |
tree | acc47811d97278e814ae637da0fe88afe2ce7761 /drivers/media/i2c/noon010pc30.c | |
parent | b015ba29ca09b0e3750b4de365d3baf9c5b11450 (diff) |
[media] media: i2c: Convert to devm_regulator_bulk_get()
Using the managed function the regulator_bulk_put() calls can be removed
from the probe error path and the remove handler.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/i2c/noon010pc30.c')
-rw-r--r-- | drivers/media/i2c/noon010pc30.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/media/i2c/noon010pc30.c b/drivers/media/i2c/noon010pc30.c index 6f81b99ddd1c..2284b02102db 100644 --- a/drivers/media/i2c/noon010pc30.c +++ b/drivers/media/i2c/noon010pc30.c | |||
@@ -772,7 +772,7 @@ static int noon010_probe(struct i2c_client *client, | |||
772 | for (i = 0; i < NOON010_NUM_SUPPLIES; i++) | 772 | for (i = 0; i < NOON010_NUM_SUPPLIES; i++) |
773 | info->supply[i].supply = noon010_supply_name[i]; | 773 | info->supply[i].supply = noon010_supply_name[i]; |
774 | 774 | ||
775 | ret = regulator_bulk_get(&client->dev, NOON010_NUM_SUPPLIES, | 775 | ret = devm_regulator_bulk_get(&client->dev, NOON010_NUM_SUPPLIES, |
776 | info->supply); | 776 | info->supply); |
777 | if (ret) | 777 | if (ret) |
778 | goto np_err; | 778 | goto np_err; |
@@ -781,14 +781,12 @@ static int noon010_probe(struct i2c_client *client, | |||
781 | sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV_SENSOR; | 781 | sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV_SENSOR; |
782 | ret = media_entity_init(&sd->entity, 1, &info->pad, 0); | 782 | ret = media_entity_init(&sd->entity, 1, &info->pad, 0); |
783 | if (ret < 0) | 783 | if (ret < 0) |
784 | goto np_me_err; | 784 | goto np_err; |
785 | 785 | ||
786 | ret = noon010_detect(client, info); | 786 | ret = noon010_detect(client, info); |
787 | if (!ret) | 787 | if (!ret) |
788 | return 0; | 788 | return 0; |
789 | 789 | ||
790 | np_me_err: | ||
791 | regulator_bulk_free(NOON010_NUM_SUPPLIES, info->supply); | ||
792 | np_err: | 790 | np_err: |
793 | v4l2_ctrl_handler_free(&info->hdl); | 791 | v4l2_ctrl_handler_free(&info->hdl); |
794 | v4l2_device_unregister_subdev(sd); | 792 | v4l2_device_unregister_subdev(sd); |
@@ -802,8 +800,6 @@ static int noon010_remove(struct i2c_client *client) | |||
802 | 800 | ||
803 | v4l2_device_unregister_subdev(sd); | 801 | v4l2_device_unregister_subdev(sd); |
804 | v4l2_ctrl_handler_free(&info->hdl); | 802 | v4l2_ctrl_handler_free(&info->hdl); |
805 | |||
806 | regulator_bulk_free(NOON010_NUM_SUPPLIES, info->supply); | ||
807 | media_entity_cleanup(&sd->entity); | 803 | media_entity_cleanup(&sd->entity); |
808 | 804 | ||
809 | return 0; | 805 | return 0; |