mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH v2] net: phy: print error messages to log
@ 2023-05-09  6:05 Johannes Zink
  2023-05-09  7:21 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Johannes Zink @ 2023-05-09  6:05 UTC (permalink / raw)
  To: barebox; +Cc: patchwork-jzi, Johannes Zink

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 dev_info and dev_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@pengutronix.de>
---
Changelog:

v1 -> v2: Worked in Ahmad's review findings:
          - use dev_err and dev_info instead of pr_err and pr_info

          Thank you for your review!

 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..dbc30b66b828 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");
+		dev_err(&edev->dev, "Unable to find a PHY (unknown ID?)\n");
 
 	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"
+		dev_info(&phydev->dev, "PHY remote fault detected\n"
 		     "PHY restarting auto-negotiation\n");
 		phy_write(phydev, MII_BMCR,
 				  BMCR_ANENABLE | BMCR_ANRESTART);
-- 
2.39.2




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] net: phy: print error messages to log
  2023-05-09  6:05 [PATCH v2] net: phy: print error messages to log Johannes Zink
@ 2023-05-09  7:21 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2023-05-09  7:21 UTC (permalink / raw)
  To: Johannes Zink; +Cc: barebox, patchwork-jzi

On Tue, May 09, 2023 at 08:05:21AM +0200, 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 dev_info and dev_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@pengutronix.de>
> ---
> Changelog:
> 
> v1 -> v2: Worked in Ahmad's review findings:
>           - use dev_err and dev_info instead of pr_err and pr_info
> 
>           Thank you for your review!
> 
>  drivers/net/phy/phy.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
> index 54dbbca7255a..dbc30b66b828 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");
> +		dev_err(&edev->dev, "Unable to find a PHY (unknown ID?)\n");
>  
>  	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"
> +		dev_info(&phydev->dev, "PHY remote fault detected\n"
>  		     "PHY restarting auto-negotiation\n");
>  		phy_write(phydev, MII_BMCR,
>  				  BMCR_ANENABLE | BMCR_ANRESTART);
> -- 
> 2.39.2
> 
> 
> 

-- 
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 |



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-05-09  7:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-09  6:05 [PATCH v2] net: phy: print error messages to log Johannes Zink
2023-05-09  7:21 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox