Re: [PATCH] gpio: gpio-dwapb: add optional reset

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

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

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
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux