Re: [PATCH net-next v3 1/4] phylib: Add device reset delay support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Hi Richard

> +++ b/drivers/of/of_mdio.c
> @@ -77,6 +77,14 @@ static int of_mdiobus_register_phy(struct mii_bus *mdio,
>  	if (of_property_read_bool(child, "broken-turn-around"))
>  		mdio->phy_ignore_ta_mask |= 1 << addr;
>  
> +	if (of_property_read_u32(child, "reset-delay-us",
> +				 &phy->mdio.reset_delay))
> +		phy->mdio.reset_delay = 0;
> +
> +	if (of_property_read_u32(child, "reset-post-delay-us",
> +				 &phy->mdio.reset_post_delay))
> +		phy->mdio.reset_post_delay = 0;

of_property_read_u32() should not change the variable you pass to it,
if it does not find the property. So you can change this to:

	phy->mdio.reset_delay = 0;
	phy->mdio.reset_post_delay = 0;

	of_property_read_u32(child, "reset-delay-us",
			     &phy->mdio.reset_delay);

	of_property_read_u32(child, "reset-post-delay-us",
			     &phy->mdio.reset_post_delay);


     Andrew
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux