Skip to content

Commit

Permalink
bus: ti-sysc: Fix error handling for sysc_check_active_timer()
Browse files Browse the repository at this point in the history
[ Upstream commit 06a089e ]

We have changed the return type for sysc_check_active_timer() from -EBUSY
to -ENXIO, but the gpt12 system timer fix still checks for -EBUSY. We are
also not returning on other errors like we did earlier as noted by
Pavel Machek <pavel@denx.de>.

Commit 3ff340e ("bus: ti-sysc: Fix gpt12 system timer issue with
reserved status") should have been updated for commit 65fb736
("bus: ti-sysc: suppress err msg for timers used as clockevent/source").

Let's fix the issue by checking for -ENXIO and returning on any other
errors as suggested by Pavel Machek <pavel@denx.de>.

Fixes: 3ff340e ("bus: ti-sysc: Fix gpt12 system timer issue with reserved status")
Depends-on: 65fb736 ("bus: ti-sysc: suppress err msg for timers used as clockevent/source")
Reported-by: Pavel Machek <pavel@denx.de>
Reviewed-by: Pavel Machek (CIP) <pavel@denx.de>
Cc: Grygorii Strashko <grygorii.strashko@ti.com>
Cc: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
tmlind authored and Sasha Levin committed Aug 26, 2021
1 parent 1af7ccb commit e0b603c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/bus/ti-sysc.c
Expand Up @@ -3061,8 +3061,10 @@ static int sysc_probe(struct platform_device *pdev)
return error;

error = sysc_check_active_timer(ddata);
if (error == -EBUSY)
if (error == -ENXIO)
ddata->reserved = true;
else if (error)
return error;

error = sysc_get_clocks(ddata);
if (error)
Expand Down

0 comments on commit e0b603c

Please sign in to comment.