]> git.baikalelectronics.ru Git - kernel.git/commitdiff
iio: st_sensors: Use dev_get_platdata() to get platform_data
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 13 Mar 2020 10:49:49 +0000 (12:49 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 21 Mar 2020 10:26:10 +0000 (10:26 +0000)
Use dev_get_platdata() to get the platform_data instead of
referencing it directly.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/accel/st_accel_core.c
drivers/iio/common/st_sensors/st_sensors_spi.c
drivers/iio/pressure/st_pressure_core.c

index 7320275c7e56dee7ee0a6bb3af4461dc0c9826ab..5f7bdb1f55d16d0ce4137e2321094037ebceaa03 100644 (file)
@@ -1170,8 +1170,7 @@ EXPORT_SYMBOL(st_accel_get_settings);
 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;
+       struct st_sensors_platform_data *pdata = dev_get_platdata(adata->dev);
        struct iio_chan_spec *channels;
        size_t channels_size;
        int err;
index 1275fb0eda3185de7d4e38cef1f66bf31eaa1400..dcbdef4a77f835969e5d7c6cbabcbfbe572fdf60 100644 (file)
@@ -44,7 +44,7 @@ static bool st_sensors_is_spi_3_wire(struct spi_device *spi)
        if (device_property_read_bool(dev, "spi-3wire"))
                return true;
 
-       pdata = (struct st_sensors_platform_data *)dev->platform_data;
+       pdata = dev_get_platdata(dev);
        if (pdata && pdata->spi_3wire)
                return true;
 
index bd972cec48302719759017fdb9767b67b1f80388..8bb47c3b4d6b3c737890dd16120dfd221fbb00c4 100644 (file)
@@ -683,8 +683,7 @@ EXPORT_SYMBOL(st_press_get_settings);
 int st_press_common_probe(struct iio_dev *indio_dev)
 {
        struct st_sensor_data *press_data = iio_priv(indio_dev);
-       struct st_sensors_platform_data *pdata =
-               (struct st_sensors_platform_data *)press_data->dev->platform_data;
+       struct st_sensors_platform_data *pdata = dev_get_platdata(press_data->dev);
        int err;
 
        indio_dev->modes = INDIO_DIRECT_MODE;