diff options
Diffstat (limited to 'drivers/net/phy/phy_device.c')
-rw-r--r-- | drivers/net/phy/phy_device.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index db1794546c56..1a99bb244106 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c | |||
@@ -149,6 +149,7 @@ EXPORT_SYMBOL(phy_scan_fixups); | |||
149 | struct phy_device* phy_device_create(struct mii_bus *bus, int addr, int phy_id) | 149 | struct phy_device* phy_device_create(struct mii_bus *bus, int addr, int phy_id) |
150 | { | 150 | { |
151 | struct phy_device *dev; | 151 | struct phy_device *dev; |
152 | |||
152 | /* We allocate the device, and initialize the | 153 | /* We allocate the device, and initialize the |
153 | * default values */ | 154 | * default values */ |
154 | dev = kzalloc(sizeof(*dev), GFP_KERNEL); | 155 | dev = kzalloc(sizeof(*dev), GFP_KERNEL); |
@@ -179,6 +180,17 @@ struct phy_device* phy_device_create(struct mii_bus *bus, int addr, int phy_id) | |||
179 | mutex_init(&dev->lock); | 180 | mutex_init(&dev->lock); |
180 | INIT_DELAYED_WORK(&dev->state_queue, phy_state_machine); | 181 | INIT_DELAYED_WORK(&dev->state_queue, phy_state_machine); |
181 | 182 | ||
183 | /* Request the appropriate module unconditionally; don't | ||
184 | bother trying to do so only if it isn't already loaded, | ||
185 | because that gets complicated. A hotplug event would have | ||
186 | done an unconditional modprobe anyway. | ||
187 | We don't do normal hotplug because it won't work for MDIO | ||
188 | -- because it relies on the device staying around for long | ||
189 | enough for the driver to get loaded. With MDIO, the NIC | ||
190 | driver will get bored and give up as soon as it finds that | ||
191 | there's no driver _already_ loaded. */ | ||
192 | request_module(MDIO_MODULE_PREFIX MDIO_ID_FMT, MDIO_ID_ARGS(phy_id)); | ||
193 | |||
182 | return dev; | 194 | return dev; |
183 | } | 195 | } |
184 | EXPORT_SYMBOL(phy_device_create); | 196 | EXPORT_SYMBOL(phy_device_create); |