[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260123-i2c-xiic-v3-2-eb7cd4254dfb@nexthop.ai>
Date: Fri, 23 Jan 2026 08:02:45 +0000
From: Abdurrahman Hussain via B4 Relay <devnull+abdurrahman.nexthop.ai@...nel.org>
To: Michal Simek <michal.simek@....com>, Andi Shyti <andi.shyti@...nel.org>
Cc: Andy Shevchenko <andriy.shevchenko@...el.com>,
linux-arm-kernel@...ts.infradead.org, linux-i2c@...r.kernel.org,
linux-kernel@...r.kernel.org, Abdurrahman Hussain <abdurrahman@...thop.ai>
Subject: [PATCH v3 2/5] i2c: xiic: switch to managed version of mutex_init
From: Abdurrahman Hussain <abdurrahman@...thop.ai>
Simplify the error path by switching to a managed version of mutex_init.
Signed-off-by: Abdurrahman Hussain <abdurrahman@...thop.ai>
---
drivers/i2c/busses/i2c-xiic.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
index 603a246a1445..79643c27e75d 100644
--- a/drivers/i2c/busses/i2c-xiic.c
+++ b/drivers/i2c/busses/i2c-xiic.c
@@ -1461,7 +1461,10 @@ static int xiic_i2c_probe(struct platform_device *pdev)
snprintf(i2c->adap.name, sizeof(i2c->adap.name),
DRIVER_NAME " %s", pdev->name);
- mutex_init(&i2c->lock);
+ ret = devm_mutex_init(&pdev->dev, &i2c->lock);
+ if (ret < 0)
+ return ret;
+
spin_lock_init(&i2c->atomic_lock);
i2c->clk = devm_clk_get_optional_enabled(&pdev->dev, NULL);
--
2.52.0
Powered by blists - more mailing lists