RE: [PATCH 04/11] i2c: imx-lpi2c: manage irq resource request/release in runtime pm
From: Aisheng Dong <aisheng.dong@nxp.com>
Date: 2021-03-19 10:13:14
Also in:
linux-i2c, lkml
From: Aisheng Dong <aisheng.dong@nxp.com>
Date: 2021-03-19 10:13:14
Also in:
linux-i2c, lkml
quoted
quoted
@@ -665,6 +659,14 @@ static int __maybe_unusedlpi2c_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 rpmdevm_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 Wangquoted
quoted
+ 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
_______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel