Re: [PATCH net-next v2 6/9] net: phy: add backplane kr driver support

From
Andrew Lunn <andrew@lunn.ch>
Date
2020-04-24 13:47:38
Also in
linux-devicetree, linux-doc, lkml
Reply to
Florinel Iordache, 2020-04-24
quoted hunk ↗ jump to hunk
+/* Backplane custom logging */
+#define bpdev_fn(fn)							\
+void bpdev_##fn(struct phy_device *phydev, char *fmt, ...)		\
+{									\
+	struct va_format vaf = {					\
+		.fmt = fmt,						\
+	};								\
+	va_list args;							\
+	va_start(args, fmt);						\
+	vaf.va = &args;							\
+	if (!phydev->attached_dev)					\
+		dev_##fn(&phydev->mdio.dev, "%pV", &vaf);		\
+	else								\
+		dev_##fn(&phydev->mdio.dev, "%s: %pV",			\
+			netdev_name(phydev->attached_dev), &vaf);	\
+	va_end(args);							\
+}
+
+bpdev_fn(err)
+EXPORT_SYMBOL(bpdev_err);
+
+bpdev_fn(warn)
+EXPORT_SYMBOL(bpdev_warn);
+
+bpdev_fn(info)
+EXPORT_SYMBOL(bpdev_info);
+
+bpdev_fn(dbg)
+EXPORT_SYMBOL(bpdev_dbg);
Didn't i say something about just using phydev_{err|warn|info|dbg}?

       Andrew
Thread (20 messages) 20 messages, 4 authors, last reply 2020-04-25
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help