790-09-v6.4-net-dsa-mt7530-move-p5_intf_modes-function-to-mt7530.patch 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. From dbef24b66807eef7498740fa8b8441bee64a96c4 Mon Sep 17 00:00:00 2001
  2. From: Daniel Golle <[email protected]>
  3. Date: Mon, 3 Apr 2023 02:18:28 +0100
  4. Subject: [PATCH 09/48] net: dsa: mt7530: move p5_intf_modes() function to
  5. mt7530.c
  6. In preparation of splitting mt7530.c into a driver for MDIO-connected
  7. as well as MDIO-accessed built-in switches on one hand and MMIO-accessed
  8. built-in switches move the p5_inft_modes() function from mt7530.h to
  9. mt7530.c. The function is only needed there and will trigger a compiler
  10. warning about a defined but unused function otherwise when including
  11. mt7530.h in the to-be-introduced bus-specific drivers.
  12. Signed-off-by: Daniel Golle <[email protected]>
  13. Reviewed-by: Andrew Lunn <[email protected]>
  14. Signed-off-by: David S. Miller <[email protected]>
  15. ---
  16. drivers/net/dsa/mt7530.c | 18 ++++++++++++++++++
  17. drivers/net/dsa/mt7530.h | 18 ------------------
  18. 2 files changed, 18 insertions(+), 18 deletions(-)
  19. --- a/drivers/net/dsa/mt7530.c
  20. +++ b/drivers/net/dsa/mt7530.c
  21. @@ -950,6 +950,24 @@ mt7530_set_ageing_time(struct dsa_switch
  22. return 0;
  23. }
  24. +static const char *p5_intf_modes(unsigned int p5_interface)
  25. +{
  26. + switch (p5_interface) {
  27. + case P5_DISABLED:
  28. + return "DISABLED";
  29. + case P5_INTF_SEL_PHY_P0:
  30. + return "PHY P0";
  31. + case P5_INTF_SEL_PHY_P4:
  32. + return "PHY P4";
  33. + case P5_INTF_SEL_GMAC5:
  34. + return "GMAC5";
  35. + case P5_INTF_SEL_GMAC5_SGMII:
  36. + return "GMAC5_SGMII";
  37. + default:
  38. + return "unknown";
  39. + }
  40. +}
  41. +
  42. static void mt7530_setup_port5(struct dsa_switch *ds, phy_interface_t interface)
  43. {
  44. struct mt7530_priv *priv = ds->priv;
  45. --- a/drivers/net/dsa/mt7530.h
  46. +++ b/drivers/net/dsa/mt7530.h
  47. @@ -709,24 +709,6 @@ enum p5_interface_select {
  48. P5_INTF_SEL_GMAC5_SGMII,
  49. };
  50. -static const char *p5_intf_modes(unsigned int p5_interface)
  51. -{
  52. - switch (p5_interface) {
  53. - case P5_DISABLED:
  54. - return "DISABLED";
  55. - case P5_INTF_SEL_PHY_P0:
  56. - return "PHY P0";
  57. - case P5_INTF_SEL_PHY_P4:
  58. - return "PHY P4";
  59. - case P5_INTF_SEL_GMAC5:
  60. - return "GMAC5";
  61. - case P5_INTF_SEL_GMAC5_SGMII:
  62. - return "GMAC5_SGMII";
  63. - default:
  64. - return "unknown";
  65. - }
  66. -}
  67. -
  68. struct mt7530_priv;
  69. struct mt753x_pcs {