forked from Minki/linux
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: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
parent
3c50dee995
commit
49f20fc6fe
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user