1
0

546-ath9k_platform_led_name.patch 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. Enable platform-supplied WLAN LED name for ath9k device. It replaces generic
  5. 'ath9k-phy*' label with string set during platform initialization.
  6. Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
  7. ---
  8. drivers/net/wireless/ath/ath9k/gpio.c | 10 +++++++---
  9. include/linux/ath9k_platform.h | 1 +
  10. 2 files changed, 8 insertions(+), 3 deletions(-)
  11. --- a/drivers/net/wireless/ath/ath9k/gpio.c
  12. +++ b/drivers/net/wireless/ath/ath9k/gpio.c
  13. @@ -155,8 +155,11 @@ void ath_init_leds(struct ath_softc *sc)
  14. ath_fill_led_pin(sc);
  15. - snprintf(led_name, sizeof(led_name), "ath9k-%s",
  16. - wiphy_name(sc->hw->wiphy));
  17. + if (pdata && pdata->led_name)
  18. + strncpy(led_name, pdata->led_name, sizeof(led_name));
  19. + else
  20. + snprintf(led_name, sizeof(led_name), "ath9k-%s",
  21. + wiphy_name(sc->hw->wiphy));
  22. if (ath9k_led_blink)
  23. trigger = sc->led_default_trigger;
  24. --- a/include/linux/ath9k_platform.h
  25. +++ b/include/linux/ath9k_platform.h
  26. @@ -49,6 +49,7 @@ struct ath9k_platform_data {
  27. int num_leds;
  28. const struct gpio_led *leds;
  29. + const char *led_name;
  30. };
  31. #endif /* _LINUX_ATH9K_PLATFORM_H */