diff options
author | Gertjan van Wingerde <gwingerde@gmail.com> | 2011-04-18 09:32:13 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-04-19 15:39:45 -0400 |
commit | e01ae27f8ce6bd3ee26ef33c704f62449ce8233b (patch) | |
tree | 28c022b0e755e244e4834f741d2bfce600606624 /drivers/net/wireless/rt2x00/rt2400pci.c | |
parent | ce2919c9fffe2aa52f9c3e327176d03764dbf9b5 (diff) |
rt2x00: Allow dynamic addition of PCI/USB IDs.
Both USB and PCI drivers allow a system administrator to dynamically add
USB/PCI IDs to the device table that a driver supports via the
/sys/bus/{usb,pci,pci_express}/drivers/<driver-name>/new_id files.
However, for the rt2x00 drivers using this method currently crashes the
system with a NULL pointer failure.
This is due to the set-up of rt2x00 where the probe functions require a
rt2x00_ops structure in the driver_info field of the probed device. As
this field is empty for the dynamically added devices this fails for
these devices.
Fix this by introducing driver-specific probe wrappers that do nothing
but calling the bus-specific probe functions with the rt2x00_ops structure
as an argument, rather than depending on the driver_info field.
Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2400pci.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2400pci.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c index 01e951717f0f..d4acdde7c75a 100644 --- a/drivers/net/wireless/rt2x00/rt2400pci.c +++ b/drivers/net/wireless/rt2x00/rt2400pci.c | |||
@@ -1802,10 +1802,11 @@ static const struct rt2x00_ops rt2400pci_ops = { | |||
1802 | * RT2400pci module information. | 1802 | * RT2400pci module information. |
1803 | */ | 1803 | */ |
1804 | static DEFINE_PCI_DEVICE_TABLE(rt2400pci_device_table) = { | 1804 | static DEFINE_PCI_DEVICE_TABLE(rt2400pci_device_table) = { |
1805 | { PCI_DEVICE(0x1814, 0x0101), PCI_DEVICE_DATA(&rt2400pci_ops) }, | 1805 | { PCI_DEVICE(0x1814, 0x0101) }, |
1806 | { 0, } | 1806 | { 0, } |
1807 | }; | 1807 | }; |
1808 | 1808 | ||
1809 | |||
1809 | MODULE_AUTHOR(DRV_PROJECT); | 1810 | MODULE_AUTHOR(DRV_PROJECT); |
1810 | MODULE_VERSION(DRV_VERSION); | 1811 | MODULE_VERSION(DRV_VERSION); |
1811 | MODULE_DESCRIPTION("Ralink RT2400 PCI & PCMCIA Wireless LAN driver."); | 1812 | MODULE_DESCRIPTION("Ralink RT2400 PCI & PCMCIA Wireless LAN driver."); |
@@ -1813,10 +1814,16 @@ MODULE_SUPPORTED_DEVICE("Ralink RT2460 PCI & PCMCIA chipset based cards"); | |||
1813 | MODULE_DEVICE_TABLE(pci, rt2400pci_device_table); | 1814 | MODULE_DEVICE_TABLE(pci, rt2400pci_device_table); |
1814 | MODULE_LICENSE("GPL"); | 1815 | MODULE_LICENSE("GPL"); |
1815 | 1816 | ||
1817 | static int rt2400pci_probe(struct pci_dev *pci_dev, | ||
1818 | const struct pci_device_id *id) | ||
1819 | { | ||
1820 | return rt2x00pci_probe(pci_dev, &rt2400pci_ops); | ||
1821 | } | ||
1822 | |||
1816 | static struct pci_driver rt2400pci_driver = { | 1823 | static struct pci_driver rt2400pci_driver = { |
1817 | .name = KBUILD_MODNAME, | 1824 | .name = KBUILD_MODNAME, |
1818 | .id_table = rt2400pci_device_table, | 1825 | .id_table = rt2400pci_device_table, |
1819 | .probe = rt2x00pci_probe, | 1826 | .probe = rt2400pci_probe, |
1820 | .remove = __devexit_p(rt2x00pci_remove), | 1827 | .remove = __devexit_p(rt2x00pci_remove), |
1821 | .suspend = rt2x00pci_suspend, | 1828 | .suspend = rt2x00pci_suspend, |
1822 | .resume = rt2x00pci_resume, | 1829 | .resume = rt2x00pci_resume, |