Commit 1f38527d authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Jonathan Cameron

iio: st_sensors: Drop unneeded explicit castings

In few places the unnecessary explicit castings are being used.
Drop them for good.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 49f20fc6
...@@ -37,8 +37,7 @@ static int st_accel_buffer_postenable(struct iio_dev *indio_dev) ...@@ -37,8 +37,7 @@ static int st_accel_buffer_postenable(struct iio_dev *indio_dev)
if (err < 0) if (err < 0)
return err; return err;
err = st_sensors_set_axis_enable(indio_dev, err = st_sensors_set_axis_enable(indio_dev, indio_dev->active_scan_mask[0]);
(u8)indio_dev->active_scan_mask[0]);
if (err < 0) if (err < 0)
goto st_accel_buffer_predisable; goto st_accel_buffer_predisable;
......
...@@ -1203,8 +1203,7 @@ int st_accel_common_probe(struct iio_dev *indio_dev) ...@@ -1203,8 +1203,7 @@ int st_accel_common_probe(struct iio_dev *indio_dev)
"failed to apply ACPI orientation data: %d\n", err); "failed to apply ACPI orientation data: %d\n", err);
indio_dev->channels = channels; indio_dev->channels = channels;
adata->current_fullscale = (struct st_sensor_fullscale_avl *) adata->current_fullscale = &adata->sensor_settings->fs.fs_avl[0];
&adata->sensor_settings->fs.fs_avl[0];
adata->odr = adata->sensor_settings->odr.odr_avl[0].hz; adata->odr = adata->sensor_settings->odr.odr_avl[0].hz;
if (!pdata) if (!pdata)
......
...@@ -150,8 +150,7 @@ static int st_sensors_set_fullscale(struct iio_dev *indio_dev, unsigned int fs) ...@@ -150,8 +150,7 @@ static int st_sensors_set_fullscale(struct iio_dev *indio_dev, unsigned int fs)
if (err < 0) if (err < 0)
goto st_accel_set_fullscale_error; goto st_accel_set_fullscale_error;
sdata->current_fullscale = (struct st_sensor_fullscale_avl *) sdata->current_fullscale = &sdata->sensor_settings->fs.fs_avl[i];
&sdata->sensor_settings->fs.fs_avl[i];
return err; return err;
st_accel_set_fullscale_error: st_accel_set_fullscale_error:
......
...@@ -37,8 +37,7 @@ static int st_gyro_buffer_postenable(struct iio_dev *indio_dev) ...@@ -37,8 +37,7 @@ static int st_gyro_buffer_postenable(struct iio_dev *indio_dev)
if (err < 0) if (err < 0)
return err; return err;
err = st_sensors_set_axis_enable(indio_dev, err = st_sensors_set_axis_enable(indio_dev, indio_dev->active_scan_mask[0]);
(u8)indio_dev->active_scan_mask[0]);
if (err < 0) if (err < 0)
goto st_gyro_buffer_predisable; goto st_gyro_buffer_predisable;
......
...@@ -460,6 +460,7 @@ EXPORT_SYMBOL(st_gyro_get_settings); ...@@ -460,6 +460,7 @@ EXPORT_SYMBOL(st_gyro_get_settings);
int st_gyro_common_probe(struct iio_dev *indio_dev) int st_gyro_common_probe(struct iio_dev *indio_dev)
{ {
struct st_sensor_data *gdata = iio_priv(indio_dev); struct st_sensor_data *gdata = iio_priv(indio_dev);
struct st_sensors_platform_data *pdata;
int err; int err;
indio_dev->modes = INDIO_DIRECT_MODE; indio_dev->modes = INDIO_DIRECT_MODE;
...@@ -477,12 +478,12 @@ int st_gyro_common_probe(struct iio_dev *indio_dev) ...@@ -477,12 +478,12 @@ int st_gyro_common_probe(struct iio_dev *indio_dev)
indio_dev->channels = gdata->sensor_settings->ch; indio_dev->channels = gdata->sensor_settings->ch;
indio_dev->num_channels = ST_SENSORS_NUMBER_ALL_CHANNELS; indio_dev->num_channels = ST_SENSORS_NUMBER_ALL_CHANNELS;
gdata->current_fullscale = (struct st_sensor_fullscale_avl *) gdata->current_fullscale = &gdata->sensor_settings->fs.fs_avl[0];
&gdata->sensor_settings->fs.fs_avl[0];
gdata->odr = gdata->sensor_settings->odr.odr_avl[0].hz; gdata->odr = gdata->sensor_settings->odr.odr_avl[0].hz;
err = st_sensors_init_sensor(indio_dev, pdata = (struct st_sensors_platform_data *)&gyro_pdata;
(struct st_sensors_platform_data *)&gyro_pdata);
err = st_sensors_init_sensor(indio_dev, pdata);
if (err < 0) if (err < 0)
goto st_gyro_power_off; goto st_gyro_power_off;
......
...@@ -506,8 +506,7 @@ int st_magn_common_probe(struct iio_dev *indio_dev) ...@@ -506,8 +506,7 @@ int st_magn_common_probe(struct iio_dev *indio_dev)
indio_dev->channels = mdata->sensor_settings->ch; indio_dev->channels = mdata->sensor_settings->ch;
indio_dev->num_channels = ST_SENSORS_NUMBER_ALL_CHANNELS; indio_dev->num_channels = ST_SENSORS_NUMBER_ALL_CHANNELS;
mdata->current_fullscale = (struct st_sensor_fullscale_avl *) mdata->current_fullscale = &mdata->sensor_settings->fs.fs_avl[0];
&mdata->sensor_settings->fs.fs_avl[0];
mdata->odr = mdata->sensor_settings->odr.odr_avl[0].hz; mdata->odr = mdata->sensor_settings->odr.odr_avl[0].hz;
err = st_sensors_init_sensor(indio_dev, NULL); err = st_sensors_init_sensor(indio_dev, NULL);
......
...@@ -707,9 +707,7 @@ int st_press_common_probe(struct iio_dev *indio_dev) ...@@ -707,9 +707,7 @@ int st_press_common_probe(struct iio_dev *indio_dev)
indio_dev->channels = press_data->sensor_settings->ch; indio_dev->channels = press_data->sensor_settings->ch;
indio_dev->num_channels = press_data->sensor_settings->num_ch; indio_dev->num_channels = press_data->sensor_settings->num_ch;
press_data->current_fullscale = press_data->current_fullscale = &press_data->sensor_settings->fs.fs_avl[0];
(struct st_sensor_fullscale_avl *)
&press_data->sensor_settings->fs.fs_avl[0];
press_data->odr = press_data->sensor_settings->odr.odr_avl[0].hz; press_data->odr = press_data->sensor_settings->odr.odr_avl[0].hz;
......
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