linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
To: Anson Huang <Anson.Huang@nxp.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	linux-gpio <linux-gpio@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	dl-linux-imx <Linux-imx@nxp.com>
Subject: Re: [PATCH] gpio: mxc: Use devm_clk_get_optional instead of devm_clk_get
Date: Fri, 2 Aug 2019 09:06:57 +0200	[thread overview]
Message-ID: <CAMpxmJWdVx_guOGCb6aNoUmG_JBqWGui-qZmUCOuunOkxzTPFQ@mail.gmail.com> (raw)
In-Reply-To: <20190801084439.36487-1-Anson.Huang@nxp.com>

czw., 1 sie 2019 o 10:54 <Anson.Huang@nxp.com> napisał(a):
>
> From: Anson Huang <Anson.Huang@nxp.com>
>
> i.MX SoC's GPIO clock is optional, so it is better to use
> devm_clk_get_optional instead of devm_clk_get.
>
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> ---
>  drivers/gpio/gpio-mxc.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c
> index b281358..7907a87 100644
> --- a/drivers/gpio/gpio-mxc.c
> +++ b/drivers/gpio/gpio-mxc.c
> @@ -435,12 +435,9 @@ static int mxc_gpio_probe(struct platform_device *pdev)
>                 return port->irq;
>
>         /* the controller clock is optional */
> -       port->clk = devm_clk_get(&pdev->dev, NULL);
> -       if (IS_ERR(port->clk)) {
> -               if (PTR_ERR(port->clk) == -EPROBE_DEFER)
> -                       return -EPROBE_DEFER;
> -               port->clk = NULL;
> -       }
> +       port->clk = devm_clk_get_optional(&pdev->dev, NULL);
> +       if (IS_ERR(port->clk))
> +               return PTR_ERR(port->clk);
>
>         err = clk_prepare_enable(port->clk);
>         if (err) {
> --
> 2.7.4
>

Patch applied, thanks!

Bart

      reply	other threads:[~2019-08-02  7:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-01  8:44 [PATCH] gpio: mxc: Use devm_clk_get_optional instead of devm_clk_get Anson.Huang
2019-08-02  7:06 ` Bartosz Golaszewski [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=CAMpxmJWdVx_guOGCb6aNoUmG_JBqWGui-qZmUCOuunOkxzTPFQ@mail.gmail.com \
    --to=bgolaszewski@baylibre.com \
    --cc=Anson.Huang@nxp.com \
    --cc=Linux-imx@nxp.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@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).