Skip to content

Commit

Permalink
iio:common: Set the device pointer into ST common sensors library
Browse files Browse the repository at this point in the history
Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
  • Loading branch information
Denis CIOCCA authored and Jonathan Cameron committed Oct 4, 2014
1 parent a1dcf42 commit 7be178b
Show file tree
Hide file tree
Showing 10 changed files with 2 additions and 8 deletions.
1 change: 0 additions & 1 deletion drivers/iio/accel/st_accel_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ static int st_accel_i2c_probe(struct i2c_client *client,
return -ENOMEM;

adata = iio_priv(indio_dev);
adata->dev = &client->dev;
st_sensors_of_i2c_probe(client, st_accel_of_match);

st_sensors_i2c_configure(indio_dev, client, adata);
Expand Down
1 change: 0 additions & 1 deletion drivers/iio/accel/st_accel_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ static int st_accel_spi_probe(struct spi_device *spi)
return -ENOMEM;

adata = iio_priv(indio_dev);
adata->dev = &spi->dev;

st_sensors_spi_configure(indio_dev, spi, adata);

Expand Down
1 change: 1 addition & 0 deletions drivers/iio/common/st_sensors/st_sensors_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ void st_sensors_i2c_configure(struct iio_dev *indio_dev,
indio_dev->dev.parent = &client->dev;
indio_dev->name = client->name;

sdata->dev = &client->dev;
sdata->tf = &st_sensors_tf_i2c;
sdata->get_irq_data_ready = st_sensors_i2c_get_irq;
}
Expand Down
1 change: 1 addition & 0 deletions drivers/iio/common/st_sensors/st_sensors_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ void st_sensors_spi_configure(struct iio_dev *indio_dev,
indio_dev->dev.parent = &spi->dev;
indio_dev->name = spi->modalias;

sdata->dev = &spi->dev;
sdata->tf = &st_sensors_tf_spi;
sdata->get_irq_data_ready = st_sensors_spi_get_irq;
}
Expand Down
1 change: 0 additions & 1 deletion drivers/iio/gyro/st_gyro_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ static int st_gyro_i2c_probe(struct i2c_client *client,
return -ENOMEM;

gdata = iio_priv(indio_dev);
gdata->dev = &client->dev;
st_sensors_of_i2c_probe(client, st_gyro_of_match);

st_sensors_i2c_configure(indio_dev, client, gdata);
Expand Down
1 change: 0 additions & 1 deletion drivers/iio/gyro/st_gyro_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ static int st_gyro_spi_probe(struct spi_device *spi)
return -ENOMEM;

gdata = iio_priv(indio_dev);
gdata->dev = &spi->dev;

st_sensors_spi_configure(indio_dev, spi, gdata);

Expand Down
1 change: 0 additions & 1 deletion drivers/iio/magnetometer/st_magn_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ static int st_magn_i2c_probe(struct i2c_client *client,
return -ENOMEM;

mdata = iio_priv(indio_dev);
mdata->dev = &client->dev;
st_sensors_of_i2c_probe(client, st_magn_of_match);

st_sensors_i2c_configure(indio_dev, client, mdata);
Expand Down
1 change: 0 additions & 1 deletion drivers/iio/magnetometer/st_magn_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ static int st_magn_spi_probe(struct spi_device *spi)
return -ENOMEM;

mdata = iio_priv(indio_dev);
mdata->dev = &spi->dev;

st_sensors_spi_configure(indio_dev, spi, mdata);

Expand Down
1 change: 0 additions & 1 deletion drivers/iio/pressure/st_pressure_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ static int st_press_i2c_probe(struct i2c_client *client,
return -ENOMEM;

press_data = iio_priv(indio_dev);
press_data->dev = &client->dev;
st_sensors_of_i2c_probe(client, st_press_of_match);

st_sensors_i2c_configure(indio_dev, client, press_data);
Expand Down
1 change: 0 additions & 1 deletion drivers/iio/pressure/st_pressure_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ static int st_press_spi_probe(struct spi_device *spi)
return -ENOMEM;

press_data = iio_priv(indio_dev);
press_data->dev = &spi->dev;

st_sensors_spi_configure(indio_dev, spi, press_data);

Expand Down

0 comments on commit 7be178b

Please sign in to comment.