iio: proximity: vl53l0x: Fix return value check of wait_for_completion_timeout
authorMiaoqian Lin <linmq006@gmail.com>
Tue, 12 Apr 2022 06:42:09 +0000 (06:42 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Jun 2022 16:36:05 +0000 (18:36 +0200)
commit7c7bc8b82fffb361e1ccb48517c44bf6e259e4b5
treecb3e2380c759fae753b9836e4e569441ed729230
parent79f83f388ba302e13fb2c008e1deac7a748e9d33
iio: proximity: vl53l0x: Fix return value check of wait_for_completion_timeout

[ Upstream commit 50f2959113cb6756ffd73c4fedc712cf2661f711 ]

wait_for_completion_timeout() returns unsigned long not int.
It returns 0 if timed out, and positive if completed.
The check for <= 0 is ambiguous and should be == 0 here
indicating timeout which is the only error case.

Fixes: 3cef2e31b54b ("iio: proximity: vl53l0x: Add IRQ support")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Link: https://lore.kernel.org/r/20220412064210.10734-1-linmq006@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/iio/proximity/vl53l0x-i2c.c