[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241202082658.9673-1-wsa+renesas@sang-engineering.com>
Date: Mon, 2 Dec 2024 09:26:58 +0100
From: Wolfram Sang <wsa+renesas@...g-engineering.com>
To: linux-kernel@...r.kernel.org
Cc: Wolfram Sang <wsa+renesas@...g-engineering.com>,
Andi Shyti <andi.shyti@...nel.org>,
linux-i2c@...r.kernel.org
Subject: [PATCH] i2c: keba: drop check because i2c_unregister_device() is NULL safe
No need to check the argument of i2c_unregister_device() because the
function itself does it.
Signed-off-by: Wolfram Sang <wsa+renesas@...g-engineering.com>
---
Build tested only. Please apply to your tree.
drivers/i2c/busses/i2c-keba.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/i2c/busses/i2c-keba.c b/drivers/i2c/busses/i2c-keba.c
index 759732a07ef0..7b9ed2592f5b 100644
--- a/drivers/i2c/busses/i2c-keba.c
+++ b/drivers/i2c/busses/i2c-keba.c
@@ -464,12 +464,8 @@ static void ki2c_unregister_devices(struct ki2c *ki2c)
{
int i;
- for (i = 0; i < ki2c->client_size; i++) {
- struct i2c_client *client = ki2c->client[i];
-
- if (client)
- i2c_unregister_device(client);
- }
+ for (i = 0; i < ki2c->client_size; i++)
+ i2c_unregister_device(ki2c->client[i]);
}
static int ki2c_register_devices(struct ki2c *ki2c)
--
2.39.2
Powered by blists - more mailing lists