summaryrefslogtreecommitdiff
path: root/drivers/media/i2c/vs6624.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/i2c/vs6624.c')
-rw-r--r--drivers/media/i2c/vs6624.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/media/i2c/vs6624.c b/drivers/media/i2c/vs6624.c
index 94e284908f39..7b55b3ddd80f 100644
--- a/drivers/media/i2c/vs6624.c
+++ b/drivers/media/i2c/vs6624.c
@@ -805,7 +805,8 @@ static int vs6624_probe(struct i2c_client *client,
if (ce == NULL)
return -EINVAL;
- ret = gpio_request_one(*ce, GPIOF_OUT_INIT_HIGH, "VS6624 Chip Enable");
+ ret = devm_gpio_request_one(&client->dev, *ce, GPIOF_OUT_INIT_HIGH,
+ "VS6624 Chip Enable");
if (ret) {
v4l_err(client, "failed to request GPIO %d\n", *ce);
return ret;
@@ -863,27 +864,22 @@ static int vs6624_probe(struct i2c_client *client,
int err = hdl->error;
v4l2_ctrl_handler_free(hdl);
- gpio_free(*ce);
return err;
}
/* initialize the hardware to the default control values */
ret = v4l2_ctrl_handler_setup(hdl);
- if (ret) {
+ if (ret)
v4l2_ctrl_handler_free(hdl);
- gpio_free(*ce);
- }
return ret;
}
static int vs6624_remove(struct i2c_client *client)
{
struct v4l2_subdev *sd = i2c_get_clientdata(client);
- struct vs6624 *sensor = to_vs6624(sd);
v4l2_device_unregister_subdev(sd);
v4l2_ctrl_handler_free(sd->ctrl_handler);
- gpio_free(sensor->ce_pin);
return 0;
}