Commit 49f20fc6 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Jonathan Cameron

iio: st_sensors: Use dev_get_platdata() to get platform_data

Use dev_get_platdata() to get the platform_data instead of
referencing it directly.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 3c50dee9
...@@ -1170,8 +1170,7 @@ EXPORT_SYMBOL(st_accel_get_settings); ...@@ -1170,8 +1170,7 @@ EXPORT_SYMBOL(st_accel_get_settings);
int st_accel_common_probe(struct iio_dev *indio_dev) int st_accel_common_probe(struct iio_dev *indio_dev)
{ {
struct st_sensor_data *adata = iio_priv(indio_dev); struct st_sensor_data *adata = iio_priv(indio_dev);
struct st_sensors_platform_data *pdata = struct st_sensors_platform_data *pdata = dev_get_platdata(adata->dev);
(struct st_sensors_platform_data *)adata->dev->platform_data;
struct iio_chan_spec *channels; struct iio_chan_spec *channels;
size_t channels_size; size_t channels_size;
int err; int err;
......
...@@ -44,7 +44,7 @@ static bool st_sensors_is_spi_3_wire(struct spi_device *spi) ...@@ -44,7 +44,7 @@ static bool st_sensors_is_spi_3_wire(struct spi_device *spi)
if (device_property_read_bool(dev, "spi-3wire")) if (device_property_read_bool(dev, "spi-3wire"))
return true; return true;
pdata = (struct st_sensors_platform_data *)dev->platform_data; pdata = dev_get_platdata(dev);
if (pdata && pdata->spi_3wire) if (pdata && pdata->spi_3wire)
return true; return true;
......
...@@ -683,8 +683,7 @@ EXPORT_SYMBOL(st_press_get_settings); ...@@ -683,8 +683,7 @@ EXPORT_SYMBOL(st_press_get_settings);
int st_press_common_probe(struct iio_dev *indio_dev) int st_press_common_probe(struct iio_dev *indio_dev)
{ {
struct st_sensor_data *press_data = iio_priv(indio_dev); struct st_sensor_data *press_data = iio_priv(indio_dev);
struct st_sensors_platform_data *pdata = struct st_sensors_platform_data *pdata = dev_get_platdata(press_data->dev);
(struct st_sensors_platform_data *)press_data->dev->platform_data;
int err; int err;
indio_dev->modes = INDIO_DIRECT_MODE; indio_dev->modes = INDIO_DIRECT_MODE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment