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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdbS6b9GW8HXmthOfaRPFMARMpyNGaR8He5BJbtfOXLMVw@mail.gmail.com>
Date:   Wed, 11 Oct 2017 10:31:06 +0200
From:   Linus Walleij <linus.walleij@...aro.org>
To:     Alan Tull <atull@...nel.org>,
        Philipp Zabel <p.zabel@...gutronix.de>
Cc:     Hoan Tran <hotran@....com>,
        "linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] gpio: gpio-dwapb: add optional reset

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

> Some platforms require reset to be released to allow register
> access.
>
> Signed-off-by: Alan Tull <atull@...nel.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ