linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gpio: mxc: Use devm_clk_get_optional instead of devm_clk_get
@ 2019-08-01  8:44 Anson.Huang
  2019-08-02  7:06 ` Bartosz Golaszewski
  0 siblings, 1 reply; 2+ messages in thread
From: Anson.Huang @ 2019-08-01  8:44 UTC (permalink / raw)
  To: linus.walleij, bgolaszewski, linux-gpio, linux-kernel; +Cc: Linux-imx

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] gpio: mxc: Use devm_clk_get_optional instead of devm_clk_get
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Bartosz Golaszewski @ 2019-08-02  7:06 UTC (permalink / raw)
  To: Anson Huang; +Cc: Linus Walleij, linux-gpio, LKML, dl-linux-imx

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-08-02  7:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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).