Skip to content
Snippets Groups Projects
Commit 059fce9f authored by mario.six@gdsys.cc's avatar mario.six@gdsys.cc Committed by Heiko Schocher
Browse files

i2c: mvtwsi: Get rid of status parameter


The twsi_stop function contains a parameter "status," which is used to
pass in the current exit status of the function calling twsi_stop, and
either return this status unchanged if it indicates an error, or return
twsi_stop's exit status if it does not indicate an error.

While not massively complicated, this adds another purpose to the
twsi_stop function, which should have the sole purpose of asserting a
STOP condition on the bus (and not manage the exit status of its
caller).

Therefore, we move the exit status management into the caller functions
by introducing a "stop_status" variable and returning either the status
before the twsi_stop call (kept in the "status" variable), or the status
from the twsi_stop call, depending on which indicates an error.

Signed-off-by: default avatarMario Six <mario.six@gdsys.cc>
Reviewed-by: default avatarStefan Roese <sr@denx.de>
parent 670514f5
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment