summaryrefslogtreecommitdiffstats
path: root/drivers/iio/adc/ad7766.c
diff options
context:
space:
mode:
authorFabio Estevam <fabio.estevam@nxp.com>2017-07-16 23:26:03 +0200
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2017-07-17 22:47:31 +0200
commit8b298fb789aaf093897d2f2b905d0fbee8663c2e (patch)
tree1aa4185c478c021748c63c4064499ec6050b91f9 /drivers/iio/adc/ad7766.c
parentiio: orientation: hid-sensor-rotation: Drop unnecessary static (diff)
downloadlinux-8b298fb789aaf093897d2f2b905d0fbee8663c2e.tar.xz
linux-8b298fb789aaf093897d2f2b905d0fbee8663c2e.zip
iio: adc: ad7766: Remove unneeded gpiod NULL check
The gpiod API checks for NULL descriptors, so there is no need to duplicate the check in the driver. Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/adc/ad7766.c')
-rw-r--r--drivers/iio/adc/ad7766.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/iio/adc/ad7766.c b/drivers/iio/adc/ad7766.c
index 75cca42b6e70..ce45037295d8 100644
--- a/drivers/iio/adc/ad7766.c
+++ b/drivers/iio/adc/ad7766.c
@@ -103,8 +103,7 @@ static int ad7766_preenable(struct iio_dev *indio_dev)
return ret;
}
- if (ad7766->pd_gpio)
- gpiod_set_value(ad7766->pd_gpio, 0);
+ gpiod_set_value(ad7766->pd_gpio, 0);
return 0;
}
@@ -113,8 +112,7 @@ static int ad7766_postdisable(struct iio_dev *indio_dev)
{
struct ad7766 *ad7766 = iio_priv(indio_dev);
- if (ad7766->pd_gpio)
- gpiod_set_value(ad7766->pd_gpio, 1);
+ gpiod_set_value(ad7766->pd_gpio, 1);
/*
* The PD pin is synchronous to the clock, so give it some time to