netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/9] net: stmmac: remove unnecessary of_get_phy_mode() calls
@ 2025-03-10 12:08 Russell King (Oracle)
  2025-03-10 12:10 ` [PATCH net-next 1/9] net: stmmac: qcom-ethqos: remove of_get_phy_mode() Russell King (Oracle)
                   ` (9 more replies)
  0 siblings, 10 replies; 14+ messages in thread
From: Russell King (Oracle) @ 2025-03-10 12:08 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit
  Cc: Alexandre Torgue, Andrew Lunn, AngeloGioacchino Del Regno,
	Chen-Yu Tsai, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Jernej Skrabec, Jerome Brunet, Kevin Hilman, linux-amlogic,
	linux-arm-kernel, linux-arm-msm, linux-mediatek, linux-stm32,
	linux-sunxi, Martin Blumenstingl, Matthias Brugger,
	Maxime Coquelin, Neil Armstrong, netdev, Paolo Abeni,
	Samuel Holland, Vinod Koul

Hi,

This series removes unnecessary of_get_phy_mode() calls from the stmmac
glue drivers. stmmac_probe_config_dt() / devm_stmmac_probe_config_dt()
already gets the interface mode using device_get_phy_mode() and stores
it in plat_dat->phy_interface.

Therefore, glue drivers using of_get_phy_mode() are just duplicating
the work that has already been done.

This series adjusts the glue drivers to remove their usage of
of_get_phy_mode().

 drivers/net/ethernet/stmicro/stmmac/dwmac-anarion.c    | 18 ++++++++----------
 drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c    | 12 ++++--------
 drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c   |  8 +-------
 drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c    |  6 +-----
 .../net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c    |  4 +---
 drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c         |  2 +-
 drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c        | 12 ++++--------
 drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c      |  8 +-------
 drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c      |  6 +-----
 9 files changed, 22 insertions(+), 54 deletions(-)

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH net-next 1/9] net: stmmac: qcom-ethqos: remove of_get_phy_mode()
  2025-03-10 12:08 [PATCH net-next 0/9] net: stmmac: remove unnecessary of_get_phy_mode() calls Russell King (Oracle)
@ 2025-03-10 12:10 ` Russell King (Oracle)
  2025-03-10 12:10 ` [PATCH net-next 2/9] net: stmmac: mediatek: " Russell King (Oracle)
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Russell King (Oracle) @ 2025-03-10 12:10 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit
  Cc: Alexandre Torgue, Andrew Lunn, AngeloGioacchino Del Regno,
	Chen-Yu Tsai, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Jernej Skrabec, Jerome Brunet, Kevin Hilman, linux-amlogic,
	linux-arm-kernel, linux-arm-msm, linux-mediatek, linux-stm32,
	linux-sunxi, Martin Blumenstingl, Matthias Brugger,
	Maxime Coquelin, Neil Armstrong, netdev, Paolo Abeni,
	Samuel Holland, Vinod Koul

devm_stmmac_probe_config_dt() already gets the PHY mode from firmware,
which is stored in plat_dat->phy_interface. Therefore, we don't need to
get it a second time in qcom_ethqos_probe(). Use
plat_dat->phy_interface to initialise ethqos->phy_mode.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
index eafe637540b6..0e4da216f942 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
@@ -794,9 +794,7 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
 	if (!ethqos)
 		return -ENOMEM;
 
-	ret = of_get_phy_mode(np, &ethqos->phy_mode);
-	if (ret)
-		return dev_err_probe(dev, ret, "Failed to get phy mode\n");
+	ethqos->phy_mode = plat_dat->phy_interface;
 	switch (ethqos->phy_mode) {
 	case PHY_INTERFACE_MODE_RGMII:
 	case PHY_INTERFACE_MODE_RGMII_ID:
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH net-next 2/9] net: stmmac: mediatek: remove of_get_phy_mode()
  2025-03-10 12:08 [PATCH net-next 0/9] net: stmmac: remove unnecessary of_get_phy_mode() calls Russell King (Oracle)
  2025-03-10 12:10 ` [PATCH net-next 1/9] net: stmmac: qcom-ethqos: remove of_get_phy_mode() Russell King (Oracle)
@ 2025-03-10 12:10 ` Russell King (Oracle)
  2025-03-10 12:10 ` [PATCH net-next 3/9] net: stmmac: " Russell King (Oracle)
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Russell King (Oracle) @ 2025-03-10 12:10 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit
  Cc: Alexandre Torgue, Andrew Lunn, AngeloGioacchino Del Regno,
	Chen-Yu Tsai, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Jernej Skrabec, Jerome Brunet, Kevin Hilman, linux-amlogic,
	linux-arm-kernel, linux-arm-msm, linux-mediatek, linux-stm32,
	linux-sunxi, Martin Blumenstingl, Matthias Brugger,
	Maxime Coquelin, Neil Armstrong, netdev, Paolo Abeni,
	Samuel Holland, Vinod Koul

devm_stmmac_probe_config_dt() already gets the PHY mode from firmware,
which is stored in plat_dat->phy_interface. Therefore, we don't need to
get it in platform code.

Initialise priv_plat->phy_mode from plat->phy_interface
inmediatek_dwmac_common_data().

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
index c9636832a570..d178d5ddc7c7 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
@@ -456,7 +456,6 @@ static int mediatek_dwmac_config_dt(struct mediatek_dwmac_plat_data *plat)
 {
 	struct mac_delay_struct *mac_delay = &plat->mac_delay;
 	u32 tx_delay_ps, rx_delay_ps;
-	int err;
 
 	plat->peri_regmap = syscon_regmap_lookup_by_phandle(plat->np, "mediatek,pericfg");
 	if (IS_ERR(plat->peri_regmap)) {
@@ -464,12 +463,6 @@ static int mediatek_dwmac_config_dt(struct mediatek_dwmac_plat_data *plat)
 		return PTR_ERR(plat->peri_regmap);
 	}
 
-	err = of_get_phy_mode(plat->np, &plat->phy_mode);
-	if (err) {
-		dev_err(plat->dev, "not find phy-mode\n");
-		return err;
-	}
-
 	if (!of_property_read_u32(plat->np, "mediatek,tx-delay-ps", &tx_delay_ps)) {
 		if (tx_delay_ps < plat->variant->tx_delay_max) {
 			mac_delay->tx_delay = tx_delay_ps;
@@ -587,6 +580,7 @@ static int mediatek_dwmac_common_data(struct platform_device *pdev,
 {
 	int i;
 
+	priv_plat->phy_mode = plat->phy_interface;
 	plat->mac_interface = priv_plat->phy_mode;
 	if (priv_plat->mac_wol)
 		plat->flags &= ~STMMAC_FLAG_USE_PHY_WOL;
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH net-next 3/9] net: stmmac: remove of_get_phy_mode()
  2025-03-10 12:08 [PATCH net-next 0/9] net: stmmac: remove unnecessary of_get_phy_mode() calls Russell King (Oracle)
  2025-03-10 12:10 ` [PATCH net-next 1/9] net: stmmac: qcom-ethqos: remove of_get_phy_mode() Russell King (Oracle)
  2025-03-10 12:10 ` [PATCH net-next 2/9] net: stmmac: mediatek: " Russell King (Oracle)
@ 2025-03-10 12:10 ` Russell King (Oracle)
  2025-03-11 23:35   ` kernel test robot
  2025-03-10 12:10 ` [PATCH net-next 4/9] net: stmmac: ipq806x: " Russell King (Oracle)
                   ` (6 subsequent siblings)
  9 siblings, 1 reply; 14+ messages in thread
From: Russell King (Oracle) @ 2025-03-10 12:10 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit
  Cc: Alexandre Torgue, Andrew Lunn, AngeloGioacchino Del Regno,
	Chen-Yu Tsai, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Jernej Skrabec, Jerome Brunet, Kevin Hilman, linux-amlogic,
	linux-arm-kernel, linux-arm-msm, linux-mediatek, linux-stm32,
	linux-sunxi, Martin Blumenstingl, Matthias Brugger,
	Maxime Coquelin, Neil Armstrong, netdev, Paolo Abeni,
	Samuel Holland, Vinod Koul

devm_stmmac_probe_config_dt() already gets the PHY mode from firmware,
which is stored in plat_dat->phy_interface. Therefore, we don't need to
get it in platform code.

Rearrange the initialisation order so we can pass plat_dat into
anarion_config_dt(), thereby providing plat_dat->phy_interface as
necessary there.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
 .../ethernet/stmicro/stmmac/dwmac-anarion.c    | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-anarion.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-anarion.c
index ef99ef3f1ab4..fe47a5c337f6 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-anarion.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-anarion.c
@@ -59,7 +59,9 @@ static void anarion_gmac_exit(struct platform_device *pdev, void *priv)
 	gmac_write_reg(gmac, GMAC_RESET_CONTROL_REG, 1);
 }
 
-static struct anarion_gmac *anarion_config_dt(struct platform_device *pdev)
+static struct anarion_gmac *
+anarion_config_dt(struct platform_device *pdev,
+		  struct plat_stmmacenet_data *plat_dat)
 {
 	struct anarion_gmac *gmac;
 	phy_interface_t phy_mode;
@@ -79,11 +81,7 @@ static struct anarion_gmac *anarion_config_dt(struct platform_device *pdev)
 
 	gmac->ctl_block = ctl_block;
 
-	err = of_get_phy_mode(pdev->dev.of_node, &phy_mode);
-	if (err)
-		return ERR_PTR(err);
-
-	switch (phy_mode) {
+	switch (plat_dat->phy_interface) {
 	case PHY_INTERFACE_MODE_RGMII:
 		fallthrough;
 	case PHY_INTERFACE_MODE_RGMII_ID:
@@ -111,14 +109,14 @@ static int anarion_dwmac_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	gmac = anarion_config_dt(pdev);
-	if (IS_ERR(gmac))
-		return PTR_ERR(gmac);
-
 	plat_dat = devm_stmmac_probe_config_dt(pdev, stmmac_res.mac);
 	if (IS_ERR(plat_dat))
 		return PTR_ERR(plat_dat);
 
+	gmac = anarion_config_dt(pdev, plat_dat);
+	if (IS_ERR(gmac))
+		return PTR_ERR(gmac);
+
 	plat_dat->init = anarion_gmac_init;
 	plat_dat->exit = anarion_gmac_exit;
 	anarion_gmac_init(pdev, gmac);
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH net-next 4/9] net: stmmac: ipq806x: remove of_get_phy_mode()
  2025-03-10 12:08 [PATCH net-next 0/9] net: stmmac: remove unnecessary of_get_phy_mode() calls Russell King (Oracle)
                   ` (2 preceding siblings ...)
  2025-03-10 12:10 ` [PATCH net-next 3/9] net: stmmac: " Russell King (Oracle)
@ 2025-03-10 12:10 ` Russell King (Oracle)
  2025-03-10 12:10 ` [PATCH net-next 5/9] net: stmmac: meson8b: " Russell King (Oracle)
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Russell King (Oracle) @ 2025-03-10 12:10 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit
  Cc: Alexandre Torgue, Andrew Lunn, AngeloGioacchino Del Regno,
	Chen-Yu Tsai, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Jernej Skrabec, Jerome Brunet, Kevin Hilman, linux-amlogic,
	linux-arm-kernel, linux-arm-msm, linux-mediatek, linux-stm32,
	linux-sunxi, Martin Blumenstingl, Matthias Brugger,
	Maxime Coquelin, Neil Armstrong, netdev, Paolo Abeni,
	Samuel Holland, Vinod Koul

devm_stmmac_probe_config_dt() already gets the PHY mode from firmware,
which is stored in plat_dat->phy_interface. Therefore, we don't need to
get it in platform code.

Pass plat_dat into ipq806x_gmac_of_parse(), and set gmac->phy_mode from
plat_dat->phy_interface.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c
index 0a9c137cc4e6..ca4035cbb55b 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c
@@ -211,16 +211,12 @@ static int ipq806x_gmac_set_speed(struct ipq806x_gmac *gmac, int speed)
 	return 0;
 }
 
-static int ipq806x_gmac_of_parse(struct ipq806x_gmac *gmac)
+static int ipq806x_gmac_of_parse(struct ipq806x_gmac *gmac,
+				 struct plat_stmmacenet_data *plat_dat)
 {
 	struct device *dev = &gmac->pdev->dev;
-	int ret;
 
-	ret = of_get_phy_mode(dev->of_node, &gmac->phy_mode);
-	if (ret) {
-		dev_err(dev, "missing phy mode property\n");
-		return -EINVAL;
-	}
+	gmac->phy_mode = plat_dat->phy_interface;
 
 	if (of_property_read_u32(dev->of_node, "qcom,id", &gmac->id) < 0) {
 		dev_err(dev, "missing qcom id property\n");
@@ -398,7 +394,7 @@ static int ipq806x_gmac_probe(struct platform_device *pdev)
 
 	gmac->pdev = pdev;
 
-	err = ipq806x_gmac_of_parse(gmac);
+	err = ipq806x_gmac_of_parse(gmac, plat_dat);
 	if (err) {
 		dev_err(dev, "device tree parsing error\n");
 		return err;
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH net-next 5/9] net: stmmac: meson8b: remove of_get_phy_mode()
  2025-03-10 12:08 [PATCH net-next 0/9] net: stmmac: remove unnecessary of_get_phy_mode() calls Russell King (Oracle)
                   ` (3 preceding siblings ...)
  2025-03-10 12:10 ` [PATCH net-next 4/9] net: stmmac: ipq806x: " Russell King (Oracle)
@ 2025-03-10 12:10 ` Russell King (Oracle)
  2025-03-10 12:10 ` [PATCH net-next 6/9] net: stmmac: rk: " Russell King (Oracle)
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Russell King (Oracle) @ 2025-03-10 12:10 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit
  Cc: Alexandre Torgue, Andrew Lunn, AngeloGioacchino Del Regno,
	Chen-Yu Tsai, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Jernej Skrabec, Jerome Brunet, Kevin Hilman, linux-amlogic,
	linux-arm-kernel, linux-arm-msm, linux-mediatek, linux-stm32,
	linux-sunxi, Martin Blumenstingl, Matthias Brugger,
	Maxime Coquelin, Neil Armstrong, netdev, Paolo Abeni,
	Samuel Holland, Vinod Koul

devm_stmmac_probe_config_dt() already gets the PHY mode from firmware,
which is stored in plat_dat->phy_interface. Therefore, we don't need to
get it in platform code.

Set dwmac->phy_mode from plat_dat->phy_interface.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c
index 9c2d62d133ad..a50782994b97 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c
@@ -417,11 +417,7 @@ static int meson8b_dwmac_probe(struct platform_device *pdev)
 		return PTR_ERR(dwmac->regs);
 
 	dwmac->dev = &pdev->dev;
-	ret = of_get_phy_mode(pdev->dev.of_node, &dwmac->phy_mode);
-	if (ret) {
-		dev_err(&pdev->dev, "missing phy-mode property\n");
-		return ret;
-	}
+	dwmac->phy_mode = plat_dat->phy_interface;
 
 	/* use 2ns as fallback since this value was previously hardcoded */
 	if (of_property_read_u32(pdev->dev.of_node, "amlogic,tx-delay-ns",
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH net-next 6/9] net: stmmac: rk: remove of_get_phy_mode()
  2025-03-10 12:08 [PATCH net-next 0/9] net: stmmac: remove unnecessary of_get_phy_mode() calls Russell King (Oracle)
                   ` (4 preceding siblings ...)
  2025-03-10 12:10 ` [PATCH net-next 5/9] net: stmmac: meson8b: " Russell King (Oracle)
@ 2025-03-10 12:10 ` Russell King (Oracle)
  2025-03-10 12:10 ` [PATCH net-next 7/9] net: stmmac: sti: " Russell King (Oracle)
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Russell King (Oracle) @ 2025-03-10 12:10 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit
  Cc: Alexandre Torgue, Andrew Lunn, AngeloGioacchino Del Regno,
	Chen-Yu Tsai, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Jernej Skrabec, Jerome Brunet, Kevin Hilman, linux-amlogic,
	linux-arm-kernel, linux-arm-msm, linux-mediatek, linux-stm32,
	linux-sunxi, Martin Blumenstingl, Matthias Brugger,
	Maxime Coquelin, Neil Armstrong, netdev, Paolo Abeni,
	Samuel Holland, Vinod Koul

devm_stmmac_probe_config_dt() already gets the PHY mode from firmware,
which is stored in plat_dat->phy_interface. Therefore, we don't need to
get it in platform code.

Set bsp_priv->phy_iface from plat->phy_interface.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
index 003fa5cf42c3..40e8197812e2 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
@@ -1749,7 +1749,7 @@ static struct rk_priv_data *rk_gmac_setup(struct platform_device *pdev,
 	if (!bsp_priv)
 		return ERR_PTR(-ENOMEM);
 
-	of_get_phy_mode(dev->of_node, &bsp_priv->phy_iface);
+	bsp_priv->phy_iface = plat->phy_interface;
 	bsp_priv->ops = ops;
 
 	/* Some SoCs have multiple MAC controllers, which need
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH net-next 7/9] net: stmmac: sti: remove of_get_phy_mode()
  2025-03-10 12:08 [PATCH net-next 0/9] net: stmmac: remove unnecessary of_get_phy_mode() calls Russell King (Oracle)
                   ` (5 preceding siblings ...)
  2025-03-10 12:10 ` [PATCH net-next 6/9] net: stmmac: rk: " Russell King (Oracle)
@ 2025-03-10 12:10 ` Russell King (Oracle)
  2025-03-10 12:10 ` [PATCH net-next 8/9] net: stmmac: sun8i: " Russell King (Oracle)
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Russell King (Oracle) @ 2025-03-10 12:10 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit
  Cc: Alexandre Torgue, Andrew Lunn, AngeloGioacchino Del Regno,
	Chen-Yu Tsai, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Jernej Skrabec, Jerome Brunet, Kevin Hilman, linux-amlogic,
	linux-arm-kernel, linux-arm-msm, linux-mediatek, linux-stm32,
	linux-sunxi, Martin Blumenstingl, Matthias Brugger,
	Maxime Coquelin, Neil Armstrong, netdev, Paolo Abeni,
	Samuel Holland, Vinod Koul

devm_stmmac_probe_config_dt() already gets the PHY mode from firmware,
which is stored in plat_dat->phy_interface. Therefore, we don't need to
get it in platform code.

Pass plat_dat into sti_dwmac_parse_data(), and set dwmac->interface
from plat_dat->phy_interface.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c
index 13b9c2a51fce..be57c6c12c1c 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c
@@ -185,7 +185,8 @@ static int sti_dwmac_set_mode(struct sti_dwmac *dwmac)
 }
 
 static int sti_dwmac_parse_data(struct sti_dwmac *dwmac,
-				struct platform_device *pdev)
+				struct platform_device *pdev,
+				struct plat_stmmacenet_data *plat_dat)
 {
 	struct resource *res;
 	struct device *dev = &pdev->dev;
@@ -204,12 +205,7 @@ static int sti_dwmac_parse_data(struct sti_dwmac *dwmac,
 	if (IS_ERR(regmap))
 		return PTR_ERR(regmap);
 
-	err = of_get_phy_mode(np, &dwmac->interface);
-	if (err && err != -ENODEV) {
-		dev_err(dev, "Can't get phy-mode\n");
-		return err;
-	}
-
+	dwmac->interface = plat_dat->phy_interface;
 	dwmac->regmap = regmap;
 	dwmac->gmac_en = of_property_read_bool(np, "st,gmac_en");
 	dwmac->ext_phyclk = of_property_read_bool(np, "st,ext-phyclk");
@@ -268,7 +264,7 @@ static int sti_dwmac_probe(struct platform_device *pdev)
 	if (!dwmac)
 		return -ENOMEM;
 
-	ret = sti_dwmac_parse_data(dwmac, pdev);
+	ret = sti_dwmac_parse_data(dwmac, pdev, plat_dat);
 	if (ret) {
 		dev_err(&pdev->dev, "Unable to parse OF data\n");
 		return ret;
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH net-next 8/9] net: stmmac: sun8i: remove of_get_phy_mode()
  2025-03-10 12:08 [PATCH net-next 0/9] net: stmmac: remove unnecessary of_get_phy_mode() calls Russell King (Oracle)
                   ` (6 preceding siblings ...)
  2025-03-10 12:10 ` [PATCH net-next 7/9] net: stmmac: sti: " Russell King (Oracle)
@ 2025-03-10 12:10 ` Russell King (Oracle)
  2025-03-10 13:38   ` Andre Przywara
  2025-03-10 12:10 ` [PATCH net-next 9/9] net: stmmac: sunxi: " Russell King (Oracle)
  2025-03-10 13:42 ` [PATCH net-next 0/9] net: stmmac: remove unnecessary of_get_phy_mode() calls Michal Kubiak
  9 siblings, 1 reply; 14+ messages in thread
From: Russell King (Oracle) @ 2025-03-10 12:10 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit
  Cc: Alexandre Torgue, Andrew Lunn, AngeloGioacchino Del Regno,
	Chen-Yu Tsai, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Jernej Skrabec, Jerome Brunet, Kevin Hilman, linux-amlogic,
	linux-arm-kernel, linux-arm-msm, linux-mediatek, linux-stm32,
	linux-sunxi, Martin Blumenstingl, Matthias Brugger,
	Maxime Coquelin, Neil Armstrong, netdev, Paolo Abeni,
	Samuel Holland, Vinod Koul

devm_stmmac_probe_config_dt() already gets the PHY mode from firmware,
which is stored in plat_dat->phy_interface. Therefore, we don't need to
get it in platform code.

sun8i was using of_get_phy_mode() to set plat_dat->mac_interface, which
defaults to plat_dat->phy_interface when the mac-mode DT property is
not present. As nothing in arch/*/boot/dts sets the mac-mode property,
it is highly likely that these two will be identical, and thus there
is no need for this glue driver to set plat_dat->mac_interface.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
index 4b7b2582a120..85723a78793a 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
@@ -1155,11 +1155,10 @@ static int sun8i_dwmac_probe(struct platform_device *pdev)
 	struct stmmac_resources stmmac_res;
 	struct sunxi_priv_data *gmac;
 	struct device *dev = &pdev->dev;
-	phy_interface_t interface;
-	int ret;
 	struct stmmac_priv *priv;
 	struct net_device *ndev;
 	struct regmap *regmap;
+	int ret;
 
 	ret = stmmac_get_platform_resources(pdev, &stmmac_res);
 	if (ret)
@@ -1219,10 +1218,6 @@ static int sun8i_dwmac_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	ret = of_get_phy_mode(dev->of_node, &interface);
-	if (ret)
-		return -EINVAL;
-
 	plat_dat = devm_stmmac_probe_config_dt(pdev, stmmac_res.mac);
 	if (IS_ERR(plat_dat))
 		return PTR_ERR(plat_dat);
@@ -1230,7 +1225,6 @@ static int sun8i_dwmac_probe(struct platform_device *pdev)
 	/* platform data specifying hardware features and callbacks.
 	 * hardware features were copied from Allwinner drivers.
 	 */
-	plat_dat->mac_interface = interface;
 	plat_dat->rx_coe = STMMAC_RX_COE_TYPE2;
 	plat_dat->tx_coe = 1;
 	plat_dat->flags |= STMMAC_FLAG_HAS_SUN8I;
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH net-next 9/9] net: stmmac: sunxi: remove of_get_phy_mode()
  2025-03-10 12:08 [PATCH net-next 0/9] net: stmmac: remove unnecessary of_get_phy_mode() calls Russell King (Oracle)
                   ` (7 preceding siblings ...)
  2025-03-10 12:10 ` [PATCH net-next 8/9] net: stmmac: sun8i: " Russell King (Oracle)
@ 2025-03-10 12:10 ` Russell King (Oracle)
  2025-03-10 16:05   ` Jernej Škrabec
  2025-03-10 13:42 ` [PATCH net-next 0/9] net: stmmac: remove unnecessary of_get_phy_mode() calls Michal Kubiak
  9 siblings, 1 reply; 14+ messages in thread
From: Russell King (Oracle) @ 2025-03-10 12:10 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit
  Cc: Alexandre Torgue, Andrew Lunn, AngeloGioacchino Del Regno,
	Chen-Yu Tsai, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Jernej Skrabec, Jerome Brunet, Kevin Hilman, linux-amlogic,
	linux-arm-kernel, linux-arm-msm, linux-mediatek, linux-stm32,
	linux-sunxi, Martin Blumenstingl, Matthias Brugger,
	Maxime Coquelin, Neil Armstrong, netdev, Paolo Abeni,
	Samuel Holland, Vinod Koul

devm_stmmac_probe_config_dt() already gets the PHY mode from firmware,
which is stored in plat_dat->phy_interface. Therefore, we don't need to
get it in platform code.

Set gmac->interface from plat_dat->phy_interface.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c
index 1b1ce2888b2e..9f098ff0ff05 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c
@@ -116,11 +116,7 @@ static int sun7i_gmac_probe(struct platform_device *pdev)
 	if (!gmac)
 		return -ENOMEM;
 
-	ret = of_get_phy_mode(dev->of_node, &gmac->interface);
-	if (ret && ret != -ENODEV) {
-		dev_err(dev, "Can't get phy-mode\n");
-		return ret;
-	}
+	gmac->interface = plat_dat->phy_interface;
 
 	gmac->tx_clk = devm_clk_get(dev, "allwinner_gmac_tx");
 	if (IS_ERR(gmac->tx_clk)) {
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH net-next 8/9] net: stmmac: sun8i: remove of_get_phy_mode()
  2025-03-10 12:10 ` [PATCH net-next 8/9] net: stmmac: sun8i: " Russell King (Oracle)
@ 2025-03-10 13:38   ` Andre Przywara
  0 siblings, 0 replies; 14+ messages in thread
From: Andre Przywara @ 2025-03-10 13:38 UTC (permalink / raw)
  To: Russell King (Oracle)
  Cc: Andrew Lunn, Heiner Kallweit, Alexandre Torgue, Andrew Lunn,
	AngeloGioacchino Del Regno, Chen-Yu Tsai, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Jernej Skrabec, Jerome Brunet,
	Kevin Hilman, linux-amlogic, linux-arm-kernel, linux-arm-msm,
	linux-mediatek, linux-stm32, linux-sunxi, Martin Blumenstingl,
	Matthias Brugger, Maxime Coquelin, Neil Armstrong, netdev,
	Paolo Abeni, Samuel Holland, Vinod Koul

On Mon, 10 Mar 2025 12:10:54 +0000
"Russell King (Oracle)" <rmk+kernel@armlinux.org.uk> wrote:

Hi,

> devm_stmmac_probe_config_dt() already gets the PHY mode from firmware,
> which is stored in plat_dat->phy_interface. Therefore, we don't need to
> get it in platform code.
> 
> sun8i was using of_get_phy_mode() to set plat_dat->mac_interface, which
> defaults to plat_dat->phy_interface when the mac-mode DT property is
> not present. As nothing in arch/*/boot/dts sets the mac-mode property,
> it is highly likely that these two will be identical, and thus there
> is no need for this glue driver to set plat_dat->mac_interface.

Well, the current sun8i code wouldn't help anyway, because the driver
would set mac_interface to the value of "phy-mode", not "mac-mode", which
is strictly speaking a bug.
But in any case this is indeed redundant, so:

> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

Reviewed-by: Andre Przywara <andre.przywara@arm.com>

Cheers,
Andre

> ---
>  drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
> index 4b7b2582a120..85723a78793a 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
> @@ -1155,11 +1155,10 @@ static int sun8i_dwmac_probe(struct platform_device *pdev)
>  	struct stmmac_resources stmmac_res;
>  	struct sunxi_priv_data *gmac;
>  	struct device *dev = &pdev->dev;
> -	phy_interface_t interface;
> -	int ret;
>  	struct stmmac_priv *priv;
>  	struct net_device *ndev;
>  	struct regmap *regmap;
> +	int ret;
>  
>  	ret = stmmac_get_platform_resources(pdev, &stmmac_res);
>  	if (ret)
> @@ -1219,10 +1218,6 @@ static int sun8i_dwmac_probe(struct platform_device *pdev)
>  		return ret;
>  	}
>  
> -	ret = of_get_phy_mode(dev->of_node, &interface);
> -	if (ret)
> -		return -EINVAL;
> -
>  	plat_dat = devm_stmmac_probe_config_dt(pdev, stmmac_res.mac);
>  	if (IS_ERR(plat_dat))
>  		return PTR_ERR(plat_dat);
> @@ -1230,7 +1225,6 @@ static int sun8i_dwmac_probe(struct platform_device *pdev)
>  	/* platform data specifying hardware features and callbacks.
>  	 * hardware features were copied from Allwinner drivers.
>  	 */
> -	plat_dat->mac_interface = interface;
>  	plat_dat->rx_coe = STMMAC_RX_COE_TYPE2;
>  	plat_dat->tx_coe = 1;
>  	plat_dat->flags |= STMMAC_FLAG_HAS_SUN8I;


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH net-next 0/9] net: stmmac: remove unnecessary of_get_phy_mode() calls
  2025-03-10 12:08 [PATCH net-next 0/9] net: stmmac: remove unnecessary of_get_phy_mode() calls Russell King (Oracle)
                   ` (8 preceding siblings ...)
  2025-03-10 12:10 ` [PATCH net-next 9/9] net: stmmac: sunxi: " Russell King (Oracle)
@ 2025-03-10 13:42 ` Michal Kubiak
  9 siblings, 0 replies; 14+ messages in thread
From: Michal Kubiak @ 2025-03-10 13:42 UTC (permalink / raw)
  To: Russell King (Oracle)
  Cc: Andrew Lunn, Heiner Kallweit, Alexandre Torgue, Andrew Lunn,
	AngeloGioacchino Del Regno, Chen-Yu Tsai, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Jernej Skrabec, Jerome Brunet,
	Kevin Hilman, linux-amlogic, linux-arm-kernel, linux-arm-msm,
	linux-mediatek, linux-stm32, linux-sunxi, Martin Blumenstingl,
	Matthias Brugger, Maxime Coquelin, Neil Armstrong, netdev,
	Paolo Abeni, Samuel Holland, Vinod Koul

On Mon, Mar 10, 2025 at 12:08:54PM +0000, Russell King (Oracle) wrote:
> Hi,
> 
> This series removes unnecessary of_get_phy_mode() calls from the stmmac
> glue drivers. stmmac_probe_config_dt() / devm_stmmac_probe_config_dt()
> already gets the interface mode using device_get_phy_mode() and stores
> it in plat_dat->phy_interface.
> 
> Therefore, glue drivers using of_get_phy_mode() are just duplicating
> the work that has already been done.
> 
> This series adjusts the glue drivers to remove their usage of
> of_get_phy_mode().
> 

The series looks reasonable.

Thanks,
Michal

For the series:
Reviewed-by: Michal Kubiak <michal.kubiak@intel.com>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH net-next 9/9] net: stmmac: sunxi: remove of_get_phy_mode()
  2025-03-10 12:10 ` [PATCH net-next 9/9] net: stmmac: sunxi: " Russell King (Oracle)
@ 2025-03-10 16:05   ` Jernej Škrabec
  0 siblings, 0 replies; 14+ messages in thread
From: Jernej Škrabec @ 2025-03-10 16:05 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit, Russell King (Oracle)
  Cc: Alexandre Torgue, Andrew Lunn, AngeloGioacchino Del Regno,
	Chen-Yu Tsai, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Jerome Brunet, Kevin Hilman, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-mediatek, linux-stm32, linux-sunxi,
	Martin Blumenstingl, Matthias Brugger, Maxime Coquelin,
	Neil Armstrong, netdev, Paolo Abeni, Samuel Holland, Vinod Koul

Dne ponedeljek, 10. marec 2025 ob 13:10:59 Srednjeevropski standardni čas je Russell King (Oracle) napisal(a):
> devm_stmmac_probe_config_dt() already gets the PHY mode from firmware,
> which is stored in plat_dat->phy_interface. Therefore, we don't need to
> get it in platform code.
> 
> Set gmac->interface from plat_dat->phy_interface.
> 
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>

Best regards,
Jernej



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH net-next 3/9] net: stmmac: remove of_get_phy_mode()
  2025-03-10 12:10 ` [PATCH net-next 3/9] net: stmmac: " Russell King (Oracle)
@ 2025-03-11 23:35   ` kernel test robot
  0 siblings, 0 replies; 14+ messages in thread
From: kernel test robot @ 2025-03-11 23:35 UTC (permalink / raw)
  To: Russell King (Oracle), Andrew Lunn, Heiner Kallweit
  Cc: llvm, oe-kbuild-all, Alexandre Torgue, AngeloGioacchino Del Regno,
	Chen-Yu Tsai, Eric Dumazet, Jakub Kicinski, Jernej Skrabec,
	Jerome Brunet, Kevin Hilman, linux-amlogic, linux-arm-kernel,
	linux-arm-msm, linux-mediatek, linux-stm32, linux-sunxi,
	Martin Blumenstingl, Matthias Brugger, Maxime Coquelin,
	Neil Armstrong, netdev, Paolo Abeni, Samuel Holland, Vinod Koul

Hi Russell,

kernel test robot noticed the following build warnings:

[auto build test WARNING on net-next/main]

url:    https://github.com/intel-lab-lkp/linux/commits/Russell-King-Oracle/net-stmmac-qcom-ethqos-remove-of_get_phy_mode/20250311-001446
base:   net-next/main
patch link:    https://lore.kernel.org/r/E1trbxk-005qYA-Up%40rmk-PC.armlinux.org.uk
patch subject: [PATCH net-next 3/9] net: stmmac: remove of_get_phy_mode()
config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20250312/202503120741.lpX5066n-lkp@intel.com/config)
compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250312/202503120741.lpX5066n-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202503120741.lpX5066n-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from drivers/net/ethernet/stmicro/stmmac/dwmac-anarion.c:11:
   In file included from include/linux/of_net.h:9:
   In file included from include/linux/phy.h:16:
   In file included from include/linux/ethtool.h:18:
   In file included from include/linux/if_ether.h:19:
   In file included from include/linux/skbuff.h:17:
   In file included from include/linux/bvec.h:10:
   In file included from include/linux/highmem.h:10:
   In file included from include/linux/mm.h:2224:
   include/linux/vmstat.h:504:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     504 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     505 |                            item];
         |                            ~~~~
   include/linux/vmstat.h:511:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     511 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     512 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmstat.h:524:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     524 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     525 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
>> drivers/net/ethernet/stmicro/stmmac/dwmac-anarion.c:94:4: warning: variable 'phy_mode' is uninitialized when used here [-Wuninitialized]
      94 |                         phy_mode);
         |                         ^~~~~~~~
   include/linux/dev_printk.h:154:65: note: expanded from macro 'dev_err'
     154 |         dev_printk_index_wrap(_dev_err, KERN_ERR, dev, dev_fmt(fmt), ##__VA_ARGS__)
         |                                                                        ^~~~~~~~~~~
   include/linux/dev_printk.h:110:23: note: expanded from macro 'dev_printk_index_wrap'
     110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
         |                                     ^~~~~~~~~~~
   drivers/net/ethernet/stmicro/stmmac/dwmac-anarion.c:67:2: note: variable 'phy_mode' is declared here
      67 |         phy_interface_t phy_mode;
         |         ^
   4 warnings generated.


vim +/phy_mode +94 drivers/net/ethernet/stmicro/stmmac/dwmac-anarion.c

2d1611aff3f22a5 Alexandru Gagniuc     2017-08-04   61  
41b984be408c088 Russell King (Oracle  2025-03-10   62) static struct anarion_gmac *
41b984be408c088 Russell King (Oracle  2025-03-10   63) anarion_config_dt(struct platform_device *pdev,
41b984be408c088 Russell King (Oracle  2025-03-10   64) 		  struct plat_stmmacenet_data *plat_dat)
2d1611aff3f22a5 Alexandru Gagniuc     2017-08-04   65  {
2d1611aff3f22a5 Alexandru Gagniuc     2017-08-04   66  	struct anarion_gmac *gmac;
0c65b2b90d13c1d Andrew Lunn           2019-11-04   67  	phy_interface_t phy_mode;
0c65b2b90d13c1d Andrew Lunn           2019-11-04   68  	void __iomem *ctl_block;
0c65b2b90d13c1d Andrew Lunn           2019-11-04   69  	int err;
2d1611aff3f22a5 Alexandru Gagniuc     2017-08-04   70  
ad124aa34e51439 YueHaibing            2019-08-21   71  	ctl_block = devm_platform_ioremap_resource(pdev, 1);
2d1611aff3f22a5 Alexandru Gagniuc     2017-08-04   72  	if (IS_ERR(ctl_block)) {
51fe084b17e795f Simon Horman          2023-04-06   73  		err = PTR_ERR(ctl_block);
51fe084b17e795f Simon Horman          2023-04-06   74  		dev_err(&pdev->dev, "Cannot get reset region (%d)!\n", err);
51fe084b17e795f Simon Horman          2023-04-06   75  		return ERR_PTR(err);
2d1611aff3f22a5 Alexandru Gagniuc     2017-08-04   76  	}
2d1611aff3f22a5 Alexandru Gagniuc     2017-08-04   77  
2d1611aff3f22a5 Alexandru Gagniuc     2017-08-04   78  	gmac = devm_kzalloc(&pdev->dev, sizeof(*gmac), GFP_KERNEL);
2d1611aff3f22a5 Alexandru Gagniuc     2017-08-04   79  	if (!gmac)
2d1611aff3f22a5 Alexandru Gagniuc     2017-08-04   80  		return ERR_PTR(-ENOMEM);
2d1611aff3f22a5 Alexandru Gagniuc     2017-08-04   81  
9f12541d684b925 Simon Horman          2023-04-06   82  	gmac->ctl_block = ctl_block;
2d1611aff3f22a5 Alexandru Gagniuc     2017-08-04   83  
41b984be408c088 Russell King (Oracle  2025-03-10   84) 	switch (plat_dat->phy_interface) {
df561f6688fef77 Gustavo A. R. Silva   2020-08-23   85  	case PHY_INTERFACE_MODE_RGMII:
df561f6688fef77 Gustavo A. R. Silva   2020-08-23   86  		fallthrough;
df561f6688fef77 Gustavo A. R. Silva   2020-08-23   87  	case PHY_INTERFACE_MODE_RGMII_ID:
df561f6688fef77 Gustavo A. R. Silva   2020-08-23   88  	case PHY_INTERFACE_MODE_RGMII_RXID:
2d1611aff3f22a5 Alexandru Gagniuc     2017-08-04   89  	case PHY_INTERFACE_MODE_RGMII_TXID:
2d1611aff3f22a5 Alexandru Gagniuc     2017-08-04   90  		gmac->phy_intf_sel = GMAC_CONFIG_INTF_RGMII;
2d1611aff3f22a5 Alexandru Gagniuc     2017-08-04   91  		break;
2d1611aff3f22a5 Alexandru Gagniuc     2017-08-04   92  	default:
2d1611aff3f22a5 Alexandru Gagniuc     2017-08-04   93  		dev_err(&pdev->dev, "Unsupported phy-mode (%d)\n",
2d1611aff3f22a5 Alexandru Gagniuc     2017-08-04  @94  			phy_mode);
2d1611aff3f22a5 Alexandru Gagniuc     2017-08-04   95  		return ERR_PTR(-ENOTSUPP);
2d1611aff3f22a5 Alexandru Gagniuc     2017-08-04   96  	}
2d1611aff3f22a5 Alexandru Gagniuc     2017-08-04   97  
2d1611aff3f22a5 Alexandru Gagniuc     2017-08-04   98  	return gmac;
2d1611aff3f22a5 Alexandru Gagniuc     2017-08-04   99  }
2d1611aff3f22a5 Alexandru Gagniuc     2017-08-04  100  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2025-03-11 23:35 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-10 12:08 [PATCH net-next 0/9] net: stmmac: remove unnecessary of_get_phy_mode() calls Russell King (Oracle)
2025-03-10 12:10 ` [PATCH net-next 1/9] net: stmmac: qcom-ethqos: remove of_get_phy_mode() Russell King (Oracle)
2025-03-10 12:10 ` [PATCH net-next 2/9] net: stmmac: mediatek: " Russell King (Oracle)
2025-03-10 12:10 ` [PATCH net-next 3/9] net: stmmac: " Russell King (Oracle)
2025-03-11 23:35   ` kernel test robot
2025-03-10 12:10 ` [PATCH net-next 4/9] net: stmmac: ipq806x: " Russell King (Oracle)
2025-03-10 12:10 ` [PATCH net-next 5/9] net: stmmac: meson8b: " Russell King (Oracle)
2025-03-10 12:10 ` [PATCH net-next 6/9] net: stmmac: rk: " Russell King (Oracle)
2025-03-10 12:10 ` [PATCH net-next 7/9] net: stmmac: sti: " Russell King (Oracle)
2025-03-10 12:10 ` [PATCH net-next 8/9] net: stmmac: sun8i: " Russell King (Oracle)
2025-03-10 13:38   ` Andre Przywara
2025-03-10 12:10 ` [PATCH net-next 9/9] net: stmmac: sunxi: " Russell King (Oracle)
2025-03-10 16:05   ` Jernej Škrabec
2025-03-10 13:42 ` [PATCH net-next 0/9] net: stmmac: remove unnecessary of_get_phy_mode() calls Michal Kubiak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).