mac80211: update to wireless-testing 2016-05-12
[openwrt/staging/yousong.git] / package / kernel / mac80211 / patches / 546-ath9k_platform_led_name.patch
1 From: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
2 Date: Sun, 31 Jan 2016 20:45:57 +0100
3 Subject: [PATCH v4 1/8] mac80211: ath9k: enable platform WLAN LED name
4
5 Enable platform-supplied WLAN LED name for ath9k device. It replaces generic
6 'ath9k-phy*' label with string set during platform initialization.
7
8 Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
9 ---
10 drivers/net/wireless/ath/ath9k/gpio.c | 10 +++++++---
11 include/linux/ath9k_platform.h | 1 +
12 2 files changed, 8 insertions(+), 3 deletions(-)
13
14 --- a/drivers/net/wireless/ath/ath9k/gpio.c
15 +++ b/drivers/net/wireless/ath/ath9k/gpio.c
16 @@ -155,8 +155,11 @@ void ath_init_leds(struct ath_softc *sc)
17
18 ath_fill_led_pin(sc);
19
20 - snprintf(led_name, sizeof(led_name), "ath9k-%s",
21 - wiphy_name(sc->hw->wiphy));
22 + if (pdata && pdata->led_name)
23 + strncpy(led_name, pdata->led_name, sizeof(led_name));
24 + else
25 + snprintf(led_name, sizeof(led_name), "ath9k-%s",
26 + wiphy_name(sc->hw->wiphy));
27
28 if (ath9k_led_blink)
29 trigger = sc->led_default_trigger;
30 --- a/include/linux/ath9k_platform.h
31 +++ b/include/linux/ath9k_platform.h
32 @@ -49,6 +49,7 @@ struct ath9k_platform_data {
33
34 int num_leds;
35 const struct gpio_led *leds;
36 + const char *led_name;
37 };
38
39 #endif /* _LINUX_ATH9K_PLATFORM_H */