Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: light: vcnl4000: remove redundant check for proximity-near-level

The data->near_level variable is already assigned 0 during
devm_kzalloc(), therefore checking if the property is present and then
assigning it 0 is redundant. Remove the check for device tree property
and let it fail silently if it is missing or invalid.

Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Erikas Bitovtas <xerikasxx@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Erikas Bitovtas and committed by
Jonathan Cameron
5ec96d77 c4380f90

+1 -3
+1 -3
drivers/iio/light/vcnl4000.c
··· 2015 2015 dev_dbg(dev, "%s Ambient light/proximity sensor, Rev: %02x\n", 2016 2016 data->chip_spec->prod, data->rev); 2017 2017 2018 - if (device_property_read_u32(&client->dev, "proximity-near-level", 2019 - &data->near_level)) 2020 - data->near_level = 0; 2018 + device_property_read_u32(dev, "proximity-near-level", &data->near_level); 2021 2019 2022 2020 indio_dev->info = data->chip_spec->info; 2023 2021 indio_dev->channels = data->chip_spec->channels;