Skip to contentSkip to conversation

spi: Epson RX-6610: declare missing of table

PATCH In review Daniel Gomez 2 participants 2 messages Apr 22, 2019 – Apr 24, 2019 Real time clock (RTC)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spi: Epson RX-6610: declare missing of table

Add missing <of_device_id> table for SPI driver relying on SPI device match since compatible is in a DT binding or in a DTS.

Before this patch:
modinfo drivers/rtc/rtc-rx6110.ko | grep alias
alias: spi:rx6110

After this patch:
modinfo drivers/rtc/rtc-rx6110.ko | grep alias

alias:          spi:rx6110
alias:          of:N*T*Cepson,rx6110C*
alias:          of:N*T*Cepson,rx6110
---
 drivers/rtc/rtc-rx6110.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/rtc/rtc-rx6110.c +9 -0
index 5899ca3..71e20a6 100644
@@ -21,6 +21,8 @@
 #include <linux/of_gpio.h>
 #include <linux/regmap.h>
 #include <linux/rtc.h>
+#include <linux/of.h>
+#include <linux/of_device.h>
 #include <linux/spi/spi.h>
 
 /* RX-6110 Register definitions */
@@ -379,9 +381,16 @@ static const struct spi_device_id rx6110_id[] = {
 };
 MODULE_DEVICE_TABLE(spi, rx6110_id);
 
+static const struct of_device_id rx6110_spi_of_match[] = {
+	{ .compatible = "epson,rx6110" },
+	{ },
+};
+MODULE_DEVICE_TABLE(of, rx6110_spi_of_match);
+
 static struct spi_driver rx6110_driver = {
 	.driver = {
 		.name = RX6110_DRIVER_NAME,
+		.of_match_table = of_match_ptr(rx6110_spi_of_match),
 	},
 	.probe		= rx6110_probe,
 	.remove		= rx6110_remove,
Signature · 1 line
2.7.4
#1 lore raw
Quoted 13 lines · Daniel Gomez

Add missing <of_device_id> table for SPI driver relying on SPI device match since compatible is in a DT binding or in a DTS.

Before this patch:
modinfo drivers/rtc/rtc-rx6110.ko | grep alias
alias: spi:rx6110

After this patch:
modinfo drivers/rtc/rtc-rx6110.ko | grep alias

alias:          spi:rx6110
alias:          of:N*T*Cepson,rx6110C*
alias:          of:N*T*Cepson,rx6110
Quoted 6 lines
---
 drivers/rtc/rtc-rx6110.c | 9 +++++++++
 1 file changed, 9 insertions(+)

Applied after adjusting the subject, thanks.

Signature · 3 lines
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com