summaryrefslogtreecommitdiffstats
path: root/drivers/media/i2c/m5mols
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2013-05-02 08:29:43 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-05-21 07:54:43 -0300
commit07e0e5b287421fcc4f4dbe2c0c8bfbc02e23a51e (patch)
treeacc47811d97278e814ae637da0fe88afe2ce7761 /drivers/media/i2c/m5mols
parentb015ba29ca09b0e3750b4de365d3baf9c5b11450 (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/m5mols')
-rw-r--r--drivers/media/i2c/m5mols/m5mols_core.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/media/i2c/m5mols/m5mols_core.c b/drivers/media/i2c/m5mols/m5mols_core.c
index f870d5057e3..11f6f871c37 100644
--- a/drivers/media/i2c/m5mols/m5mols_core.c
+++ b/drivers/media/i2c/m5mols/m5mols_core.c
@@ -966,7 +966,8 @@ static int m5mols_probe(struct i2c_client *client,
return ret;
}
- ret = regulator_bulk_get(&client->dev, ARRAY_SIZE(supplies), supplies);
+ ret = devm_regulator_bulk_get(&client->dev, ARRAY_SIZE(supplies),
+ supplies);
if (ret) {
dev_err(&client->dev, "Failed to get regulators: %d\n", ret);
return ret;
@@ -981,7 +982,7 @@ static int m5mols_probe(struct i2c_client *client,
info->pad.flags = MEDIA_PAD_FL_SOURCE;
ret = media_entity_init(&sd->entity, 1, &info->pad, 0);
if (ret < 0)
- goto out_reg;
+ return ret;
sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV_SENSOR;
init_waitqueue_head(&info->irq_waitq);
@@ -1012,8 +1013,6 @@ out_irq:
free_irq(client->irq, sd);
out_me:
media_entity_cleanup(&sd->entity);
-out_reg:
- regulator_bulk_free(ARRAY_SIZE(supplies), supplies);
return ret;
}
@@ -1025,7 +1024,6 @@ static int m5mols_remove(struct i2c_client *client)
v4l2_ctrl_handler_free(sd->ctrl_handler);
free_irq(client->irq, sd);
- regulator_bulk_free(ARRAY_SIZE(supplies), supplies);
media_entity_cleanup(&sd->entity);
return 0;