Skip to contentSkip to conversation

clk: vc5: Fix .driver_data content in i2c_device_id

PATCH Applied Marek Vasut 4 participants 10 messages May 7, 2023 – May 10, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 clk: vc5: Fix .driver_data content in i2c_device_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 '[email protected] = "idt,\([^"]\+"\), .data = \(.*\)@"\1, .driver_data = (kernel_ulong_t)\2@'

Fixes 9adddb01ce5f ("clk: vc5: Add structure to describe particular chip features")

---
Cc: Alex Helms <[email protected]>
Cc: Geert Uytterhoeven <[email protected]>
Cc: Luca Ceresoli <[email protected]>
Cc: Magnus Damm <[email protected]>
Cc: Michael Turquette <[email protected]>
Cc: Nathan Chancellor <[email protected]>
Cc: Nick Desaulniers <[email protected]>
Cc: Stephen Boyd <[email protected]>
Cc: Tom Rix <[email protected]>
Cc: [email protected]
Cc: [email protected]

---
 drivers/clk/clk-versaclock5.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/clk/clk-versaclock5.c +8 -8
index fa71a57875ce..5452471b7ba5 100644
@@ -1271,14 +1271,14 @@ static const struct vc5_chip_info idt_5p49v6975_info = {
 };
 
 static const struct i2c_device_id vc5_id[] = {
-	{ "5p49v5923", .driver_data = IDT_VC5_5P49V5923 },
-	{ "5p49v5925", .driver_data = IDT_VC5_5P49V5925 },
-	{ "5p49v5933", .driver_data = IDT_VC5_5P49V5933 },
-	{ "5p49v5935", .driver_data = IDT_VC5_5P49V5935 },
-	{ "5p49v60", .driver_data = IDT_VC6_5P49V60 },
-	{ "5p49v6901", .driver_data = IDT_VC6_5P49V6901 },
-	{ "5p49v6965", .driver_data = IDT_VC6_5P49V6965 },
-	{ "5p49v6975", .driver_data = IDT_VC6_5P49V6975 },
+	{ "5p49v5923", .driver_data = (kernel_ulong_t)&idt_5p49v5923_info },
+	{ "5p49v5925", .driver_data = (kernel_ulong_t)&idt_5p49v5925_info },
+	{ "5p49v5933", .driver_data = (kernel_ulong_t)&idt_5p49v5933_info },
+	{ "5p49v5935", .driver_data = (kernel_ulong_t)&idt_5p49v5935_info },
+	{ "5p49v60", .driver_data = (kernel_ulong_t)&idt_5p49v60_info },
+	{ "5p49v6901", .driver_data = (kernel_ulong_t)&idt_5p49v6901_info },
+	{ "5p49v6965", .driver_data = (kernel_ulong_t)&idt_5p49v6965_info },
+	{ "5p49v6975", .driver_data = (kernel_ulong_t)&idt_5p49v6975_info },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, vc5_id);
Signature · 1 line
2.39.2
#1 lore raw

PATCH 2/3 clk: vc7: Fix .driver_data content in i2c_device_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
'[email protected] = "renesas,\([^"]\+"\), .data = \(.*\)@"\1, .driver_data = (kernel_ulong_t)\2@'

Fixes 48c5e98fedd9 ("clk: Renesas versaclock7 ccf device driver")

---
Cc: Alex Helms <[email protected]>
Cc: Geert Uytterhoeven <[email protected]>
Cc: Luca Ceresoli <[email protected]>
Cc: Magnus Damm <[email protected]>
Cc: Michael Turquette <[email protected]>
Cc: Nathan Chancellor <[email protected]>
Cc: Nick Desaulniers <[email protected]>
Cc: Stephen Boyd <[email protected]>
Cc: Tom Rix <[email protected]>
Cc: [email protected]
Cc: [email protected]

---
 drivers/clk/clk-versaclock7.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/clk-versaclock7.c +1 -1
index 8e4f86e852aa..0ae191f50b4b 100644
@@ -1282,7 +1282,7 @@ static const struct regmap_config vc7_regmap_config = {
 };
 
 static const struct i2c_device_id vc7_i2c_id[] = {
-	{ "rc21008a", VC7_RC21008A },
+	{ "rc21008a", .driver_data = (kernel_ulong_t)&vc7_rc21008a_info },
 	{}
 };
 MODULE_DEVICE_TABLE(i2c, vc7_i2c_id);
Signature · 1 line
2.39.2
Reviewed-by on v1 2/3
#2 lore raw

Re: [PATCH 2/3] clk: vc7: Fix .driver_data content in i2c_device_id

Quoted 10 lines · Marek Vasut

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
'[email protected] = "renesas,\([^"]\+"\), .data = \(.*\)@"\1, .driver_data = (kernel_ulong_t)\2@'

Fixes 48c5e98fedd9 ("clk: Renesas versaclock7 ccf device driver")

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
maintainer Applied
#3 lore raw

Re: [PATCH 2/3] clk: vc7: Fix .driver_data content in i2c_device_id

In reply to Marek Vasut

Quoting Marek Vasut (2023-05-07 06:39:05)

Quoted 11 lines

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
'[email protected] = "renesas,\([^"]\+"\), .data = \(.*\)@"\1, .driver_data = (kernel_ulong_t)\2@'

Fixes 48c5e98fedd9 ("clk: Renesas versaclock7 ccf device driver")

---

Applied to clk-next

#4 lore raw

PATCH 3/3 clk: rs9: Fix .driver_data content in i2c_device_id

In reply to Marek Vasut

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
'[email protected] = "renesas,\([^"]\+"\), .data = \(.*\)@"\1, .driver_data = (kernel_ulong_t)\2@'

Fixes 892e0ddea1aa ("clk: rs9: Add Renesas 9-series PCIe clock generator driver")

---
Cc: Alex Helms <[email protected]>
Cc: Geert Uytterhoeven <[email protected]>
Cc: Luca Ceresoli <[email protected]>
Cc: Magnus Damm <[email protected]>
Cc: Michael Turquette <[email protected]>
Cc: Nathan Chancellor <[email protected]>
Cc: Nick Desaulniers <[email protected]>
Cc: Stephen Boyd <[email protected]>
Cc: Tom Rix <[email protected]>
Cc: [email protected]
Cc: [email protected]

---
 drivers/clk/clk-renesas-pcie.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/clk-renesas-pcie.c +2 -2
index 10d31c222a1c..6060cafe1aa2 100644
@@ -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);
Signature · 1 line
2.39.2
Reviewed-by on v1 3/3
#5 lore raw

Re: [PATCH 3/3] clk: rs9: Fix .driver_data content in i2c_device_id

Quoted 10 lines · Marek Vasut

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
'[email protected] = "renesas,\([^"]\+"\), .data = \(.*\)@"\1, .driver_data = (kernel_ulong_t)\2@'

Fixes 892e0ddea1aa ("clk: rs9: Add Renesas 9-series PCIe clock generator driver")

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
maintainer Applied
#6 lore raw

Re: [PATCH 3/3] clk: rs9: Fix .driver_data content in i2c_device_id

In reply to Marek Vasut

Quoting Marek Vasut (2023-05-07 06:39:06)

Quoted 11 lines

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
'[email protected] = "renesas,\([^"]\+"\), .data = \(.*\)@"\1, .driver_data = (kernel_ulong_t)\2@'

Fixes 892e0ddea1aa ("clk: rs9: Add Renesas 9-series PCIe clock generator driver")

---

Applied to clk-next

Reviewed-by on v1 1/3
#7 lore raw
In reply to Marek Vasut

Hi Marek,

Quoted 40 lines · On Sun, 7 May 2023 15:39:04 +0200 Marek Vasut…

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 '[email protected] = "idt,\([^"]\+"\), .data = \(.*\)@"\1, .driver_data = (kernel_ulong_t)\2@'

Fixes 9adddb01ce5f ("clk: vc5: Add structure to describe particular chip features")

---
Cc: Alex Helms <[email protected]>
Cc: Geert Uytterhoeven <[email protected]>
Cc: Luca Ceresoli <[email protected]>
Cc: Magnus Damm <[email protected]>
Cc: Michael Turquette <[email protected]>
Cc: Nathan Chancellor <[email protected]>
Cc: Nick Desaulniers <[email protected]>
Cc: Stephen Boyd <[email protected]>
Cc: Tom Rix <[email protected]>
Cc: [email protected]
Cc: [email protected]

---
 drivers/clk/clk-versaclock5.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/clk/clk-versaclock5.c +0 -6
index fa71a57875ce..5452471b7ba5 100644
@@ -1271,14 +1271,14 @@ static const struct vc5_chip_info idt_5p49v6975_info = {
 };
 
 static const struct i2c_device_id vc5_id[] = {
-	{ "5p49v5923", .driver_data = IDT_VC5_5P49V5923 },
-	{ "5p49v5925", .driver_data = IDT_VC5_5P49V5925 },
-	{ "5p49v5933", .driver_data = IDT_VC5_5P49V5933 },
-	{ "5p49v5935", .driver_data = IDT_VC5_5P49V5935 },
-	{ "5p49v60", .driver_data = IDT_VC6_5P49V60 },
-	{ "5p49v6901", .driver_data = IDT_VC6_5P49V6901 },

drivers/clk/clk-versaclock5.c static const struct vc5_chip_info idt_5p49v6975_info = { · line 1281

Quoted 10 lines
drivers/clk/clk-versaclock5.c +8 -2
-	{ "5p49v6965", .driver_data = IDT_VC6_5P49V6965 },
-	{ "5p49v6975", .driver_data = IDT_VC6_5P49V6975 },
+	{ "5p49v5923", .driver_data = (kernel_ulong_t)&idt_5p49v5923_info },
+	{ "5p49v5925", .driver_data = (kernel_ulong_t)&idt_5p49v5925_info },
+	{ "5p49v5933", .driver_data = (kernel_ulong_t)&idt_5p49v5933_info },
+	{ "5p49v5935", .driver_data = (kernel_ulong_t)&idt_5p49v5935_info },
+	{ "5p49v60", .driver_data = (kernel_ulong_t)&idt_5p49v60_info },
+	{ "5p49v6901", .driver_data = (kernel_ulong_t)&idt_5p49v6901_info },
+	{ "5p49v6965", .driver_data = (kernel_ulong_t)&idt_5p49v6965_info },
+	{ "5p49v6975", .driver_data = (kernel_ulong_t)&idt_5p49v6975_info },

Apparently nobody even used i2c device ids, otherwise this would have gone loudly bad!

Signature · 3 lines
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Reviewed-by on v1 1/3
#8 lore raw
In reply to Marek Vasut
Quoted 10 lines · Marek Vasut

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 '[email protected] = "idt,\([^"]\+"\), .data = \(.*\)@"\1, .driver_data = (kernel_ulong_t)\2@'

Fixes 9adddb01ce5f ("clk: vc5: Add structure to describe particular chip features")

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
maintainer Applied
#9 lore raw
In reply to Marek Vasut

Quoting Marek Vasut (2023-05-07 06:39:04)

Quoted 11 lines

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 '[email protected] = "idt,\([^"]\+"\), .data = \(.*\)@"\1, .driver_data = (kernel_ulong_t)\2@'

Fixes 9adddb01ce5f ("clk: vc5: Add structure to describe particular chip features")

---

Applied to clk-next