Skip to content

Commit e72701a

Browse files
Anton Vorontsovdavem330
authored andcommitted
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. Signed-off-by: Anton Vorontsov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 0fe7463 commit e72701a

File tree

9 files changed

+10
-3
lines changed

9 files changed

+10
-3
lines changed

drivers/net/can/sja1000/sja1000_of_platform.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ static struct of_device_id __devinitdata sja1000_ofp_table[] = {
213213
{.compatible = "nxp,sja1000"},
214214
{},
215215
};
216+
MODULE_DEVICE_TABLE(of, sja1000_ofp_table);
216217

217218
static struct of_platform_driver sja1000_ofp_driver = {
218219
.owner = THIS_MODULE,

drivers/net/fec_mpc52xx_phy.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ static struct of_device_id mpc52xx_fec_mdio_match[] = {
155155
{ .compatible = "mpc5200b-fec-phy", },
156156
{}
157157
};
158+
MODULE_DEVICE_TABLE(of, mpc52xx_fec_mdio_match);
158159

159160
struct of_platform_driver mpc52xx_fec_mdio_driver = {
160161
.name = "mpc5200b-fec-phy",

drivers/net/fs_enet/fs_enet-main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,6 +1110,7 @@ static struct of_device_id fs_enet_match[] = {
11101110
#endif
11111111
{}
11121112
};
1113+
MODULE_DEVICE_TABLE(of, fs_enet_match);
11131114

11141115
static struct of_platform_driver fs_enet_driver = {
11151116
.name = "fs_enet",

drivers/net/fs_enet/mii-bitbang.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ static struct of_device_id fs_enet_mdio_bb_match[] = {
221221
},
222222
{},
223223
};
224+
MODULE_DEVICE_TABLE(of, fs_enet_mdio_bb_match);
224225

225226
static struct of_platform_driver fs_enet_bb_mdio_driver = {
226227
.name = "fsl-bb-mdio",

drivers/net/fs_enet/mii-fec.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ static struct of_device_id fs_enet_mdio_fec_match[] = {
219219
#endif
220220
{},
221221
};
222+
MODULE_DEVICE_TABLE(of, fs_enet_mdio_fec_match);
222223

223224
static struct of_platform_driver fs_enet_fec_mdio_driver = {
224225
.name = "fsl-fec-mdio",

drivers/net/fsl_pq_mdio.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,7 @@ static struct of_device_id fsl_pq_mdio_match[] = {
407407
},
408408
{},
409409
};
410+
MODULE_DEVICE_TABLE(of, fsl_pq_mdio_match);
410411

411412
static struct of_platform_driver fsl_pq_mdio_driver = {
412413
.name = "fsl-pq_mdio",

drivers/net/gianfar.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2325,9 +2325,6 @@ static irqreturn_t gfar_error(int irq, void *dev_id)
23252325
return IRQ_HANDLED;
23262326
}
23272327

2328-
/* work with hotplug and coldplug */
2329-
MODULE_ALIAS("platform:fsl-gianfar");
2330-
23312328
static struct of_device_id gfar_match[] =
23322329
{
23332330
{
@@ -2336,6 +2333,7 @@ static struct of_device_id gfar_match[] =
23362333
},
23372334
{},
23382335
};
2336+
MODULE_DEVICE_TABLE(of, gfar_match);
23392337

23402338
/* Structure for a device driver */
23412339
static struct of_platform_driver gfar_driver = {

drivers/net/ibm_newemac/core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
*
2525
*/
2626

27+
#include <linux/module.h>
2728
#include <linux/sched.h>
2829
#include <linux/string.h>
2930
#include <linux/errno.h>
@@ -2988,6 +2989,7 @@ static struct of_device_id emac_match[] =
29882989
},
29892990
{},
29902991
};
2992+
MODULE_DEVICE_TABLE(of, emac_match);
29912993

29922994
static struct of_platform_driver emac_driver = {
29932995
.name = "emac",

drivers/net/phy/mdio-gpio.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ static struct of_device_id mdio_ofgpio_match[] = {
238238
},
239239
{},
240240
};
241+
MODULE_DEVICE_TABLE(of, mdio_ofgpio_match);
241242

242243
static struct of_platform_driver mdio_ofgpio_driver = {
243244
.name = "mdio-gpio",

0 commit comments

Comments
 (0)