Skip to content

Commit 3575281

Browse files
andy-shevjic23
authored andcommitted
iio: accel: st_accel: Use st_sensors_dev_name_probe()
Use st_sensors_dev_name_probe() instead open coded variant. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
1 parent a8cf172 commit 3575281

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

drivers/iio/accel/st_accel_i2c.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,9 @@ static int st_accel_i2c_probe(struct i2c_client *client)
147147
const struct st_sensor_settings *settings;
148148
struct st_sensor_data *adata;
149149
struct iio_dev *indio_dev;
150-
const char *match;
151150
int ret;
152151

153-
match = device_get_match_data(&client->dev);
154-
if (match)
155-
strlcpy(client->name, match, sizeof(client->name));
152+
st_sensors_dev_name_probe(&client->dev, client->name, sizeof(client->name));
156153

157154
settings = st_accel_get_settings(client->name);
158155
if (!settings) {

0 commit comments

Comments
 (0)