Skip to content

Commit 9ad241c

Browse files
javiercarrascocruzjic23
authored andcommitted
iio: light: veml6030: remove unnecessary read of IT index
This is dead code as the IT index is not used by gts to set the new scale. In its current form, the value is read but not used afterward. Remove the dead code. Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
1 parent 43a66ca commit 9ad241c

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

drivers/iio/light/veml6030.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -521,13 +521,9 @@ static int veml6030_write_persistence(struct iio_dev *indio_dev,
521521

522522
static int veml6030_set_scale(struct iio_dev *indio_dev, int val, int val2)
523523
{
524-
int ret, gain_sel, it_idx, it_sel;
524+
int ret, gain_sel, it_sel;
525525
struct veml6030_data *data = iio_priv(indio_dev);
526526

527-
ret = regmap_field_read(data->rf.it, &it_idx);
528-
if (ret)
529-
return ret;
530-
531527
ret = iio_gts_find_gain_time_sel_for_scale(&data->gts, val, val2,
532528
&gain_sel, &it_sel);
533529
if (ret)

0 commit comments

Comments
 (0)