diff options
Diffstat (limited to 'drivers/iio/accel')
-rw-r--r-- | drivers/iio/accel/st_accel.h | 3 | ||||
-rw-r--r-- | drivers/iio/accel/st_accel_core.c | 22 | ||||
-rw-r--r-- | drivers/iio/accel/st_accel_i2c.c | 3 | ||||
-rw-r--r-- | drivers/iio/accel/st_accel_spi.c | 3 |
4 files changed, 14 insertions, 17 deletions
diff --git a/drivers/iio/accel/st_accel.h b/drivers/iio/accel/st_accel.h index c3877630b2e4..fa9646034305 100644 --- a/drivers/iio/accel/st_accel.h +++ b/drivers/iio/accel/st_accel.h @@ -33,8 +33,7 @@ static const struct st_sensors_platform_data default_accel_pdata = { .drdy_int_pin = 1, }; -int st_accel_common_probe(struct iio_dev *indio_dev, - struct st_sensors_platform_data *pdata); +int st_accel_common_probe(struct iio_dev *indio_dev); void st_accel_common_remove(struct iio_dev *indio_dev); #ifdef CONFIG_IIO_BUFFER diff --git a/drivers/iio/accel/st_accel_core.c b/drivers/iio/accel/st_accel_core.c index 087864854c61..53f32629283a 100644 --- a/drivers/iio/accel/st_accel_core.c +++ b/drivers/iio/accel/st_accel_core.c @@ -161,7 +161,7 @@ static const struct iio_chan_spec st_accel_16bit_channels[] = { IIO_CHAN_SOFT_TIMESTAMP(3) }; -static const struct st_sensors st_accel_sensors[] = { +static const struct st_sensor_settings st_accel_sensors_settings[] = { { .wai = ST_ACCEL_1_WAI_EXP, .sensors_supported = { @@ -457,8 +457,7 @@ static const struct iio_trigger_ops st_accel_trigger_ops = { #define ST_ACCEL_TRIGGER_OPS NULL #endif -int st_accel_common_probe(struct iio_dev *indio_dev, - struct st_sensors_platform_data *plat_data) +int st_accel_common_probe(struct iio_dev *indio_dev) { struct st_sensor_data *adata = iio_priv(indio_dev); int irq = adata->get_irq_data_ready(indio_dev); @@ -470,24 +469,25 @@ int st_accel_common_probe(struct iio_dev *indio_dev, st_sensors_power_enable(indio_dev); err = st_sensors_check_device_support(indio_dev, - ARRAY_SIZE(st_accel_sensors), st_accel_sensors); + ARRAY_SIZE(st_accel_sensors_settings), + st_accel_sensors_settings); if (err < 0) return err; adata->num_data_channels = ST_ACCEL_NUMBER_DATA_CHANNELS; - adata->multiread_bit = adata->sensor->multi_read_bit; - indio_dev->channels = adata->sensor->ch; + adata->multiread_bit = adata->sensor_settings->multi_read_bit; + indio_dev->channels = adata->sensor_settings->ch; indio_dev->num_channels = ST_SENSORS_NUMBER_ALL_CHANNELS; adata->current_fullscale = (struct st_sensor_fullscale_avl *) - &adata->sensor->fs.fs_avl[0]; - adata->odr = adata->sensor->odr.odr_avl[0].hz; + &adata->sensor_settings->fs.fs_avl[0]; + adata->odr = adata->sensor_settings->odr.odr_avl[0].hz; - if (!plat_data) - plat_data = + if (!adata->dev->platform_data) + adata->dev->platform_data = (struct st_sensors_platform_data *)&default_accel_pdata; - err = st_sensors_init_sensor(indio_dev, plat_data); + err = st_sensors_init_sensor(indio_dev, adata->dev->platform_data); if (err < 0) return err; diff --git a/drivers/iio/accel/st_accel_i2c.c b/drivers/iio/accel/st_accel_i2c.c index 7164aeff3ab1..c7246bdd30b9 100644 --- a/drivers/iio/accel/st_accel_i2c.c +++ b/drivers/iio/accel/st_accel_i2c.c @@ -79,12 +79,11 @@ 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); - err = st_accel_common_probe(indio_dev, client->dev.platform_data); + err = st_accel_common_probe(indio_dev); if (err < 0) return err; diff --git a/drivers/iio/accel/st_accel_spi.c b/drivers/iio/accel/st_accel_spi.c index 195639646e34..12ec29389e4b 100644 --- a/drivers/iio/accel/st_accel_spi.c +++ b/drivers/iio/accel/st_accel_spi.c @@ -29,11 +29,10 @@ 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); - err = st_accel_common_probe(indio_dev, spi->dev.platform_data); + err = st_accel_common_probe(indio_dev); if (err < 0) return err; |