lkml.org 
[lkml]   [2021]   [Oct]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRe: [PATCH] net: macb: Fix mdio child node detection
Date
On 26.10.2021 20:39, Guenter Roeck wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
> Commit 4d98bb0d7ec2 ("net: macb: Use mdio child node for MDIO bus if it
> exists") added code to detect if a 'mdio' child node exists to the macb
> driver. Ths added code does, however, not actually check if the child node
> exists, but if the parent node exists. This results in errors such as
>
> macb 10090000.ethernet eth0: Could not attach PHY (-19)
>
> if there is no 'mdio' child node. Fix the code to actually check for
> the child node.
>
> Fixes: 4d98bb0d7ec2 ("net: macb: Use mdio child node for MDIO bus if it exists")
> Cc: Sean Anderson <sean.anderson@seco.com>
> Cc: Andrew Lunn <andrew@lunn.ch>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>> ---

Patch solves the failure also on sama5d2_xplained. You can add:

Tested-by: Claudiu Beznea <claudiu.beznea@microchip.com>

Thank you,
Claudiu Beznea

> drivers/net/ethernet/cadence/macb_main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
> index 309371abfe23..ffce528aa00e 100644
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -901,7 +901,7 @@ static int macb_mdiobus_register(struct macb *bp)
> * directly under the MAC node
> */
> child = of_get_child_by_name(np, "mdio");
> - if (np) {
> + if (child) {
> int ret = of_mdiobus_register(bp->mii_bus, child);
>
> of_node_put(child);
> --
> 2.33.0
>

\
 
 \ /
  Last update: 2021-10-27 10:39    [W:0.068 / U:0.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site