diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2013-05-02 11:11:50 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-05-21 07:50:56 -0300 |
commit | 95323361e5313733a54771c5059f5b352adbf32c (patch) | |
tree | 9731320d716278f03171002ee6c98d6d2948af6e /drivers/media/i2c/m5mols | |
parent | c7e3cc3ca1ff2fe1aeffd2ba642548d79f9a73dc (diff) |
[media] media: i2c: Convert to gpio_request_one()
Replace gpio_request() with gpio_request_one() and remove the associated
gpio_direction_output() calls.
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.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/media/i2c/m5mols/m5mols_core.c b/drivers/media/i2c/m5mols/m5mols_core.c index 0b899cb6cda1..f0b870c06376 100644 --- a/drivers/media/i2c/m5mols/m5mols_core.c +++ b/drivers/media/i2c/m5mols/m5mols_core.c @@ -930,6 +930,7 @@ static int m5mols_probe(struct i2c_client *client, const struct i2c_device_id *id) { const struct m5mols_platform_data *pdata = client->dev.platform_data; + unsigned long gpio_flags; struct m5mols_info *info; struct v4l2_subdev *sd; int ret; @@ -956,12 +957,13 @@ static int m5mols_probe(struct i2c_client *client, info->pdata = pdata; info->set_power = pdata->set_power; - ret = gpio_request(pdata->gpio_reset, "M5MOLS_NRST"); + gpio_flags = pdata->reset_polarity + ? GPIOF_OUT_INIT_HIGH : GPIOF_OUT_INIT_LOW; + ret = gpio_request_one(pdata->gpio_reset, gpio_flags, "M5MOLS_NRST"); if (ret) { dev_err(&client->dev, "Failed to request gpio: %d\n", ret); goto out_free; } - gpio_direction_output(pdata->gpio_reset, pdata->reset_polarity); ret = regulator_bulk_get(&client->dev, ARRAY_SIZE(supplies), supplies); if (ret) { |