[U-Boot] [PATCH v2] spi: designware_spi: Disable and free clock when remove driver
Ley Foon Tan
lftan.linux at gmail.com
Thu Sep 20 07:50:49 UTC 2018
On Wed, Sep 19, 2018 at 5:22 PM Marek Vasut <marex at denx.de> wrote:
>
> On 09/19/2018 10:27 AM, Ley Foon Tan wrote:
> > Disable and free clock when remove driver.
> >
> > Signed-off-by: Ley Foon Tan <ley.foon.tan at intel.com>
> >
> > ---
> > v2:
> > - Check return value from clk_free() and return 0 when exit function
> > ---
> > drivers/spi/designware_spi.c | 16 +++++++++++++++-
> > 1 file changed, 15 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/spi/designware_spi.c b/drivers/spi/designware_spi.c
> > index 5cca414..8f0c602 100644
> > --- a/drivers/spi/designware_spi.c
> > +++ b/drivers/spi/designware_spi.c
> > @@ -516,8 +516,22 @@ static int dw_spi_set_mode(struct udevice *bus, uint mode)
> > static int dw_spi_remove(struct udevice *bus)
> > {
> > struct dw_spi_priv *priv = dev_get_priv(bus);
> > + int ret;
> > +
> > + ret = reset_release_bulk(&priv->resets);
> > + if (ret)
> > + return ret;
> >
> > - return reset_release_bulk(&priv->resets);
> > +#if CONFIG_IS_ENABLED(CLK)
> > + ret = clk_disable(&priv->clk);
> > + if (ret)
> > + return ret;
> > +
> > + ret = clk_free(&priv->clk);
> > + if (ret)
> > + return ret;
> > +#endif
> > + return 0;
> > }
> >
> > static const struct dm_spi_ops dw_spi_ops = {
> >
>
> Acked-by: Marek Vasut <marex at denx.de>
>
> btw this doesn't apply to socfpga/master .
>
Jagan,
Can you help to merge this patch?
And also this designware_spi's patch. This patch should apply first.
https://patchwork.ozlabs.org/patch/967210/
Regards
Ley Foon
More information about the U-Boot
mailing list