Commit c4fabb8b authored by Andrew Lunn's avatar Andrew Lunn Committed by David S. Miller

net: phy: Add phydev_info()

Add phydev_info() and make use of it within the phy drivers and core
code.
Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ab2a605f
...@@ -687,9 +687,9 @@ static void recalibrate(struct dp83640_clock *clock) ...@@ -687,9 +687,9 @@ static void recalibrate(struct dp83640_clock *clock)
* read out and correct offsets * read out and correct offsets
*/ */
val = ext_read(master, PAGE4, PTP_STS); val = ext_read(master, PAGE4, PTP_STS);
pr_info("master PTP_STS 0x%04hx\n", val); phydev_info(master, "master PTP_STS 0x%04hx\n", val);
val = ext_read(master, PAGE4, PTP_ESTS); val = ext_read(master, PAGE4, PTP_ESTS);
pr_info("master PTP_ESTS 0x%04hx\n", val); phydev_info(master, "master PTP_ESTS 0x%04hx\n", val);
event_ts.ns_lo = ext_read(master, PAGE4, PTP_EDATA); event_ts.ns_lo = ext_read(master, PAGE4, PTP_EDATA);
event_ts.ns_hi = ext_read(master, PAGE4, PTP_EDATA); event_ts.ns_hi = ext_read(master, PAGE4, PTP_EDATA);
event_ts.sec_lo = ext_read(master, PAGE4, PTP_EDATA); event_ts.sec_lo = ext_read(master, PAGE4, PTP_EDATA);
...@@ -699,15 +699,16 @@ static void recalibrate(struct dp83640_clock *clock) ...@@ -699,15 +699,16 @@ static void recalibrate(struct dp83640_clock *clock)
list_for_each(this, &clock->phylist) { list_for_each(this, &clock->phylist) {
tmp = list_entry(this, struct dp83640_private, list); tmp = list_entry(this, struct dp83640_private, list);
val = ext_read(tmp->phydev, PAGE4, PTP_STS); val = ext_read(tmp->phydev, PAGE4, PTP_STS);
pr_info("slave PTP_STS 0x%04hx\n", val); phydev_info(tmp->phydev, "slave PTP_STS 0x%04hx\n", val);
val = ext_read(tmp->phydev, PAGE4, PTP_ESTS); val = ext_read(tmp->phydev, PAGE4, PTP_ESTS);
pr_info("slave PTP_ESTS 0x%04hx\n", val); phydev_info(tmp->phydev, "slave PTP_ESTS 0x%04hx\n", val);
event_ts.ns_lo = ext_read(tmp->phydev, PAGE4, PTP_EDATA); event_ts.ns_lo = ext_read(tmp->phydev, PAGE4, PTP_EDATA);
event_ts.ns_hi = ext_read(tmp->phydev, PAGE4, PTP_EDATA); event_ts.ns_hi = ext_read(tmp->phydev, PAGE4, PTP_EDATA);
event_ts.sec_lo = ext_read(tmp->phydev, PAGE4, PTP_EDATA); event_ts.sec_lo = ext_read(tmp->phydev, PAGE4, PTP_EDATA);
event_ts.sec_hi = ext_read(tmp->phydev, PAGE4, PTP_EDATA); event_ts.sec_hi = ext_read(tmp->phydev, PAGE4, PTP_EDATA);
diff = now - (s64) phy2txts(&event_ts); diff = now - (s64) phy2txts(&event_ts);
pr_info("slave offset %lld nanoseconds\n", diff); phydev_info(tmp->phydev, "slave offset %lld nanoseconds\n",
diff);
diff += ADJTIME_FIX; diff += ADJTIME_FIX;
ts = ns_to_timespec64(diff); ts = ns_to_timespec64(diff);
tdr_write(0, tmp->phydev, &ts, PTP_STEP_CLK); tdr_write(0, tmp->phydev, &ts, PTP_STEP_CLK);
......
...@@ -920,13 +920,13 @@ void phy_attached_print(struct phy_device *phydev, const char *fmt, ...) ...@@ -920,13 +920,13 @@ void phy_attached_print(struct phy_device *phydev, const char *fmt, ...)
if (!fmt) { if (!fmt) {
dev_info(&phydev->mdio.dev, ATTACHED_FMT "\n", phydev_info(phydev, ATTACHED_FMT "\n",
drv_name, phydev_name(phydev), drv_name, phydev_name(phydev),
irq_str); irq_str);
} else { } else {
va_list ap; va_list ap;
dev_info(&phydev->mdio.dev, ATTACHED_FMT, phydev_info(phydev, ATTACHED_FMT,
drv_name, phydev_name(phydev), drv_name, phydev_name(phydev),
irq_str); irq_str);
......
...@@ -968,6 +968,9 @@ static inline void phy_device_reset(struct phy_device *phydev, int value) ...@@ -968,6 +968,9 @@ static inline void phy_device_reset(struct phy_device *phydev, int value)
#define phydev_err(_phydev, format, args...) \ #define phydev_err(_phydev, format, args...) \
dev_err(&_phydev->mdio.dev, format, ##args) dev_err(&_phydev->mdio.dev, format, ##args)
#define phydev_info(_phydev, format, args...) \
dev_info(&_phydev->mdio.dev, format, ##args)
#define phydev_warn(_phydev, format, args...) \ #define phydev_warn(_phydev, format, args...) \
dev_warn(&_phydev->mdio.dev, format, ##args) dev_warn(&_phydev->mdio.dev, format, ##args)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment