327-ath9k-add-a-helper-to-get-the-string-representation-.patch 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. From 25b8b2d57def4854558c135228a52326a7d346ad Mon Sep 17 00:00:00 2001
  2. From: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
  3. Date: Sun, 16 Oct 2016 22:59:06 +0200
  4. Subject: [PATCH 2/3] ath9k: add a helper to get the string representation of
  5. ath_bus_type
  6. This can be used when the ath_bus_type has to be presented in a log
  7. message or firmware filename.
  8. Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
  9. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
  10. ---
  11. drivers/net/wireless/ath/ath.h | 6 ++++++
  12. drivers/net/wireless/ath/main.c | 7 +++++++
  13. 2 files changed, 13 insertions(+)
  14. --- a/drivers/net/wireless/ath/ath.h
  15. +++ b/drivers/net/wireless/ath/ath.h
  16. @@ -327,4 +327,10 @@ static inline const char *ath_opmode_to_
  17. }
  18. #endif
  19. +extern const char *ath_bus_type_strings[];
  20. +static inline const char *ath_bus_type_to_string(enum ath_bus_type bustype)
  21. +{
  22. + return ath_bus_type_strings[bustype];
  23. +}
  24. +
  25. #endif /* ATH_H */
  26. --- a/drivers/net/wireless/ath/main.c
  27. +++ b/drivers/net/wireless/ath/main.c
  28. @@ -90,3 +90,10 @@ void ath_printk(const char *level, const
  29. va_end(args);
  30. }
  31. EXPORT_SYMBOL(ath_printk);
  32. +
  33. +const char *ath_bus_type_strings[] = {
  34. + [ATH_PCI] = "pci",
  35. + [ATH_AHB] = "ahb",
  36. + [ATH_USB] = "usb",
  37. +};
  38. +EXPORT_SYMBOL(ath_bus_type_strings);