From: Peter Rosin <peda@axentia.se>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>,
Wolfram Sang <wsa@the-dreams.de>
Subject: Re: [PATCH v1 3/5] i2c: mux: pca954x: Drop useless validation for optional GPIO descriptor
Date: Thu, 5 Mar 2020 21:19:05 +0000 [thread overview]
Message-ID: <3a0bd56d-0efb-e1cf-c050-05deefc4433a@axentia.se> (raw)
In-Reply-To: <20200305155352.39095-3-andriy.shevchenko@linux.intel.com>
Hi!
On 2020-03-05 16:53, Andy Shevchenko wrote:
> There is no need to perform a check for optional GPIO descriptor.
> If it's NULL, the API can handle it correctly.
But, the removed test is not only (needlessly) protecting the optional
descriptor, it also shortcuts the udelays. I think it is valid to
skip those pointless udelays when no reset is happening anyway. Not
that it matters all that much when the delays are as short as this, but
I simply think it looks sensible to skip the delays when that are not
needed.
So, I do not think this change is an improvement.
Cheers,
Peter
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> drivers/i2c/muxes/i2c-mux-pca954x.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/i2c/muxes/i2c-mux-pca954x.c b/drivers/i2c/muxes/i2c-mux-pca954x.c
> index 2e42a113ef1f..fe4320fc0b91 100644
> --- a/drivers/i2c/muxes/i2c-mux-pca954x.c
> +++ b/drivers/i2c/muxes/i2c-mux-pca954x.c
> @@ -444,12 +444,12 @@ static int pca954x_probe(struct i2c_client *client,
> gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH);
> if (IS_ERR(gpio))
> return PTR_ERR(gpio);
> - if (gpio) {
> - udelay(1);
> - gpiod_set_value_cansleep(gpio, 0);
> - /* Give the chip some time to recover. */
> - udelay(1);
> - }
> +
> + /* Reset the multiplexer */
> + udelay(1);
> + gpiod_set_value_cansleep(gpio, 0);
> + /* Give the chip some time to recover. */
> + udelay(1);
>
> data->chip = device_get_match_data(dev);
> if (!data->chip)
>
next prev parent reply other threads:[~2020-03-05 21:19 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-05 15:53 [PATCH v1 1/5] i2c: mux: pca954x: Refactor pca954x_irq_handler() Andy Shevchenko
2020-03-05 15:53 ` [PATCH v1 2/5] i2c: mux: pca954x: Make use of device properties Andy Shevchenko
2020-03-05 21:05 ` Peter Rosin
2020-03-06 9:54 ` Andy Shevchenko
2020-03-06 11:48 ` Peter Rosin
2020-03-06 13:58 ` Andy Shevchenko
2020-03-06 14:57 ` Peter Rosin
2020-03-06 15:07 ` Andy Shevchenko
2020-03-05 15:53 ` [PATCH v1 3/5] i2c: mux: pca954x: Drop useless validation for optional GPIO descriptor Andy Shevchenko
2020-03-05 21:19 ` Peter Rosin [this message]
2020-03-06 9:56 ` Andy Shevchenko
2020-03-05 15:53 ` [PATCH v1 4/5] i2c: mux: pca954x: Move device_remove_file() out of pca954x_cleanup() Andy Shevchenko
2020-03-05 15:53 ` [PATCH v1 5/5] i2c: mux: pca954x: Convert license to SPDX identifier Andy Shevchenko
2020-03-05 21:34 ` [PATCH v1 1/5] i2c: mux: pca954x: Refactor pca954x_irq_handler() Peter Rosin
2020-03-06 10:02 ` Andy Shevchenko
2020-03-06 10:58 ` Peter Rosin
2020-03-16 16:08 ` Andy Shevchenko
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=3a0bd56d-0efb-e1cf-c050-05deefc4433a@axentia.se \
--to=peda@axentia.se \
--cc=andriy.shevchenko@linux.intel.com \
--cc=linux-i2c@vger.kernel.org \
--cc=wsa@the-dreams.de \
/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