diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/radio/si4713/si4713.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/media/radio/si4713/si4713.c b/drivers/media/radio/si4713/si4713.c index c90004dac170..e9d03ac69a27 100644 --- a/drivers/media/radio/si4713/si4713.c +++ b/drivers/media/radio/si4713/si4713.c | |||
@@ -383,7 +383,7 @@ static int si4713_powerup(struct si4713_device *sdev) | |||
383 | } | 383 | } |
384 | } | 384 | } |
385 | 385 | ||
386 | if (!IS_ERR(sdev->gpio_reset)) { | 386 | if (sdev->gpio_reset) { |
387 | udelay(50); | 387 | udelay(50); |
388 | gpiod_set_value(sdev->gpio_reset, 1); | 388 | gpiod_set_value(sdev->gpio_reset, 1); |
389 | } | 389 | } |
@@ -407,8 +407,7 @@ static int si4713_powerup(struct si4713_device *sdev) | |||
407 | SI4713_STC_INT | SI4713_CTS); | 407 | SI4713_STC_INT | SI4713_CTS); |
408 | return err; | 408 | return err; |
409 | } | 409 | } |
410 | if (!IS_ERR(sdev->gpio_reset)) | 410 | gpiod_set_value(sdev->gpio_reset, 0); |
411 | gpiod_set_value(sdev->gpio_reset, 0); | ||
412 | 411 | ||
413 | 412 | ||
414 | if (sdev->vdd) { | 413 | if (sdev->vdd) { |
@@ -447,7 +446,7 @@ static int si4713_powerdown(struct si4713_device *sdev) | |||
447 | v4l2_dbg(1, debug, &sdev->sd, "Power down response: 0x%02x\n", | 446 | v4l2_dbg(1, debug, &sdev->sd, "Power down response: 0x%02x\n", |
448 | resp[0]); | 447 | resp[0]); |
449 | v4l2_dbg(1, debug, &sdev->sd, "Device in reset mode\n"); | 448 | v4l2_dbg(1, debug, &sdev->sd, "Device in reset mode\n"); |
450 | if (!IS_ERR(sdev->gpio_reset)) | 449 | if (sdev->gpio_reset) |
451 | gpiod_set_value(sdev->gpio_reset, 0); | 450 | gpiod_set_value(sdev->gpio_reset, 0); |
452 | 451 | ||
453 | if (sdev->vdd) { | 452 | if (sdev->vdd) { |
@@ -1460,14 +1459,9 @@ static int si4713_probe(struct i2c_client *client, | |||
1460 | goto exit; | 1459 | goto exit; |
1461 | } | 1460 | } |
1462 | 1461 | ||
1463 | sdev->gpio_reset = devm_gpiod_get(&client->dev, "reset"); | 1462 | sdev->gpio_reset = devm_gpiod_get_optional(&client->dev, "reset", |
1464 | if (!IS_ERR(sdev->gpio_reset)) { | 1463 | GPIOD_OUT_LOW); |
1465 | gpiod_direction_output(sdev->gpio_reset, 0); | 1464 | if (IS_ERR(sdev->gpio_reset)) { |
1466 | } else if (PTR_ERR(sdev->gpio_reset) == -ENOENT) { | ||
1467 | dev_dbg(&client->dev, "No reset GPIO assigned\n"); | ||
1468 | } else if (PTR_ERR(sdev->gpio_reset) == -ENOSYS) { | ||
1469 | dev_dbg(&client->dev, "No reset GPIO support\n"); | ||
1470 | } else { | ||
1471 | rval = PTR_ERR(sdev->gpio_reset); | 1465 | rval = PTR_ERR(sdev->gpio_reset); |
1472 | dev_err(&client->dev, "Failed to request gpio: %d\n", rval); | 1466 | dev_err(&client->dev, "Failed to request gpio: %d\n", rval); |
1473 | goto exit; | 1467 | goto exit; |