]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
iio: proximity: vl53l0x-i2c: Fix error code in probe()
authorDan Carpenter <dan.carpenter@linaro.org>
Tue, 19 Aug 2025 15:02:53 +0000 (18:02 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 25 Aug 2025 08:24:19 +0000 (09:24 +0100)
commitd20a8a8ecdb7c3807bdd738338930f0796678cd4
treef47dc6ec1f1ce793f01b20473565595dc30f6627
parent788c57f4766bd5802af9918ea350053a91488c60
iio: proximity: vl53l0x-i2c: Fix error code in probe()

Commit 65e8202f0322 ("iio: Remove error prints for
devm_add_action_or_reset()") accidentally introduced a bug where we
returned "ret" but the error code was stored in "error" if
devm_add_action_or_reset() failed.  Using two variables to store error
codes is unnecessary and confusing.  Delete the "error" variable and use
"ret" everywhere instead.

Fixes: 65e8202f0322 ("iio: Remove error prints for devm_add_action_or_reset()")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://patch.msgid.link/aKSSHTdJf5QoYiRx@stanley.mountain
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/proximity/vl53l0x-i2c.c