[PATCH 095/606] iio: gyro: mpu3050-i2c: Convert to i2c's .probe_new()

From: Uwe Kleine-König
Date: Fri Nov 18 2022 - 17:53:52 EST


From: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>

.probe_new() doesn't get the i2c_device_id * parameter, so determine
that explicitly in the probe function.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>
---
drivers/iio/gyro/mpu3050-i2c.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/iio/gyro/mpu3050-i2c.c b/drivers/iio/gyro/mpu3050-i2c.c
index 12e3afa9dd11..2116798226bf 100644
--- a/drivers/iio/gyro/mpu3050-i2c.c
+++ b/drivers/iio/gyro/mpu3050-i2c.c
@@ -32,9 +32,9 @@ static int mpu3050_i2c_bypass_deselect(struct i2c_mux_core *mux, u32 chan_id)
return 0;
}

-static int mpu3050_i2c_probe(struct i2c_client *client,
- const struct i2c_device_id *id)
+static int mpu3050_i2c_probe(struct i2c_client *client)
{
+ const struct i2c_device_id *id = i2c_client_get_device_id(client);
struct regmap *regmap;
const char *name;
struct mpu3050 *mpu3050;
@@ -108,7 +108,7 @@ static const struct of_device_id mpu3050_i2c_of_match[] = {
MODULE_DEVICE_TABLE(of, mpu3050_i2c_of_match);

static struct i2c_driver mpu3050_i2c_driver = {
- .probe = mpu3050_i2c_probe,
+ .probe_new = mpu3050_i2c_probe,
.remove = mpu3050_i2c_remove,
.id_table = mpu3050_i2c_id,
.driver = {
--
2.38.1