[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aXiG5p9BQ-vkAgbV@smile.fi.intel.com>
Date: Tue, 27 Jan 2026 11:35:34 +0200
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: abdurrahman@...thop.ai
Cc: Michal Simek <michal.simek@....com>, Andi Shyti <andi.shyti@...nel.org>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, info@...ean-labs.com,
linux-arm-kernel@...ts.infradead.org, linux-i2c@...r.kernel.org,
linux-kernel@...r.kernel.org, devicetree@...r.kernel.org
Subject: Re: [PATCH v5 3/6] i2c: xiic: switch to devres managed APIs
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
Powered by blists - more mailing lists