mac80211: ath9k: register id table for platform device
[openwrt.git] / package / mac80211 / patches / 560-ath9k-register-id-table-for-platform-device.patch
1 --- a/drivers/net/wireless/ath/ath9k/ahb.c
2 +++ b/drivers/net/wireless/ath/ath9k/ahb.c
3 @@ -21,6 +21,14 @@
4  #include <linux/ath9k_platform.h>
5  #include "ath9k.h"
6  
7 +const struct platform_device_id ath9k_platform_id_table[] = {
8 +       {
9 +               .name = "ath9k",
10 +               .driver_data = AR5416_AR9100_DEVID,
11 +       },
12 +       {},
13 +};
14 +
15  /* return bus cachesize in 4B word units */
16  static void ath_ahb_read_cachesize(struct ath_common *common, int *csz)
17  {
18 @@ -57,6 +65,7 @@ static int ath_ahb_probe(struct platform
19         struct ath_softc *sc;
20         struct ieee80211_hw *hw;
21         struct resource *res;
22 +       const struct platform_device_id *id = platform_get_device_id(pdev);
23         int irq;
24         int ret = 0;
25         struct ath_hw *ah;
26 @@ -116,7 +125,7 @@ static int ath_ahb_probe(struct platform
27                 goto err_free_hw;
28         }
29  
30 -       ret = ath9k_init_device(AR5416_AR9100_DEVID, sc, 0x0, &ath_ahb_bus_ops);
31 +       ret = ath9k_init_device(id->driver_data, sc, 0x0, &ath_ahb_bus_ops);
32         if (ret) {
33                 dev_err(&pdev->dev, "failed to initialize device\n");
34                 goto err_irq;
35 @@ -165,8 +174,11 @@ static struct platform_driver ath_ahb_dr
36                 .name   = "ath9k",
37                 .owner  = THIS_MODULE,
38         },
39 +       .id_table    = ath9k_platform_id_table,
40  };
41  
42 +MODULE_DEVICE_TABLE(platform, ath9k_platform_id_table);
43 +
44  int ath_ahb_init(void)
45  {
46         return platform_driver_register(&ath_ahb_driver);