Message ID | 20210619225118.1862634-1-linus.walleij@linaro.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [1/3] mmc: mmci: De-assert reset on probe | expand |
On Sun, 20 Jun 2021 at 00:53, Linus Walleij <linus.walleij@linaro.org> wrote: > > If we find a reset handle when probing the MMCI block, > make sure the reset is de-asserted. It could happen that > a hardware has reset asserted at boot. > > Cc: Russell King <linux@armlinux.org.uk> > Cc: Yann Gautier <yann.gautier@foss.st.com> > Cc: Ludovic Barre <ludovic.barre@st.com> > Signed-off-by: Linus Walleij <linus.walleij@linaro.org> > --- > drivers/mmc/host/mmci.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c > index 984d35055156..af2ed6013ef9 100644 > --- a/drivers/mmc/host/mmci.c > +++ b/drivers/mmc/host/mmci.c > @@ -2125,6 +2125,10 @@ static int mmci_probe(struct amba_device *dev, > if (IS_ERR(host->rst)) { > ret = PTR_ERR(host->rst); > goto clk_disable; > + } else { You can skip this "else", as reset_control_deassert() copes with a NULL pointer being passed to it. > + ret = reset_control_deassert(host->rst); > + if (ret) > + dev_err(mmc_dev(mmc), "failed to de-assert reset\n"); > } > > /* Get regulators and the supported OCR mask */ > -- > 2.31.1 > Kind regards Uffe
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 984d35055156..af2ed6013ef9 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -2125,6 +2125,10 @@ static int mmci_probe(struct amba_device *dev, if (IS_ERR(host->rst)) { ret = PTR_ERR(host->rst); goto clk_disable; + } else { + ret = reset_control_deassert(host->rst); + if (ret) + dev_err(mmc_dev(mmc), "failed to de-assert reset\n"); } /* Get regulators and the supported OCR mask */
If we find a reset handle when probing the MMCI block, make sure the reset is de-asserted. It could happen that a hardware has reset asserted at boot. Cc: Russell King <linux@armlinux.org.uk> Cc: Yann Gautier <yann.gautier@foss.st.com> Cc: Ludovic Barre <ludovic.barre@st.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> --- drivers/mmc/host/mmci.c | 4 ++++ 1 file changed, 4 insertions(+)