[PATH,RFC,net-next,2/8] net: phy: Add phydev_warn()

Message ID 1536961136-30453-3-git-send-email-andrew@lunn.ch
State RFC
Delegated to: David Miller
Headers show
Series
  • Continue towards using linkmode in phylib
Related show

Commit Message

Andrew Lunn Sept. 14, 2018, 9:38 p.m.
Not all new style LINK_MODE bits can be converted into old style
SUPPORTED bits. We need to warn when such a conversion is attempted.
Add a helper for this.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
 include/linux/phy.h | 3 +++
 1 file changed, 3 insertions(+)

Comments

Florian Fainelli Sept. 14, 2018, 10:10 p.m. | #1
On 09/14/2018 02:38 PM, Andrew Lunn wrote:
> Not all new style LINK_MODE bits can be converted into old style
> SUPPORTED bits. We need to warn when such a conversion is attempted.
> Add a helper for this.
> 
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>

Acked-by: Florian Fainelli <f.fainelli@gmail.com>

Do you mind converting drivers/net/phy/marvell10g.c to use it? I would
also suggest adding phydev_info() while we are at it and do the two
conversions to it that exist in drivers/net/phy/phy_device.c?

Thanks!
Andrew Lunn Sept. 14, 2018, 11:26 p.m. | #2
On Fri, Sep 14, 2018 at 03:10:36PM -0700, Florian Fainelli wrote:
> On 09/14/2018 02:38 PM, Andrew Lunn wrote:
> > Not all new style LINK_MODE bits can be converted into old style
> > SUPPORTED bits. We need to warn when such a conversion is attempted.
> > Add a helper for this.
> > 
> > Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> 
> Acked-by: Florian Fainelli <f.fainelli@gmail.com>
> 
> Do you mind converting drivers/net/phy/marvell10g.c to use it? I would
> also suggest adding phydev_info() while we are at it and do the two
> conversions to it that exist in drivers/net/phy/phy_device.c?

Yes, we might as well have the full set.

     Andrew
Maxime Chevallier Sept. 17, 2018, 9:49 a.m. | #3
On Fri, 14 Sep 2018 23:38:50 +0200
Andrew Lunn <andrew@lunn.ch> wrote:

>Not all new style LINK_MODE bits can be converted into old style
>SUPPORTED bits. We need to warn when such a conversion is attempted.
>Add a helper for this.
>
>Signed-off-by: Andrew Lunn <andrew@lunn.ch>

Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>

Patch

diff --git a/include/linux/phy.h b/include/linux/phy.h
index d24cc46748e2..0ab9f89773fd 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -968,6 +968,9 @@  static inline void phy_device_reset(struct phy_device *phydev, int value)
 #define phydev_err(_phydev, format, args...)	\
 	dev_err(&_phydev->mdio.dev, format, ##args)
 
+#define phydev_warn(_phydev, format, args...)	\
+	dev_warn(&_phydev->mdio.dev, format, ##args)
+
 #define phydev_dbg(_phydev, format, args...)	\
 	dev_dbg(&_phydev->mdio.dev, format, ##args)