> > > @@ -665,6 +659,14 @@ static int __maybe_unused
> > > lpi2c_runtime_resume(struct device *dev)
> > >           dev_err(dev, "can't enable I2C ipg clock, ret=%d\n", ret);
> > >   }
> > >
> > > + ret = devm_request_irq(dev, lpi2c_imx->irq, lpi2c_imx_isr,
> >
> > I guess unnecessary to use devm in rpm
> 
> devm_request_irq() will use device resource management.
> Other resource like clk and struct space are all managed by devres.
> Maybe we can still use devm_ to let devres manage irq here?
> 

devm_xxx is usually used to auto free resources when probe fail,
driver unbound / device unregister and etc. Not for runtime pm.
I may prefer using request_irq/free_irq directly in runtime.

BTW, current lpi2c_imx_remove seems didn't ensure the device is
In runtime suspend state after removing.
If framework can't guarantee, the driver has to do it.
Anyway, that's another issue and need a separate patch.

Regards
Aisheng

> Thanks.
> 
> Best Regards,
> Clark Wang
> 
> 
> >
> > > +                        IRQF_NO_SUSPEND,
> > > +                        dev_name(dev), lpi2c_imx);
> > > + if (ret) {
> > > +         dev_err(dev, "can't claim irq %d\n", lpi2c_imx->irq);
> > > +         return ret;
> > > + }
> > > +
> > >   return ret;
> > >  }
> > >
> > > --
> > > 2.25.1

Reply via email to