Skip to content

Commit 279c83d

Browse files
prabhakarladWolfram Sang
authored andcommitted
i2c: riic: Use local dev pointer in dev_err_probe()
Update the `riic_init_hw()` function to use the local `dev` pointer in calls to `dev_err_probe()`. Previously, `riic_init_hw()` used `riic->adapter.dev` in error reporting. Since this function is invoked during the probe phase, the I2C adapter is not yet initialized, leading to `(null) ...` being printed in error messages. This patch fixes the issue by consistently using the local `dev` pointer, which points to `riic->adapter.dev.parent`. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Tested-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> Reviewed-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> Reviewed-by: Andy Shevchenko <andy@kernel.org> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
1 parent e2aa250 commit 279c83d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/i2c/busses/i2c-riic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ static int riic_init_hw(struct riic_dev *riic)
320320
: I2C_MAX_FAST_MODE_FREQ;
321321

322322
if (t->bus_freq_hz > max_freq)
323-
return dev_err_probe(&riic->adapter.dev, -EINVAL,
323+
return dev_err_probe(dev, -EINVAL,
324324
"unsupported bus speed %uHz (%u max)\n",
325325
t->bus_freq_hz, max_freq);
326326

0 commit comments

Comments
 (0)