1 --- a/include/linux/ath9k_platform.h
2 +++ b/include/linux/ath9k_platform.h
3 @@ -46,6 +46,9 @@ struct ath9k_platform_data {
4 int (*external_reset)(void);
9 + const struct gpio_led *leds;
12 #endif /* _LINUX_ATH9K_PLATFORM_H */
13 --- a/drivers/net/wireless/ath/ath9k/gpio.c
14 +++ b/drivers/net/wireless/ath/ath9k/gpio.c
19 +#include <linux/ath9k_platform.h>
21 /********************************/
23 @@ -108,6 +109,24 @@ int ath_create_gpio_led(struct ath_softc
27 +static int ath_create_platform_led(struct ath_softc *sc,
28 + const struct gpio_led *gpio)
30 + struct ath_led *led;
33 + led = kzalloc(sizeof(*led), GFP_KERNEL);
38 + ret = ath_add_led(sc, led);
45 void ath_deinit_leds(struct ath_softc *sc)
48 @@ -124,8 +143,10 @@ void ath_deinit_leds(struct ath_softc *s
50 void ath_init_leds(struct ath_softc *sc)
52 + struct ath9k_platform_data *pdata = sc->dev->platform_data;
57 INIT_LIST_HEAD(&sc->leds);
59 @@ -134,6 +155,17 @@ void ath_init_leds(struct ath_softc *sc)
63 + if (pdata && pdata->leds && pdata->num_leds)
64 + for (i = 0; i < pdata->num_leds; i++) {
65 + if (pdata->leds[i].gpio == sc->sc_ah->led_pin)
66 + sc->sc_ah->led_pin = -1;
68 + ath_create_platform_led(sc, &pdata->leds[i]);
71 + if (sc->sc_ah->led_pin < 0)
74 snprintf(led_name, sizeof(led_name), "ath9k-%s",
75 wiphy_name(sc->hw->wiphy));