Commit 9909a395 authored by Colin Ian King's avatar Colin Ian King Committed by Jonathan Cameron

iio: adc: rzg2l_adc: Fix -EBUSY timeout error return

Currently when a timeout occurs in rzg2l_adc_hw_init the error -EBUSY is
assigned to ret but the error code is used as the function is hard-coded
to return 0.  The variable ret is 0 before entering the while-loop hence
the fix is just to return ret at the end of the function to return the
success 0 or -EBUSY return code.

Addresses-Coverity: ("Unused value")
Fixes: d484c21b ("iio: adc: Add driver for Renesas RZ/G2L A/D converter")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Reviewed-by: default avatarLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Link: https://lore.kernel.org/r/20210817172111.495897-1-colin.king@canonical.comSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 9033c7a3
......@@ -401,7 +401,7 @@ static int rzg2l_adc_hw_init(struct rzg2l_adc *adc)
exit_hw_init:
clk_disable_unprepare(adc->pclk);
return 0;
return ret;
}
static void rzg2l_adc_pm_runtime_disable(void *data)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment