]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
iio: light: vcnl4000: remove redundant check for proximity-near-level
authorErikas Bitovtas <xerikasxx@gmail.com>
Fri, 20 Mar 2026 16:45:42 +0000 (18:45 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 21 Mar 2026 12:40:30 +0000 (12:40 +0000)
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>
drivers/iio/light/vcnl4000.c

index 34b52725aff6453335579cd7b6328183e08359c1..0a4d82679cfecbc8816480ed2ae50664aecf4882 100644 (file)
@@ -2015,9 +2015,7 @@ static int vcnl4000_probe(struct i2c_client *client)
        dev_dbg(dev, "%s Ambient light/proximity sensor, Rev: %02x\n",
                data->chip_spec->prod, data->rev);
 
-       if (device_property_read_u32(&client->dev, "proximity-near-level",
-                                    &data->near_level))
-               data->near_level = 0;
+       device_property_read_u32(dev, "proximity-near-level", &data->near_level);
 
        indio_dev->info = data->chip_spec->info;
        indio_dev->channels = data->chip_spec->channels;