[PATCH v5 3/6] i2c: xiic: switch to devres managed APIs
Andy Shevchenko
andriy.shevchenko at intel.com
Tue Jan 27 01:35:34 PST 2026
On Mon, Jan 26, 2026 at 05:08:18PM +0000, Abdurrahman Hussain via B4 Relay wrote:
> Simplify the error code paths by switching to devres managed helper
> functions.
Thanks for the update, my comments below.
...
> + ret = devm_mutex_init(dev, &i2c->lock);
> + if (ret < 0)
Why ' < 0'?
> + return ret;
...
> + ret = devm_pm_runtime_set_active_enabled(dev);
> + if (ret < 0)
Ditto.
> + return ret;
...
> if (ret < 0) {
> dev_err_probe(&pdev->dev, ret, "Cannot claim IRQ\n");
> - goto err_pm_disable;
> + return ret;
return dev_err_probe(...);
> }
...
> ret = xiic_reinit(i2c);
> if (ret < 0) {
> dev_err_probe(&pdev->dev, ret, "Cannot xiic_reinit\n");
Ditto.
> - goto err_pm_disable;
> + return ret;
> }
...
> dev_dbg(&pdev->dev, "mmio %08lx irq %d scl clock frequency %d\n",
> (unsigned long)res->start, irq, i2c->i2c_clk);
Side note, consider using %pR instead of ugly casting for resources.
(separate change).
--
With Best Regards,
Andy Shevchenko
More information about the linux-arm-kernel
mailing list