]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
i2c: riic: Use local `dev` pointer in `dev_err_probe()`
authorLad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Mon, 13 Jan 2025 12:26:36 +0000 (12:26 +0000)
committerWolfram Sang <wsa+renesas@sang-engineering.com>
Tue, 14 Jan 2025 12:01:30 +0000 (13:01 +0100)
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>
drivers/i2c/busses/i2c-riic.c

index 4e2add343c9e4e115d61bde8796cdf81205e0053..c555b6220e661bacce26346cb9757d673a81b11e 100644 (file)
@@ -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);