]> git.ipfire.org Git - people/ms/u-boot.git/commit - drivers/i2c/mvtwsi.c
i2c: mvtwsi: Get rid of status parameter
authormario.six@gdsys.cc <mario.six@gdsys.cc>
Thu, 21 Jul 2016 09:57:05 +0000 (11:57 +0200)
committerHeiko Schocher <hs@denx.de>
Tue, 26 Jul 2016 08:19:35 +0000 (10:19 +0200)
commit059fce9f61fd81ab67555b9ba87e12cc4b8db8f6
treeb3ff2e03cde622610336b8d47d20c28c9e6f3dc7
parent670514f52479cd1e0ae7952f45fef5779719aef2
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: Mario Six <mario.six@gdsys.cc>
Reviewed-by: Stefan Roese <sr@denx.de>
drivers/i2c/mvtwsi.c