[PATCH 2/3] i2c: implement i2c_unregister_device()
Sascha Hauer
s.hauer at pengutronix.de
Wed Dec 17 06:51:54 PST 2025
We had no need so far, but we do in a followup patch.
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
drivers/i2c/i2c.c | 6 ++++++
include/i2c/i2c.h | 2 ++
2 files changed, 8 insertions(+)
diff --git a/drivers/i2c/i2c.c b/drivers/i2c/i2c.c
index 0f294a93bf..407c4db8a7 100644
--- a/drivers/i2c/i2c.c
+++ b/drivers/i2c/i2c.c
@@ -421,6 +421,12 @@ static struct i2c_client *i2c_new_device(struct i2c_adapter *adapter,
return client;
}
+void i2c_unregister_device(struct i2c_client *client)
+{
+ unregister_device(&client->dev);
+ devinfo_del(&client->dev, i2c_info);
+}
+
static void of_i2c_register_devices(struct i2c_adapter *adap)
{
struct device_node *n;
diff --git a/include/i2c/i2c.h b/include/i2c/i2c.h
index 5c0174b0dd..fb3f43cabb 100644
--- a/include/i2c/i2c.h
+++ b/include/i2c/i2c.h
@@ -313,6 +313,8 @@ extern struct class i2c_adapter_class;
extern struct i2c_client *
i2c_new_dummy(struct i2c_adapter *adap, u16 address);
+void i2c_unregister_device(struct i2c_client *client);
+
/* Return the adapter number for a specific adapter */
static inline int i2c_adapter_id(struct i2c_adapter *adap)
{
--
2.47.3
More information about the barebox
mailing list