Skip to content

Commit 5aa5f0e

Browse files
Russell King (Oracle)NipaLocal
authored andcommitted
net: stmmac: remove mac_interface
mac_interface has served little purpose, and has only caused confusion. Now that we have cleaned up all platform glue drivers which should not have been using mac_interface, there are no users remaining. Remove mac_interface. This results in the special dwmac specific "mac-mode" DT property becoming redundant, and an in case, no DTS files in the kernel make use of this property. Add a warning if the property is set, and it is different from the "phy-mode". Signed-off-by: Russell King (Oracle) <[email protected]> Acked-by: Vladimir Zapolskiy <[email protected]> Signed-off-by: NipaLocal <nipa@local>
1 parent bd8a6c1 commit 5aa5f0e

File tree

5 files changed

+9
-16
lines changed

5 files changed

+9
-16
lines changed

drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,6 @@ static void loongson_default_data(struct pci_dev *pdev,
9898
/* Set default value for multicast hash bins */
9999
plat->multicast_filter_bins = 256;
100100

101-
plat->mac_interface = PHY_INTERFACE_MODE_NA;
102-
103101
/* Set default value for unicast filter entries */
104102
plat->unicast_filter_entries = 1;
105103

drivers/net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ static int lpc18xx_dwmac_probe(struct platform_device *pdev)
4141
if (IS_ERR(plat_dat))
4242
return PTR_ERR(plat_dat);
4343

44-
plat_dat->mac_interface = PHY_INTERFACE_MODE_NA;
4544
plat_dat->has_gmac = true;
4645

4746
reg = syscon_regmap_lookup_by_compatible("nxp,lpc1850-creg");

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,10 +1118,7 @@ static const struct phylink_mac_ops stmmac_phylink_mac_ops = {
11181118
*/
11191119
static void stmmac_check_pcs_mode(struct stmmac_priv *priv)
11201120
{
1121-
int interface = priv->plat->mac_interface;
1122-
1123-
if (interface == PHY_INTERFACE_MODE_NA)
1124-
interface = priv->plat->phy_interface;
1121+
int interface = priv->plat->phy_interface;
11251122

11261123
if (priv->dma_cap.pcs) {
11271124
if ((interface == PHY_INTERFACE_MODE_RGMII) ||

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,8 +453,12 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac)
453453
return ERR_PTR(phy_mode);
454454

455455
plat->phy_interface = phy_mode;
456+
456457
rc = stmmac_of_get_mac_mode(np);
457-
plat->mac_interface = rc < 0 ? plat->phy_interface : rc;
458+
if (rc >= 0 && rc != phy_mode)
459+
dev_warn(&pdev->dev,
460+
"\"mac-mode\" property used for %s but differs to \"phy-mode\" of %s, and will be ignored. Please report.\n",
461+
phy_modes(rc), phy_modes(phy_mode));
458462

459463
/* Some wrapper drivers still rely on phy_node. Let's save it while
460464
* they are not converted to phylink. */

include/linux/stmmac.h

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,8 @@ struct plat_stmmacenet_data {
190190
int bus_id;
191191
int phy_addr;
192192
/* MAC ----- optional PCS ----- SerDes ----- optional PHY ----- Media
193-
* ^ ^
194-
* mac_interface phy_interface
193+
* ^
194+
* phy_interface
195195
*
196196
* The Synopsys dwmac core only covers the MAC and an optional
197197
* integrated PCS. Where the integrated PCS is used with a SerDes,
@@ -208,12 +208,7 @@ struct plat_stmmacenet_data {
208208
* is used, this counts as "the rest of the SoC" in the above
209209
* paragraph.
210210
*
211-
* Thus, mac_interface is of little use inside the stmmac code;
212-
* please do not use unless there is a definite requirement, and
213-
* make sure to gain review feedback first.
214-
*/
215-
phy_interface_t mac_interface;
216-
/* phy_interface is the PHY-side interface - the interface used by
211+
* phy_interface is the PHY-side interface - the interface used by
217212
* an attached PHY or SFP etc. This is equivalent to the interface
218213
* that phylink uses.
219214
*/

0 commit comments

Comments
 (0)