Skip to contentSkip to conversation

net: fec_main: Use dev_err() instead of pr_err()

PATCH Applied Fabio Estevam 2 participants 2 messages Jun 7, 2019 – Jun 9, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 net: fec_main: Use dev_err() instead of pr_err()

dev_err() is more appropriate for printing error messages inside drivers, so switch to dev_err().

---
Changes since v2:
- Use dev_err() instead of netdev_err() - Andy

 drivers/net/ethernet/freescale/fec_main.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/net/ethernet/freescale/fec_main.c +5 -4
index 2ee72452ca76..9d459ccf251d 100644
@@ -2446,30 +2446,31 @@ static int
 fec_enet_set_coalesce(struct net_device *ndev, struct ethtool_coalesce *ec)
 {
 	struct fec_enet_private *fep = netdev_priv(ndev);
+	struct device *dev = &fep->pdev->dev;
 	unsigned int cycle;
 
 	if (!(fep->quirks & FEC_QUIRK_HAS_COALESCE))
 		return -EOPNOTSUPP;
 
 	if (ec->rx_max_coalesced_frames > 255) {
-		pr_err("Rx coalesced frames exceed hardware limitation\n");
+		dev_err(dev, "Rx coalesced frames exceed hardware limitation\n");
 		return -EINVAL;
 	}
 
 	if (ec->tx_max_coalesced_frames > 255) {
-		pr_err("Tx coalesced frame exceed hardware limitation\n");
+		dev_err(dev, "Tx coalesced frame exceed hardware limitation\n");
 		return -EINVAL;
 	}
 
 	cycle = fec_enet_us_to_itr_clock(ndev, fep->rx_time_itr);
 	if (cycle > 0xFFFF) {
-		pr_err("Rx coalesced usec exceed hardware limitation\n");
+		dev_err(dev, "Rx coalesced usec exceed hardware limitation\n");
 		return -EINVAL;
 	}
 
 	cycle = fec_enet_us_to_itr_clock(ndev, fep->tx_time_itr);
 	if (cycle > 0xFFFF) {
-		pr_err("Rx coalesced usec exceed hardware limitation\n");
+		dev_err(dev, "Rx coalesced usec exceed hardware limitation\n");
 		return -EINVAL;
 	}
 
Signature · 1 line
2.17.1
maintainer Applied
#1 lore raw

From: Fabio Estevam <[email protected]>
Date: Fri, 7 Jun 2019 09:14:18 -0300

Quoted 7 lines

dev_err() is more appropriate for printing error messages inside drivers, so switch to dev_err().

---
Changes since v2:
- Use dev_err() instead of netdev_err() - Andy

Applied.