[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aYKj31hi1bF4wmsi@zenone.zhora.eu>
Date: Wed, 4 Feb 2026 02:43:30 +0100
From: Andi Shyti <andi.shyti@...nel.org>
To: Artem Shimko <a.shimko.dev@...il.com>
Cc: p.zabel@...gutronix.de, mika.westerberg@...ux.intel.com,
andriy.shevchenko@...ux.intel.com, jsd@...ihalf.com, linux-i2c@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v6 1/2] i2c: designware-platdrv: simplify reset control
Hi Artem,
On Fri, Jan 30, 2026 at 02:10:36PM +0300, Artem Shimko wrote:
> The current implementation uses separate calls to acquire and deassert
> reset control, requiring manual error handling for the deassertion
> operation. This can be simplified using the dedicated devm function that
> combines both operations.
>
> Replace devm_reset_control_get_optional_exclusive() with
> devm_reset_control_get_optional_exclusive_deasserted(), which handles both
> reset acquisition and deassertion in a single call as well as
> reset_control_put() which is called automatically on driver detach. This
> eliminates the need for explicit deassertion and its associated error
> checking while maintaining the same functional behavior through automatic
> resource management.
>
> Signed-off-by: Artem Shimko <a.shimko.dev@...il.com>
> ---
> drivers/i2c/busses/i2c-designware-platdrv.c | 30 +++++++--------------
> 1 file changed, 9 insertions(+), 21 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
> index 7be99656a67d..88e70970c72c 100644
> --- a/drivers/i2c/busses/i2c-designware-platdrv.c
> +++ b/drivers/i2c/busses/i2c-designware-platdrv.c
> @@ -227,40 +227,32 @@ static int dw_i2c_plat_probe(struct platform_device *pdev)
> if (ret)
> return ret;
>
> - dev->rst = devm_reset_control_get_optional_exclusive(device, NULL);
> + dev->rst = devm_reset_control_get_optional_exclusive_deasserted(device, NULL);
> if (IS_ERR(dev->rst))
> return dev_err_probe(device, PTR_ERR(dev->rst), "failed to acquire reset\n");
>
> - reset_control_deassert(dev->rst);
> -
> ret = i2c_dw_fw_parse_and_configure(dev);
> if (ret)
> - goto exit_reset;
> + return ret;
>
> ret = i2c_dw_probe_lock_support(dev);
> - if (ret) {
> - dev_err_probe(device, ret, "failed to probe lock support\n");
> - goto exit_reset;
> - }
> + if (ret)
> + return dev_err_probe(device, ret, "failed to probe lock support\n");
the dev_err_probe() changes are not mentioned in the commit log.
Can you please split this patch in two, one for the
devm_reset_control and one for the dev_err_probe?
Thanks,
Andi
Powered by blists - more mailing lists