w1: omap-hdq: fix return value to be -1 if there is a timeout
commitd7603a157a0953f43a6d41d57a7f1be829b212f0
authorH. Nikolaus Schaller <hns@goldelico.com>
Sat, 23 May 2020 17:32:55 +0000 (23 19:32 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 22 Jun 2020 07:33:11 +0000 (22 09:33 +0200)
tree0b0d002295964f6b5e51103c0bdbbb0aeda3b7e0
parentde45e00848a262fec5a56ddcac2874d725237276
w1: omap-hdq: fix return value to be -1 if there is a timeout

commit 2d4100632fa1947bf3e8d7a091e94e2cf21923af upstream.

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: 27d13da8782a ("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