iio: common: st_sensors: move st_sensors_of_i2c_probe() in common code

Move st_sensors_of_i2c_probe() in st_sensors_core and rename it in
st_sensors_of_name_probe(). That change is necessary to add device-tree
support in spi code otherwise the rest of the autodetection will fail
since spi->modalias (and indio_dev->name) will be set using compatible
string value that differs from standard sensor name

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
这个提交包含在:
Lorenzo Bianconi
2017-06-20 21:52:08 +02:00
提交者 Jonathan Cameron
父节点 1371856416
当前提交 250bbbdbed
修改 8 个文件,包含 51 行新增43 行删除

查看文件

@@ -75,7 +75,8 @@ static int st_gyro_i2c_probe(struct i2c_client *client,
return -ENOMEM;
gdata = iio_priv(indio_dev);
st_sensors_of_i2c_probe(client, st_gyro_of_match);
st_sensors_of_name_probe(&client->dev, st_gyro_of_match,
client->name, sizeof(client->name));
st_sensors_i2c_configure(indio_dev, client, gdata);