linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Alan Tull <atull@kernel.org>, Philipp Zabel <p.zabel@pengutronix.de>
Cc: Hoan Tran <hotran@apm.com>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] gpio: gpio-dwapb: add optional reset
Date: Wed, 11 Oct 2017 10:31:06 +0200	[thread overview]
Message-ID: <CACRpkdbS6b9GW8HXmthOfaRPFMARMpyNGaR8He5BJbtfOXLMVw@mail.gmail.com> (raw)
In-Reply-To: <20171010212617.3397-1-atull@kernel.org>

On Tue, Oct 10, 2017 at 11:26 PM, Alan Tull <atull@kernel.org> wrote:

> Some platforms require reset to be released to allow register
> access.
>
> Signed-off-by: Alan Tull <atull@kernel.org>

Fair enough.

(...)
> +       rst = devm_reset_control_get_optional_exclusive(dev, NULL);
> +       if (IS_ERR(rst)) {
> +               if (PTR_ERR(rst) == -EPROBE_DEFER)
> +                       return PTR_ERR(rst);
> +       } else {
> +               reset_control_deassert(rst);
> +               gpio->rst = rst;
> +       }

I do not see why any error other than -EPROBE_DEFER
should be ignored?

I guess the _optional API returns NULL if there is no
reset line so it should be fine to just return the error on
any error.

> +       if (gpio->rst)
> +               reset_control_assert(gpio->rst);

Is this the right way to handle an optional reset line?

Yours,
Linus Walleij

  reply	other threads:[~2017-10-11  8:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-10 21:26 [PATCH] gpio: gpio-dwapb: add optional reset Alan Tull
2017-10-11  8:31 ` Linus Walleij [this message]
2017-10-11 10:56   ` Philipp Zabel
2017-10-11 16:05     ` Alan Tull
  -- strict thread matches above, loose matches on Subject: below --
2017-10-11 16:34 Alan Tull
2017-10-11 17:47 ` Alan Tull
2017-10-12  8:18 ` Philipp Zabel
2017-10-12  8:26 ` Linus Walleij
2017-10-12 14:34   ` Alan Tull

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=CACRpkdbS6b9GW8HXmthOfaRPFMARMpyNGaR8He5BJbtfOXLMVw@mail.gmail.com \
    --to=linus.walleij@linaro.org \
    --cc=atull@kernel.org \
    --cc=hotran@apm.com \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=p.zabel@pengutronix.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;
as well as URLs for NNTP newsgroup(s).