lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMpxmJWdVx_guOGCb6aNoUmG_JBqWGui-qZmUCOuunOkxzTPFQ@mail.gmail.com>
Date:   Fri, 2 Aug 2019 09:06:57 +0200
From:   Bartosz Golaszewski <bgolaszewski@...libre.com>
To:     Anson Huang <Anson.Huang@....com>
Cc:     Linus Walleij <linus.walleij@...aro.org>,
        linux-gpio <linux-gpio@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        dl-linux-imx <Linux-imx@....com>
Subject: Re: [PATCH] gpio: mxc: Use devm_clk_get_optional instead of devm_clk_get

czw., 1 sie 2019 o 10:54 <Anson.Huang@....com> napisaƂ(a):
>
> From: Anson Huang <Anson.Huang@....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@....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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ