summaryrefslogtreecommitdiff
path: root/drivers/i2c/busses/i2c-sh_mobile.c
diff options
context:
space:
mode:
authorWolfram Sang <wsa+renesas@sang-engineering.com>2019-01-17 00:05:52 +0300
committerWolfram Sang <wsa@the-dreams.de>2019-01-23 02:18:08 +0300
commite659f36d46904b5e0e860401c0454fcf6025f419 (patch)
treec880c4d269a991c894068d87b2c7a93975d27b0d /drivers/i2c/busses/i2c-sh_mobile.c
parentd16f2bfea3cc3ebc8d1d45bc24d4f9f2c852dddd (diff)
downloadlinux-e659f36d46904b5e0e860401c0454fcf6025f419.tar.xz
i2c: sh_mobile: remove is_first_byte function
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>
Diffstat (limited to 'drivers/i2c/busses/i2c-sh_mobile.c')
-rw-r--r--drivers/i2c/busses/i2c-sh_mobile.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/i2c/busses/i2c-sh_mobile.c b/drivers/i2c/busses/i2c-sh_mobile.c
index ae5804c12998..ef9101cde29f 100644
--- a/drivers/i2c/busses/i2c-sh_mobile.c
+++ b/drivers/i2c/busses/i2c-sh_mobile.c
@@ -352,11 +352,6 @@ static unsigned char i2c_op(struct sh_mobile_i2c_data *pd, enum sh_mobile_i2c_op
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) {
@@ -364,7 +359,7 @@ static int sh_mobile_i2c_isr_tx(struct sh_mobile_i2c_data *pd)
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);
@@ -379,7 +374,7 @@ static int sh_mobile_i2c_isr_rx(struct sh_mobile_i2c_data *pd)
int real_pos;
do {
- if (sh_mobile_i2c_is_first_byte(pd)) {
+ if (pd->pos == -1) {
i2c_op(pd, OP_TX_FIRST);
break;
}