* [PATCH v2 net-next] net: mscc: ocelot: omit error check from of_get_phy_mode
@ 2019-11-15 10:11 Horatiu Vultur
2019-11-16 21:02 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Horatiu Vultur @ 2019-11-15 10:11 UTC (permalink / raw)
To: alexandre.belloni, UNGLinuxDriver, davem, netdev, linux-kernel
Cc: Horatiu Vultur
The commit 0c65b2b90d13c ("net: of_get_phy_mode: Change API to solve
int/unit warnings") updated the function of_get_phy_mode declaration.
Now it returns an error code and in case the node doesn't contain the
property 'phy-mode' or 'phy-connection-type' it returns -EINVAL and would
set the phy_interface_t to PHY_INTERFACE_MODE_NA.
Ocelot VSC7514 has 4 internal phys which have the phy interface
PHY_INTERFACE_MODE_NA. So because of_get_phy_mode would assign
PHY_INTERFACE_MODE_NA to phy_mode when there is an error, there is no need
to add the error check.
Updates for v2:
- drop error check because of_get_phy_mode already assigns phy_interface
to PHY_INTERFACE_MODE in case of error.
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
---
drivers/net/ethernet/mscc/ocelot_board.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/mscc/ocelot_board.c b/drivers/net/ethernet/mscc/ocelot_board.c
index 811599f32910..7fe25cadc171 100644
--- a/drivers/net/ethernet/mscc/ocelot_board.c
+++ b/drivers/net/ethernet/mscc/ocelot_board.c
@@ -410,9 +410,7 @@ static int mscc_ocelot_probe(struct platform_device *pdev)
priv = container_of(ocelot_port, struct ocelot_port_private,
port);
- err = of_get_phy_mode(portnp, &phy_mode);
- if (err && err != -ENODEV)
- goto out_put_ports;
+ of_get_phy_mode(portnp, &phy_mode);
priv->phy_mode = phy_mode;
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2 net-next] net: mscc: ocelot: omit error check from of_get_phy_mode
2019-11-15 10:11 [PATCH v2 net-next] net: mscc: ocelot: omit error check from of_get_phy_mode Horatiu Vultur
@ 2019-11-16 21:02 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-11-16 21:02 UTC (permalink / raw)
To: horatiu.vultur; +Cc: alexandre.belloni, UNGLinuxDriver, netdev, linux-kernel
From: Horatiu Vultur <horatiu.vultur@microchip.com>
Date: Fri, 15 Nov 2019 11:11:15 +0100
> The commit 0c65b2b90d13c ("net: of_get_phy_mode: Change API to solve
> int/unit warnings") updated the function of_get_phy_mode declaration.
> Now it returns an error code and in case the node doesn't contain the
> property 'phy-mode' or 'phy-connection-type' it returns -EINVAL and would
> set the phy_interface_t to PHY_INTERFACE_MODE_NA.
>
> Ocelot VSC7514 has 4 internal phys which have the phy interface
> PHY_INTERFACE_MODE_NA. So because of_get_phy_mode would assign
> PHY_INTERFACE_MODE_NA to phy_mode when there is an error, there is no need
> to add the error check.
>
> Updates for v2:
> - drop error check because of_get_phy_mode already assigns phy_interface
> to PHY_INTERFACE_MODE in case of error.
>
> Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Applied, thank you.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-11-16 21:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-15 10:11 [PATCH v2 net-next] net: mscc: ocelot: omit error check from of_get_phy_mode Horatiu Vultur
2019-11-16 21:02 ` David Miller
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).