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