On 2024/1/4 00:52, Andi Shyti wrote:
Hi Hans,
in case you are going to resend this series, you could think
about these improvements.
Ok, will think about all of these
Hans
On Fri, Dec 29, 2023 at 02:30:34PM +0800, Hans Hu wrote:
v4->v5:
add previous prototype 'static' for wmt_i2c_init().
please, put the changelog at the end of the commit log.
Where is the changelog from v1?
Tweaked a few formatting things:
rename wmt_i2c_dev to wmt_i2c, i2c_dev to i2c, etc.
Please just list the renames, you are not doing formatting
improvements here.
Signed-off-by: Hans Hu <hanshu-oc@xxxxxxxxxxx>
...
-static int wmt_i2c_wait_bus_not_busy(struct wmt_i2c_dev *i2c_dev)
+static int wmt_i2c_wait_bus_not_busy(struct wmt_i2c *i2c)
{
unsigned long timeout;
+ void __iomem *base = i2c->base;
this change and similar below, are not listed in the commit log.
timeout = jiffies + WMT_I2C_TIMEOUT;
- while (!(readw(i2c_dev->base + WMTI2C_REG_CSR) & WMTI2C_CSR_READY_MASK)) {
+ while (!(readw(base + WMTI2C_REG_CSR) & WMTI2C_CSR_READY_MASK)) {
if (time_after(jiffies, timeout)) {
- dev_warn(i2c_dev->dev, "timeout waiting for bus ready\n");
+ dev_warn(i2c->dev,
+ "timeout waiting for bus ready\n");
with /i2c_dev/i2c/ you don't need to break the line anymore (BTW,
now 100 character lines are allowed, however not encouraged).
return -EBUSY;
}
msleep(20);
...
- tcr_val |= (WMTI2C_TCR_MASTER_WRITE | (pmsg->addr & WMTI2C_TCR_SLAVE_ADDR_MASK));
+ tcr_val |= (WMTI2C_TCR_MASTER_WRITE
+ | (pmsg->addr & WMTI2C_TCR_SLAVE_ADDR_MASK));
this change is not listed in the commit log and please, remember,
the new 100 characters rule which makes these changes
unnecessary).
Andi