[PATCH v2 1/8] phy: generic: add error trace to detect PHY issue in uclass

Marek Vasut marex at denx.de
Tue Feb 18 18:40:22 CET 2020


On 2/18/20 9:38 AM, Patrick Delaunay wrote:
[...]
>  static inline struct phy_ops *phy_dev_ops(struct udevice *dev)
>  {
> @@ -109,56 +110,86 @@ int generic_phy_get_by_name(struct udevice *dev, const char *phy_name,
>  int generic_phy_init(struct phy *phy)
>  {
>  	struct phy_ops const *ops;
> +	int ret;
>  
>  	if (!phy)
>  		return 0;
>  	ops = phy_dev_ops(phy->dev);
>  
> -	return ops->init ? ops->init(phy) : 0;
> +	ret = ops->init ? ops->init(phy) : 0;

if (!ops->init)
   return 0;
ret = ops->init();
if (ret)
   dev_err...

return ret;

Please fix globally.

> +	if (ret)
> +		dev_err(phy->dev, "PHY: Failed to init %s: %d.\n",
> +			phy->dev->name, ret);
> +
> +	return ret;
[...]


More information about the U-Boot mailing list