Re: [PATCH v2 6/6] i2c: pasemi: Log bus reset causes

Andi Shyti
2025-04-17T13:10:41Z

Hi Sven,

...

> static int pasemi_smb_clear(struct pasemi_smbus *smbus)
> {
> - unsigned int status;
> + unsigned int status, xfstatus;

Let's declare the variables in the innermost scope where they are
used.

Andi

> int ret;
>
> /* First wait for the bus to go idle */
> @@ -98,7 +99,9 @@ static int pasemi_smb_clear(struct pasemi_smbus *smbus)
> USEC_PER_MSEC, USEC_PER_MSEC * TRANSFER_TIMEOUT_MS);
>
> if (ret < 0) {
> - dev_err(smbus->dev, "Bus is still stuck (status 0x%08x)\n", status);
> + xfstatus = reg_read(smbus, REG_XFSTA);
> + dev_err(smbus->dev, "Bus is still stuck (status 0x%08x xfstatus 0x%08x)\n",
> + status, xfstatus);
> return -EIO;
> }
>
>
> --
> 2.34.1
>