Skip to content

Commit 531db50

Browse files
Wolfram SangWolfram Sang
authored andcommitted
i2c: sh_mobile: define start_ch() void as it only returns 0 anyhow
After various refactoring over the years, start_ch() doesn't return errno anymore, so make the function return void. This saves the error handling when calling it which in turn eases cleanup of resources of a future patch. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
1 parent 82fe39a commit 531db50

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

drivers/i2c/busses/i2c-sh_mobile.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -602,8 +602,8 @@ static void sh_mobile_i2c_xfer_dma(struct sh_mobile_i2c_data *pd)
602602
dma_async_issue_pending(chan);
603603
}
604604

605-
static int start_ch(struct sh_mobile_i2c_data *pd, struct i2c_msg *usr_msg,
606-
bool do_init)
605+
static void start_ch(struct sh_mobile_i2c_data *pd, struct i2c_msg *usr_msg,
606+
bool do_init)
607607
{
608608
if (do_init) {
609609
/* Initialize channel registers */
@@ -627,7 +627,6 @@ static int start_ch(struct sh_mobile_i2c_data *pd, struct i2c_msg *usr_msg,
627627

628628
/* Enable all interrupts to begin with */
629629
iic_wr(pd, ICIC, ICIC_DTEE | ICIC_WAITE | ICIC_ALE | ICIC_TACKE);
630-
return 0;
631630
}
632631

633632
static int poll_dte(struct sh_mobile_i2c_data *pd)
@@ -698,9 +697,7 @@ static int sh_mobile_i2c_xfer(struct i2c_adapter *adapter,
698697
pd->send_stop = i == num - 1 || msg->flags & I2C_M_STOP;
699698
pd->stop_after_dma = false;
700699

701-
err = start_ch(pd, msg, do_start);
702-
if (err)
703-
break;
700+
start_ch(pd, msg, do_start);
704701

705702
if (do_start)
706703
i2c_op(pd, OP_START, 0);

0 commit comments

Comments
 (0)