From: Jonathan Cameron <jic23@kernel.org>
To: Fabio Estevam <festevam@gmail.com>
Cc: lars@metafoo.de, linux-iio@vger.kernel.org,
Fabio Estevam <fabio.estevam@nxp.com>
Subject: Re: [PATCH] iio: adc: ad7766: Remove unneeded gpiod NULL check
Date: Mon, 17 Jul 2017 21:48:00 +0100 [thread overview]
Message-ID: <20170717214800.15ce31b1@kernel.org> (raw)
In-Reply-To: <1500240363-16396-1-git-send-email-festevam@gmail.com>
On Sun, 16 Jul 2017 18:26:03 -0300
Fabio Estevam <festevam@gmail.com> wrote:
> From: Fabio Estevam <fabio.estevam@nxp.com>
>
> 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>
Applied to the togreg branch of iio.git and pushed out as testing
for the autobuilders to play with it.
Thanks,
Jonathan
> ---
> drivers/iio/adc/ad7766.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/iio/adc/ad7766.c b/drivers/iio/adc/ad7766.c
> index 75cca42..ce45037 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
prev parent reply other threads:[~2017-07-17 20:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-16 21:26 [PATCH] iio: adc: ad7766: Remove unneeded gpiod NULL check Fabio Estevam
2017-07-17 20:48 ` Jonathan Cameron [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170717214800.15ce31b1@kernel.org \
--to=jic23@kernel.org \
--cc=fabio.estevam@nxp.com \
--cc=festevam@gmail.com \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).