lkml.org 
[lkml]   [2021]   [Jan]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V7 2/2] i2c: i2c-qcom-geni: Add shutdown callback for i2c

> + geni_status = readl_relaxed(gi2c->se.base + SE_GENI_STATUS);
> + if (!(geni_status & M_GENI_CMD_ACTIVE))
> + goto out;
> +
> + cur = gi2c->cur;
> + geni_i2c_abort_xfer(gi2c);
> + if (cur->flags & I2C_M_RD)
> + geni_i2c_rx_msg_cleanup(gi2c, cur);
> + else
> + geni_i2c_tx_msg_cleanup(gi2c, cur);
> +out:
> + pm_runtime_put_sync_suspend(gi2c->se.dev);
> +}

The use of 'goto' is not needed here IMHO. I think:

if (geni_status & M_GENI_CMD_ACTIVE) {
do_the_stuff
}

pm_runtime_put_sync_suspend(...);

is more readable, in fact. Also, I don't think we really need the 'cur'
variable and just use 'gi2c->cur' but that's very minor and you can keep
it if you like it.

Reset looks good!

[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2021-01-05 16:28    [W:0.152 / U:0.424 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site