[OpenWrt-Devel] [PATCH][4 FUTURE] MIPS: BCM47XX: Register as platform (DT) driver

Rafał Miłecki zajec5 at gmail.com
Sat Sep 6 08:17:51 EDT 2014


---
 arch/mips/bcm47xx/sprom.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/arch/mips/bcm47xx/sprom.c b/arch/mips/bcm47xx/sprom.c
index e772e77..f46f0b4 100644
--- a/arch/mips/bcm47xx/sprom.c
+++ b/arch/mips/bcm47xx/sprom.c
@@ -869,3 +869,27 @@ void bcm47xx_sprom_register_fallbacks(void)
 		pr_warn("Failed to registered bcma SPROM handler\n");
 #endif
 }
+
+static int bcm47xx_sprom_probe(struct platform_device *pdev)
+{
+	bcm47xx_sprom_register_fallbacks();
+
+	return 0;
+}
+
+static const struct of_device_id bcm47xx_sprom_of_match_table[] = {
+	{ .compatible = "brcm,bcm47xx-sprom", },
+	{},
+};
+
+static struct platform_driver bcm47xx_sprom_driver = {
+	.driver = {
+		.owner = THIS_MODULE,
+		.name = "bcm47xx-sprom",
+		.of_match_table = bcm47xx_sprom_of_match_table,
+		/* driver unloading/unbinding currently not supported */
+		.suppress_bind_attrs = true,
+	},
+	.probe = bcm47xx_sprom_probe,
+};
+module_platform_driver(bcm47xx_sprom_driver);
-- 
1.8.4.5
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list