Re: [PATCH v2 2/9] i2c: riic: Use local `dev` pointer in `dev_err_probe()`

Andi Shyti
2024-12-19T12:21:45Z

Hi Prabhakar,

> diff --git a/drivers/i2c/busses/i2c-riic.c b/drivers/i2c/busses/i2c-riic.c
> index bfaa2d728a76..01195ffd4c07 100644
> --- a/drivers/i2c/busses/i2c-riic.c
> +++ b/drivers/i2c/busses/i2c-riic.c
> @@ -320,7 +320,7 @@ static int riic_init_hw(struct riic_dev *riic)
> : I2C_MAX_FAST_MODE_FREQ;
>
> if (t->bus_freq_hz > max_freq)
> - return dev_err_probe(&riic->adapter.dev, -EINVAL,
> + return dev_err_probe(dev, -EINVAL,
> "unsupported bus speed %uHz (%u max)\n",
> t->bus_freq_hz, max_freq);

Which branch are you on? This change has already been introduced
in commit 71dacb2565ed ("i2c: riic: Simplify unsupported bus
speed handling")

>
> @@ -356,11 +356,9 @@ static int riic_init_hw(struct riic_dev *riic)
> rate /= 2;
> }
>
> - if (brl > (0x1F + 3)) {
> - dev_err(&riic->adapter.dev, "invalid speed (%lu). Too slow.\n",
> - (unsigned long)t->bus_freq_hz);
> - return -EINVAL;
> - }
> + if (brl > (0x1F + 3))
> + return dev_err_probe(dev, -EINVAL, "invalid speed (%lu). Too slow.\n",
> + (unsigned long)t->bus_freq_hz);

This is OK

Thanks,
Andi

>
> brh = total_ticks - brl;
>
> --
> 2.43.0
>