[PATCH 3/3] mtd: rawnand: renesas: Use runtime PM instead of the raw clock API

Miquel Raynal miquel.raynal at bootlin.com
Mon May 9 08:34:24 PDT 2022


Hi Geert,


> >         ret = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
> >         if (ret)
> > -               goto disable_eclk;
> > +               return ret;
> > +
> > +       pm_runtime_enable(&pdev->dev);
> > +       pm_runtime_get_sync(&pdev->dev);  
> 
> ret = pm_runtime_resume_and_get)...);
> if (ret < 0) ...

I also changed the enable call to use devm_pm_runtime_enable() and
dropped the calls to pm_runtime_disable() below (same in the RTC
driver).

> 
> > +
> > +       /* The external NAND bus clock rate is needed for computing timings */
> > +       eclk = clk_get(&pdev->dev, "eclk");
> > +       if (IS_ERR(eclk)) {
> > +               ret = PTR_ERR(eclk);
> > +               goto dis_runtime_pm;
> > +       }
> > +
> > +       rnandc->ext_clk_rate = clk_get_rate(eclk);
> > +       clk_put(eclk);
> >

Thanks,
Miquèl



More information about the linux-mtd mailing list