aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRasmus Villemoes <linux@rasmusvillemoes.dk>2022-06-14 10:46:11 +0200
committerJakub Kicinski <kuba@kernel.org>2022-06-16 20:29:06 -0700
commita793679827a87b01f9d973ea30b923cd5a3ff2c5 (patch)
treea9b2b0b9a25e216dfaea9a1ee1be30d5fad5e058
parentdt-bindings: dp83867: add binding for io_impedance_ctrl nvmem cell (diff)
downloadlinux-dev-a793679827a87b01f9d973ea30b923cd5a3ff2c5.tar.xz
linux-dev-a793679827a87b01f9d973ea30b923cd5a3ff2c5.zip
linux/phy.h: add phydev_err_probe() wrapper for dev_err_probe()
The dev_err_probe() function is quite useful to avoid boilerplate related to -EPROBE_DEFER handling. Add a phydev_err_probe() helper to simplify making use of that from phy drivers which otherwise use the phydev_* helpers. Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r--include/linux/phy.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 508f1149665b..bed9a347481b 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -1539,6 +1539,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_err_probe(_phydev, err, format, args...) \
+ dev_err_probe(&_phydev->mdio.dev, err, format, ##args)
+
#define phydev_info(_phydev, format, args...) \
dev_info(&_phydev->mdio.dev, format, ##args)