[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221118224540.619276-607-uwe@kleine-koenig.org>
Date: Fri, 18 Nov 2022 23:45:40 +0100
From: Uwe Kleine-König <uwe@...ine-koenig.org>
To: Angel Iglesias <ang.iglesiasg@...il.com>,
Lee Jones <lee.jones@...aro.org>,
Grant Likely <grant.likely@...aro.org>,
Wolfram Sang <wsa@...nel.org>
Cc: linux-i2c@...r.kernel.org, kernel@...gutronix.de,
linux-kernel@...r.kernel.org
Subject: [PATCH 606/606] [DON'T APPLY] i2c: Switch .probe() to not take an id parameter
---
drivers/i2c/i2c-core-base.c | 11 ++---------
include/linux/i2c.h | 12 +++++++-----
2 files changed, 9 insertions(+), 14 deletions(-)
diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c
index 087e480b624c..1fbe16221085 100644
--- a/drivers/i2c/i2c-core-base.c
+++ b/drivers/i2c/i2c-core-base.c
@@ -558,15 +558,8 @@ static int i2c_device_probe(struct device *dev)
goto err_detach_pm_domain;
}
- /*
- * When there are no more users of probe(),
- * rename probe_new to probe.
- */
- if (driver->probe_new)
- status = driver->probe_new(client);
- else if (driver->probe)
- status = driver->probe(client,
- i2c_match_id(driver->id_table, client));
+ if (driver->probe)
+ status = driver->probe(client);
else
status = -EINVAL;
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index d84e0e99f084..7414ec3ba858 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -272,14 +272,16 @@ enum i2c_driver_flags {
struct i2c_driver {
unsigned int class;
+ union {
/* Standard driver model interfaces */
- int (*probe)(struct i2c_client *client, const struct i2c_device_id *id);
+ int (*probe)(struct i2c_client *client);
+ /* New driver model interface to aid the seamless removal of the
+ * current probe()'s, more commonly unused than used second parameter.
+ */
+ int (*probe_new)(struct i2c_client *client);
+ };
void (*remove)(struct i2c_client *client);
- /* New driver model interface to aid the seamless removal of the
- * current probe()'s, more commonly unused than used second parameter.
- */
- int (*probe_new)(struct i2c_client *client);
/* driver model interfaces that don't relate to enumeration */
void (*shutdown)(struct i2c_client *client);
--
2.38.1
Powered by blists - more mailing lists