iio:common: Set the device pointer into ST common sensors library
authorDenis CIOCCA <denis.ciocca@st.com>
Fri, 3 Oct 2014 15:35:41 +0000 (17:35 +0200)
committerJonathan Cameron <jic23@kernel.org>
Sat, 4 Oct 2014 10:26:21 +0000 (11:26 +0100)
Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/accel/st_accel_i2c.c
drivers/iio/accel/st_accel_spi.c
drivers/iio/common/st_sensors/st_sensors_i2c.c
drivers/iio/common/st_sensors/st_sensors_spi.c
drivers/iio/gyro/st_gyro_i2c.c
drivers/iio/gyro/st_gyro_spi.c
drivers/iio/magnetometer/st_magn_i2c.c
drivers/iio/magnetometer/st_magn_spi.c
drivers/iio/pressure/st_pressure_i2c.c
drivers/iio/pressure/st_pressure_spi.c

index 40adc7e88a39ee4873057c3ace809a557868eebb..c7246bdd30b9532b2d4a8eea6910f532666731b5 100644 (file)
@@ -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);
index 2090d80062d2d59e1d44f0acd857144762fcaa8f..12ec29389e4ba15c794d3aaa74df3c5c917d3cee 100644 (file)
@@ -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);
 
index bb6f3085f57bdd55314b7f469ab21ade801c6a4f..98cfee296d4622f92119b44af2fd3b1b0e59f8fc 100644 (file)
@@ -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;
 }
index 251baf6abc2522138a838bc8c3ada1b1a2a8b607..78a6a1ab3ece00a51fa0f84ac0905762aede99d6 100644 (file)
@@ -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;
 }
index 94d01fba4a4cabdfdc5bf08a4d5d575e175755aa..64480b16c6895373c626b47d250c17500cc03311 100644 (file)
@@ -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);
index 3e7a01af9b610ef1425e59eaedf67ea8cbcf8c3d..e59bead6bc3cb2fa8ba5a3cf2e34851cad20a33f 100644 (file)
@@ -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);
 
index f8a682374239d942bdb88e2b7f19e3908a49514f..92e5c15452a3e4b0beb21d5a4f231ee8e3d79361 100644 (file)
@@ -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);
index f64214237cf612d63e3e6de3d77f7bd8f786d5fd..7adacf160146eba9af2e4f9034f064729a8e966d 100644 (file)
@@ -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);
 
index 8859e93e6dc6f14d4fb1b1a194ada4a59cd2d887..137788bba4a322a772f517a2348f165be24a8400 100644 (file)
@@ -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);
index 10c96245f12a6a8b85333c7a2a8fd145eeac8624..1ffa6d4d349c1462f4326a6af3738b1fc3e9828a 100644 (file)
@@ -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);