All state machines deal with pd->pos values. This helper function is an
exception and makes it only more confusing.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
return ret;
}
-static bool sh_mobile_i2c_is_first_byte(struct sh_mobile_i2c_data *pd)
-{
- return pd->pos == -1;
-}
-
static int sh_mobile_i2c_isr_tx(struct sh_mobile_i2c_data *pd)
{
if (pd->pos == pd->msg->len) {
return 1;
}
- if (sh_mobile_i2c_is_first_byte(pd))
+ if (pd->pos == -1)
i2c_op(pd, OP_TX_FIRST);
else
i2c_op(pd, OP_TX);
int real_pos;
do {
- if (sh_mobile_i2c_is_first_byte(pd)) {
+ if (pd->pos == -1) {
i2c_op(pd, OP_TX_FIRST);
break;
}