* [PATCH v5 1/2] i2c: designware-platdrv: simplify reset control
@ 2026-01-23 10:05 Artem Shimko
0 siblings, 0 replies; only message in thread
From: Artem Shimko @ 2026-01-23 10:05 UTC (permalink / raw)
To: Mika Westerberg, Andy Shevchenko, Jan Dabros, Andi Shyti,
Philipp Zabel
Cc: Artem Shimko, linux-i2c, linux-kernel
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@gmail.com>
---
drivers/i2c/busses/i2c-designware-platdrv.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index 7be99656a67d..ab960458b5a8 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -227,12 +227,10 @@ 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;
--
2.43.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-01-23 10:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-23 10:05 [PATCH v5 1/2] i2c: designware-platdrv: simplify reset control Artem Shimko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox