]> git.baikalelectronics.ru Git - kernel.git/commit
w1: omap-hdq: fix return value to be -1 if there is a timeout
authorH. Nikolaus Schaller <hns@goldelico.com>
Sat, 23 May 2020 17:32:55 +0000 (19:32 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 May 2020 10:18:49 +0000 (12:18 +0200)
commiteb66d5789981a2e03f723ade3735545cc0b49f2a
tree13e75ed339ab036f65f1935660c5ca0c7ae41079
parentf2a5612e0aef0933a087811e5e031d2ccaeae69f
w1: omap-hdq: fix return value to be -1 if there is a timeout

omap_w1_read_byte() should return -1 (or 0xff) in case of
error (e.g. missing battery).

The code accidentially overwrites the variable ret and not val,
which is returned. So it will return the initial value 0 instead
of -1.

Fixes: bd8162854865 ("w1: omap-hdq: Simplify driver with PM runtime autosuspend")
Cc: stable@vger.kernel.org # v5.6+
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
Link: https://lore.kernel.org/r/b2c2192b461fbb9b8e9bea4ad514a49557a7210b.1590255176.git.hns@goldelico.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/w1/masters/omap_hdq.c