hwmon: (tmp513) use simple i2c probe
Subsystems (2)
PATCH 1/1 hwmon: (tmp513) use simple i2c probe
As part of the ongoing i2c transition to the simple probe ("probe_new"), this patch uses i2c_match_id to retrieve the driver_data for the probed device. The id parameter is thus no longer necessary and the simple probe can be used instead.
Signed-off-by Stephen Kitt <[email protected]>
--- drivers/hwmon/tmp513.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/hwmon/tmp513.c +4 -5
@@ -709,8 +709,7 @@ static int tmp51x_configure(struct device *dev, struct tmp51x_data *data)return 0 ; } -static int tmp51x_probe (struct i2c_client *client, -const struct i2c_device_id *id) +static int tmp51x_probe (struct i2c_client *client) {struct device *dev = &client->dev;struct tmp51x_data *data;
@@ -724,7 +723,7 @@ static int tmp51x_probe(struct i2c_client *client,if (client->dev.of_node) data->id = (enum tmp51x_ids )device_get_match_data (&client->dev);else - data->id = id->driver_data; + data->id =i2c_match_id (tmp51x_id, client)->driver_data; ret =tmp51x_configure (dev, data);if (ret <0 ) {
@@ -751,7 +750,7 @@ static int tmp51x_probe(struct i2c_client *client,if (IS_ERR (hwmon_dev))return PTR_ERR (hwmon_dev); -dev_dbg (dev,"power monitor %s\n" , id->name); +dev_dbg (dev,"power monitor %s\n" , client->name);return 0 ; }
@@ -761,7 +760,7 @@ static struct i2c_driver tmp51x_driver = { .name = "tmp51x", .of_match_table = of_match_ptr(tmp51x_of_match), }, - .probe = tmp51x_probe, + .probe_new = tmp51x_probe, .id_table = tmp51x_id, };
Signature · 1 line
2.25.4
Quoted 6 lines · Stephen Kitt
As part of the ongoing i2c transition to the simple probe ("
probe_new"), this patch usesi2c_match_idto retrieve thedriver_datafor the probed device. The id parameter is thus no longer necessary and the simple probe can be used instead.Signed-off-by Stephen Kitt <[email protected]>
Applied.
Thanks,
Guenter
Quoted 45 lines
--- drivers/hwmon/tmp513.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)drivers/hwmon/tmp513.c +4
-5@@ -709,8 +709,7 @@ static int tmp51x_configure(struct device *dev, struct tmp51x_data *data)return 0 ; } -static int tmp51x_probe (struct i2c_client *client, -const struct i2c_device_id *id) +static int tmp51x_probe (struct i2c_client *client) {struct device *dev = &client->dev;struct tmp51x_data *data;@@ -724,7 +723,7 @@ static int tmp51x_probe(struct i2c_client *client,if (client->dev.of_node) data->id = (enum tmp51x_ids )device_get_match_data (&client->dev);else - data->id = id->driver_data; + data->id =i2c_match_id (tmp51x_id, client)->driver_data; ret =tmp51x_configure (dev, data);if (ret <0 ) {@@ -751,7 +750,7 @@ static int tmp51x_probe(struct i2c_client *client,if (IS_ERR (hwmon_dev))return PTR_ERR (hwmon_dev); -dev_dbg (dev,"power monitor %s\n" , id->name); +dev_dbg (dev,"power monitor %s\n" , client->name);return 0 ; }@@ -761,7 +760,7 @@ static struct i2c_driver tmp51x_driver = { .name = "tmp51x", .of_match_table = of_match_ptr(tmp51x_of_match), }, - .probe = tmp51x_probe, + .probe_new = tmp51x_probe, .id_table = tmp51x_id, };