Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 367093
b: refs/heads/master
c: b2afa23
h: refs/heads/master
i:
  367091: 1677e2b
v: v3
  • Loading branch information
Sylwester Nawrocki authored and Mauro Carvalho Chehab committed Apr 25, 2013
1 parent dcd9489 commit c145e74
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5a66561f426d4a10bce077ba90ab127e6a27ac3d
refs/heads/master: b2afa23669ffb30173c010ccab1f6d1d4d0c82fb
26 changes: 8 additions & 18 deletions trunk/drivers/media/platform/exynos4-is/fimc-is-sensor.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ static int fimc_is_sensor_probe(struct i2c_client *client,

gpio = of_get_gpio_flags(dev->of_node, 0, NULL);
if (gpio_is_valid(gpio)) {
ret = gpio_request_one(gpio, GPIOF_OUT_INIT_LOW, DRIVER_NAME);
ret = devm_gpio_request_one(dev, gpio, GPIOF_OUT_INIT_LOW,
DRIVER_NAME);
if (ret < 0)
return ret;
}
Expand All @@ -228,13 +229,11 @@ static int fimc_is_sensor_probe(struct i2c_client *client,
ret = devm_regulator_bulk_get(&client->dev, SENSOR_NUM_SUPPLIES,
sensor->supplies);
if (ret < 0)
goto err_gpio;
return ret;

of_id = of_match_node(fimc_is_sensor_of_match, dev->of_node);
if (!of_id) {
ret = -ENODEV;
goto err_reg;
}
if (!of_id)
return -ENODEV;

sensor->drvdata = of_id->data;
sensor->dev = dev;
Expand All @@ -251,28 +250,19 @@ static int fimc_is_sensor_probe(struct i2c_client *client,
sensor->pad.flags = MEDIA_PAD_FL_SOURCE;
ret = media_entity_init(&sd->entity, 1, &sensor->pad, 0);
if (ret < 0)
goto err_reg;
return ret;

v4l2_set_subdevdata(sd, sensor);
pm_runtime_no_callbacks(dev);
pm_runtime_enable(dev);

return 0;
err_reg:
regulator_bulk_free(SENSOR_NUM_SUPPLIES, sensor->supplies);
err_gpio:
if (gpio_is_valid(sensor->gpio_reset))
gpio_free(sensor->gpio_reset);
return ret;
}

static int fimc_is_sensor_remove(struct i2c_client *client)
{
struct fimc_is_sensor *sensor;

regulator_bulk_free(SENSOR_NUM_SUPPLIES, sensor->supplies);
media_entity_cleanup(&sensor->subdev.entity);

struct v4l2_subdev *sd = i2c_get_clientdata(client);
media_entity_cleanup(&sd->entity);
return 0;
}

Expand Down

0 comments on commit c145e74

Please sign in to comment.