diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-03-28 14:33:37 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-03-28 14:33:37 +0300 |
commit | a0306db6e5758b0488c79e739de3c0ffe47ea62f (patch) | |
tree | 86d17769496f96554f89bfc3be02b645a420889f /drivers/iio/accel | |
parent | 4bc07aa4f030d4d3e551ce8d96ca15b6424a5641 (diff) | |
parent | 3eb2ce825ea1ad89d20f7a3b5780df850e4be274 (diff) | |
download | linux-a0306db6e5758b0488c79e739de3c0ffe47ea62f.tar.xz |
Merge 4.16-rc7 into staging-next
We want the IIO and staging driver fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/iio/accel')
-rw-r--r-- | drivers/iio/accel/st_accel_core.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/iio/accel/st_accel_core.c b/drivers/iio/accel/st_accel_core.c index 6fe995cf16a6..3e6fd5a8ac5b 100644 --- a/drivers/iio/accel/st_accel_core.c +++ b/drivers/iio/accel/st_accel_core.c @@ -920,6 +920,8 @@ static const struct iio_trigger_ops st_accel_trigger_ops = { int st_accel_common_probe(struct iio_dev *indio_dev) { struct st_sensor_data *adata = iio_priv(indio_dev); + struct st_sensors_platform_data *pdata = + (struct st_sensors_platform_data *)adata->dev->platform_data; int irq = adata->get_irq_data_ready(indio_dev); int err; @@ -946,7 +948,10 @@ int st_accel_common_probe(struct iio_dev *indio_dev) &adata->sensor_settings->fs.fs_avl[0]; adata->odr = adata->sensor_settings->odr.odr_avl[0].hz; - err = st_sensors_init_sensor(indio_dev, adata->dev->platform_data); + if (!pdata) + pdata = (struct st_sensors_platform_data *)&default_accel_pdata; + + err = st_sensors_init_sensor(indio_dev, pdata); if (err < 0) goto st_accel_power_off; |