Re: [PATCH] net: stmmac: socfpga: re-use the `interface` parameter from platform data

From: David Miller
Date: Tue Sep 10 2019 - 11:46:59 EST


From: David Miller <davem@xxxxxxxxxxxxx>
Date: Tue, 10 Sep 2019 17:45:44 +0200 (CEST)

> From: Alexandru Ardelean <alexandru.ardelean@xxxxxxxxxx>
> Date: Fri, 6 Sep 2019 15:30:54 +0300
>
>> The socfpga sub-driver defines an `interface` field in the `socfpga_dwmac`
>> struct and parses it on init.
>>
>> The shared `stmmac_probe_config_dt()` function also parses this from the
>> device-tree and makes it available on the returned `plat_data` (which is
>> the same data available via `netdev_priv()`).
>>
>> All that's needed now is to dig that information out, via some
>> `dev_get_drvdata()` && `netdev_priv()` calls and re-use it.
>>
>> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@xxxxxxxxxx>
>
> This doesn't build even on net-next.

Specifically:

drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c: In function ʽsocfpga_gen5_set_phy_modeʼ:
drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c:264:44: error: ʽphymodeʼ undeclared (first use in this function); did you mean ʽphy_modesʼ?
264 | dev_err(dwmac->dev, "bad phy mode %d\n", phymode);
| ^~~~~~~
./include/linux/device.h:1499:32: note: in definition of macro ʽdev_errʼ
1499 | _dev_err(dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~~~~
drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c:264:44: note: each undeclared identifier is reported only once for each function it appears in
264 | dev_err(dwmac->dev, "bad phy mode %d\n", phymode);
| ^~~~~~~
./include/linux/device.h:1499:32: note: in definition of macro ʽdev_errʼ
1499 | _dev_err(dev, dev_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~~~~
drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c: In function ʽsocfpga_gen10_set_phy_modeʼ:
drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c:340:6: error: ʽphymodeʼ undeclared (first use in this function); did you mean ʽphy_modesʼ?
340 | phymode == PHY_INTERFACE_MODE_MII ||
| ^~~~~~~
| phy_modes