summaryrefslogtreecommitdiff
path: root/drivers/iio/proximity/srf04.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/iio/proximity/srf04.c')
-rw-r--r--drivers/iio/proximity/srf04.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/iio/proximity/srf04.c b/drivers/iio/proximity/srf04.c
index b059bac1078b..e97f9a20ac7a 100644
--- a/drivers/iio/proximity/srf04.c
+++ b/drivers/iio/proximity/srf04.c
@@ -117,10 +117,8 @@ static int srf04_read(struct srf04_data *data)
udelay(data->cfg->trigger_pulse_us);
gpiod_set_value(data->gpiod_trig, 0);
- if (data->gpiod_power) {
- pm_runtime_mark_last_busy(data->dev);
+ if (data->gpiod_power)
pm_runtime_put_autosuspend(data->dev);
- }
/* it should not take more than 20 ms until echo is rising */
ret = wait_for_completion_killable_timeout(&data->rising, HZ/50);
@@ -253,10 +251,8 @@ static int srf04_probe(struct platform_device *pdev)
int ret;
indio_dev = devm_iio_device_alloc(dev, sizeof(struct srf04_data));
- if (!indio_dev) {
- dev_err(dev, "failed to allocate IIO device\n");
+ if (!indio_dev)
return -ENOMEM;
- }
data = iio_priv(indio_dev);
data->dev = dev;