Skip to contentSkip to conversation

net: Fix OF platform drivers coldplug/hotplug when compiled as modules

PATCH Applied Anton Vorontsov 2 participants 2 messages Oct 8, 2009 – Oct 14, 2009

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

PATCH 1/1 net: Fix OF platform drivers coldplug/hotplug when compiled as modules

Some OF platform drivers are missing module device tables, so they won't load automatically on boot. This patch fixes the issue by adding proper MODULE_DEVICE_TABLE() macros to the drivers.

---
 drivers/net/can/sja1000/sja1000_of_platform.c |    1 +
 drivers/net/fec_mpc52xx_phy.c                 |    1 +
 drivers/net/fs_enet/fs_enet-main.c            |    1 +
 drivers/net/fs_enet/mii-bitbang.c             |    1 +
 drivers/net/fs_enet/mii-fec.c                 |    1 +
 drivers/net/fsl_pq_mdio.c                     |    1 +
 drivers/net/gianfar.c                         |    4 +---
 drivers/net/ibm_newemac/core.c                |    2 ++
 drivers/net/phy/mdio-gpio.c                   |    1 +
 9 files changed, 10 insertions(+), 3 deletions(-)
drivers/net/can/sja1000/sja1000_of_platform.c +1 -0
index 3373560..9dd076a 100644
@@ -213,6 +213,7 @@ static struct of_device_id __devinitdata sja1000_ofp_table[] = {
 	{.compatible = "nxp,sja1000"},
 	{},
 };
+MODULE_DEVICE_TABLE(of, sja1000_ofp_table);
 
 static struct of_platform_driver sja1000_ofp_driver = {
 	.owner = THIS_MODULE,
drivers/net/fec_mpc52xx_phy.c +1 -0
index 31e6d62..ee0f3c6 100644
@@ -155,6 +155,7 @@ static struct of_device_id mpc52xx_fec_mdio_match[] = {
 	{ .compatible = "mpc5200b-fec-phy", },
 	{}
 };
+MODULE_DEVICE_TABLE(of, mpc52xx_fec_mdio_match);
 
 struct of_platform_driver mpc52xx_fec_mdio_driver = {
 	.name = "mpc5200b-fec-phy",
drivers/net/fs_enet/fs_enet-main.c +1 -0
index 2bc2d2b..ec2f503 100644
@@ -1110,6 +1110,7 @@ static struct of_device_id fs_enet_match[] = {
 #endif
 	{}
 };
+MODULE_DEVICE_TABLE(of, fs_enet_match);
 
 static struct of_platform_driver fs_enet_driver = {
 	.name	= "fs_enet",
drivers/net/fs_enet/mii-bitbang.c +1 -0
index 93b481b..24ff9f4 100644
@@ -221,6 +221,7 @@ static struct of_device_id fs_enet_mdio_bb_match[] = {
 	},
 	{},
 };
+MODULE_DEVICE_TABLE(of, fs_enet_mdio_bb_match);
 
 static struct of_platform_driver fs_enet_bb_mdio_driver = {
 	.name = "fsl-bb-mdio",
drivers/net/fs_enet/mii-fec.c +1 -0
index a2d69c1..96eba42 100644
@@ -219,6 +219,7 @@ static struct of_device_id fs_enet_mdio_fec_match[] = {
 #endif
 	{},
 };
+MODULE_DEVICE_TABLE(of, fs_enet_mdio_fec_match);
 
 static struct of_platform_driver fs_enet_fec_mdio_driver = {
 	.name = "fsl-fec-mdio",
drivers/net/fsl_pq_mdio.c +1 -0
index d167090..6ac4648 100644
@@ -407,6 +407,7 @@ static struct of_device_id fsl_pq_mdio_match[] = {
 	},
 	{},
 };
+MODULE_DEVICE_TABLE(of, fsl_pq_mdio_match);
 
 static struct of_platform_driver fsl_pq_mdio_driver = {
 	.name = "fsl-pq_mdio",
drivers/net/gianfar.c +1 -3
index 1e5289f..5bf31f1 100644
@@ -2325,9 +2325,6 @@ static irqreturn_t gfar_error(int irq, void *dev_id)
 	return IRQ_HANDLED;
 }
 
-/* work with hotplug and coldplug */
-MODULE_ALIAS("platform:fsl-gianfar");
-
 static struct of_device_id gfar_match[] =
 {
 	{
@@ -2336,6 +2333,7 @@ static struct of_device_id gfar_match[] =
 	},
 	{},
 };
+MODULE_DEVICE_TABLE(of, gfar_match);
 
 /* Structure for a device driver */
 static struct of_platform_driver gfar_driver = {
drivers/net/ibm_newemac/core.c +2 -0
index 89c82c5..4baa37c 100644
@@ -24,6 +24,7 @@
  *
  */
 
+#include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/string.h>
 #include <linux/errno.h>
@@ -2985,6 +2986,7 @@ static struct of_device_id emac_match[] =
 	},
 	{},
 };
+MODULE_DEVICE_TABLE(of, emac_match);
 
 static struct of_platform_driver emac_driver = {
 	.name = "emac",
drivers/net/phy/mdio-gpio.c +1 -0
index 250e10f..8659d34 100644
@@ -238,6 +238,7 @@ static struct of_device_id mdio_ofgpio_match[] = {
 	},
 	{},
 };
+MODULE_DEVICE_TABLE(of, mdio_ofgpio_match);
 
 static struct of_platform_driver mdio_ofgpio_driver = {
 	.name = "mdio-gpio",
Signature · 1 line
1.6.3.3
maintainer Applied
#1 lore raw

From: Anton Vorontsov <[email protected]>
Date: Thu, 8 Oct 2009 16:15:12 +0400

Quoted 5 lines

Some OF platform drivers are missing module device tables, so they won't load automatically on boot. This patch fixes the issue by adding proper MODULE_DEVICE_TABLE() macros to the drivers.

Applied, thanks!