Message ID | 20230507133906.15061-3-marek.vasut+renesas@mailbox.org (mailing list archive) |
---|---|
State | Accepted, archived |
Headers | show |
Series | [1/3] clk: vc5: Fix .driver_data content in i2c_device_id | expand |
On Sun, May 7, 2023 at 3:39 PM Marek Vasut <marek.vasut+renesas@mailbox.org> wrote: > The .driver_data content in i2c_device_id table must match the > .data content in of_device_id table, else device_get_match_data() > would return bogus value on i2c_device_id match. Align the two > tables. > > The i2c_device_id table is now converted from of_device_id using > 's@.compatible = "renesas,\([^"]\+"\), .data = \(.*\)@"\1, .driver_data = (kernel_ulong_t)\2@' > > Fixes: 892e0ddea1aa ("clk: rs9: Add Renesas 9-series PCIe clock generator driver") > Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Gr{oetje,eeting}s, Geert
Quoting Marek Vasut (2023-05-07 06:39:06) > The .driver_data content in i2c_device_id table must match the > .data content in of_device_id table, else device_get_match_data() > would return bogus value on i2c_device_id match. Align the two > tables. > > The i2c_device_id table is now converted from of_device_id using > 's@.compatible = "renesas,\([^"]\+"\), .data = \(.*\)@"\1, .driver_data = (kernel_ulong_t)\2@' > > Fixes: 892e0ddea1aa ("clk: rs9: Add Renesas 9-series PCIe clock generator driver") > Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> > --- Applied to clk-next
diff --git a/drivers/clk/clk-renesas-pcie.c b/drivers/clk/clk-renesas-pcie.c index 10d31c222a1c..6060cafe1aa2 100644 --- a/drivers/clk/clk-renesas-pcie.c +++ b/drivers/clk/clk-renesas-pcie.c @@ -392,8 +392,8 @@ static const struct rs9_chip_info renesas_9fgv0441_info = { }; static const struct i2c_device_id rs9_id[] = { - { "9fgv0241", .driver_data = RENESAS_9FGV0241 }, - { "9fgv0441", .driver_data = RENESAS_9FGV0441 }, + { "9fgv0241", .driver_data = (kernel_ulong_t)&renesas_9fgv0241_info }, + { "9fgv0441", .driver_data = (kernel_ulong_t)&renesas_9fgv0441_info }, { } }; MODULE_DEVICE_TABLE(i2c, rs9_id);
The .driver_data content in i2c_device_id table must match the .data content in of_device_id table, else device_get_match_data() would return bogus value on i2c_device_id match. Align the two tables. The i2c_device_id table is now converted from of_device_id using 's@.compatible = "renesas,\([^"]\+"\), .data = \(.*\)@"\1, .driver_data = (kernel_ulong_t)\2@' Fixes: 892e0ddea1aa ("clk: rs9: Add Renesas 9-series PCIe clock generator driver") Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> --- Cc: Alex Helms <alexander.helms.jy@renesas.com> Cc: Geert Uytterhoeven <geert+renesas@glider.be> Cc: Luca Ceresoli <luca.ceresoli@bootlin.com> Cc: Magnus Damm <magnus.damm@gmail.com> Cc: Michael Turquette <mturquette@baylibre.com> Cc: Nathan Chancellor <nathan@kernel.org> Cc: Nick Desaulniers <ndesaulniers@google.com> Cc: Stephen Boyd <sboyd@kernel.org> Cc: Tom Rix <trix@redhat.com> Cc: linux-clk@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org --- drivers/clk/clk-renesas-pcie.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)