Re: [PATCH v1] net: phy: print error messages to log

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

 



Hello Johannes,

On 08.05.23 15:35, Johannes Zink wrote:
> Previously the phy core did just print info and error messages to
> console, but they did not show up in the system log.
> 
> Now the pr_info and pr_err macros are used instead of raw puts,
> they are now nicely formatted and show up in the log.
> 
> Signed-off-by: Johannes Zink <j.zink@xxxxxxxxxxxxxx>

Thanks for your patch.

> ---
>  drivers/net/phy/phy.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
> index 54dbbca7255a..64e7e33254e2 100644
> --- a/drivers/net/phy/phy.c
> +++ b/drivers/net/phy/phy.c
> @@ -462,7 +462,7 @@ int phy_device_connect(struct eth_device *edev, struct mii_bus *bus, int addr,
>  	ret = -ENODEV;
>  out:
>  	if (ret)
> -		puts("Unable to find a PHY (unknown ID?)\n");
> +		pr_err("Unable to find a PHY (unknown ID?)\n");

Please use dev_err(&edev->dev, instead

>  
>  	return ret;
>  }
> @@ -675,7 +675,7 @@ int genphy_aneg_done(struct phy_device *phydev)
>  
>  	/* Restart auto-negotiation if remote fault */
>  	if (bmsr & BMSR_RFAULT) {
> -		puts("PHY remote fault detected\n"
> +		pr_info("PHY remote fault detected\n"
>  		     "PHY restarting auto-negotiation\n");

Likewise, dev_info(&phydev->dev,

>  		phy_write(phydev, MII_BMCR,
>  				  BMCR_ANENABLE | BMCR_ANRESTART);

Thanks,
Ahmad

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux