From: Erikas Bitovtas Date: Fri, 20 Mar 2026 16:45:42 +0000 (+0200) Subject: iio: light: vcnl4000: remove redundant check for proximity-near-level X-Git-Tag: v7.1-rc1~17^2~120^2~62 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5ec96d77ca28c0560e8883a0709ab63667eac19f;p=thirdparty%2Fkernel%2Fstable.git 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 Signed-off-by: Erikas Bitovtas Reviewed-by: Andy Shevchenko Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/light/vcnl4000.c b/drivers/iio/light/vcnl4000.c index 34b52725aff64..0a4d82679cfec 100644 --- a/drivers/iio/light/vcnl4000.c +++ b/drivers/iio/light/vcnl4000.c @@ -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;