Skip to contentSkip to conversation

fpga: ice40-spi: Remove redundant of_match_ptr() macros

PATCH In review Andy Shevchenko 2 participants 3 messages Apr 12, 2024 – Apr 15, 2024 FPGA manager framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fpga: ice40-spi: Remove redundant of_match_ptr() macros

Since the driver hi6421-regulator depends on CONFIG_OF, it makes no difference to wrap of_match_ptr() here.

Remove of_match_ptr() macros to clean it up.

While at it, add missing mod_devicetable.h.

Fixes 5d04660b29fb ("fpga: ice40-spi: Remove unused of_gpio.h")
---
 drivers/fpga/ice40-spi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/fpga/ice40-spi.c +2 -1
index 46927945f1b9..62c30266130d 100644
@@ -10,6 +10,7 @@
 
 #include <linux/fpga/fpga-mgr.h>
 #include <linux/gpio/consumer.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/spi/spi.h>
 #include <linux/stringify.h>
@@ -198,7 +199,7 @@ static struct spi_driver ice40_fpga_driver = {
 	.probe = ice40_fpga_probe,
 	.driver = {
 		.name = "ice40spi",
-		.of_match_table = of_match_ptr(ice40_fpga_of_match),
+		.of_match_table = ice40_fpga_of_match,
 	},
 	.id_table = ice40_fpga_spi_ids,
 };
Signature · 1 line
2.43.0.rc1.1336.g36b5255a03ac
#1 lore raw
Quoted 1 line · Andy Shevchenko

Since the driver hi6421-regulator depends on CONFIG_OF,

                   ^

It is ice40-spi

Quoted 9 lines

it makes no difference to wrap of_match_ptr() here.

Remove of_match_ptr() macros to clean it up.

While at it, add missing mod_devicetable.h.

Fixes 5d04660b29fb ("fpga: ice40-spi: Remove unused of_gpio.h")

Since 5d04660b29fb is not merged yet, could you just merge them into one? Or it breaks bisecting.

Quoted 18 lines
---
 drivers/fpga/ice40-spi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/fpga/ice40-spi.c +1 -0
index 46927945f1b9..62c30266130d 100644
@@ -10,6 +10,7 @@
 
 #include <linux/fpga/fpga-mgr.h>
 #include <linux/gpio/consumer.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/spi/spi.h>
 #include <linux/stringify.h>

drivers/fpga/ice40-spi.c static struct spi_driver ice40_fpga_driver = { · line 202

Quoted 5 lines
drivers/fpga/ice40-spi.c +1 -1
@@ -198,7 +199,7 @@ static struct spi_driver ice40_fpga_driver = {
 	.probe = ice40_fpga_probe,
 	.driver = {
 		.name = "ice40spi",
-		.of_match_table = of_match_ptr(ice40_fpga_of_match),
+		.of_match_table = ice40_fpga_of_match,

It works, thanks for quick fix.

Yilun

Quoted 7 lines
drivers/fpga/ice40-spi.c +0 -0
 	},
 	.id_table = ice40_fpga_spi_ids,
 };
Signature · 1 line
2.43.0.rc1.1336.g36b5255a03ac
#2 lore raw
Quoted 4 lines · Xu Yilun
Quoted 1 line · Andy Shevchenko

Since the driver hi6421-regulator depends on CONFIG_OF,

                   ^

It is ice40-spi

Oops, copy-and-paste typo.

Quoted 4 lines
Quoted 4 lines

it makes no difference to wrap of_match_ptr() here.

Remove of_match_ptr() macros to clean it up.

Quoted 8 lines
Quoted 5 lines

While at it, add missing mod_devicetable.h.

Fixes 5d04660b29fb ("fpga: ice40-spi: Remove unused of_gpio.h")

Since 5d04660b29fb is not merged yet, could you just merge them into one? Or it breaks bisecting.

You can also fold it, but sure, I'll send a v2.

Signature · 2 lines
With Best Regards,
Andy Shevchenko