Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 517a772c authored by Fabio Estevam's avatar Fabio Estevam Committed by David S. Miller
Browse files

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().

Signed-off-by: default avatarFabio Estevam <festevam@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c9765074
Loading
Loading
Loading
Loading
+5 −4
Original line number Original line Diff line number Diff line
@@ -2446,30 +2446,31 @@ static int
fec_enet_set_coalesce(struct net_device *ndev, struct ethtool_coalesce *ec)
fec_enet_set_coalesce(struct net_device *ndev, struct ethtool_coalesce *ec)
{
{
	struct fec_enet_private *fep = netdev_priv(ndev);
	struct fec_enet_private *fep = netdev_priv(ndev);
	struct device *dev = &fep->pdev->dev;
	unsigned int cycle;
	unsigned int cycle;


	if (!(fep->quirks & FEC_QUIRK_HAS_COALESCE))
	if (!(fep->quirks & FEC_QUIRK_HAS_COALESCE))
		return -EOPNOTSUPP;
		return -EOPNOTSUPP;


	if (ec->rx_max_coalesced_frames > 255) {
	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;
		return -EINVAL;
	}
	}


	if (ec->tx_max_coalesced_frames > 255) {
	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;
		return -EINVAL;
	}
	}


	cycle = fec_enet_us_to_itr_clock(ndev, fep->rx_time_itr);
	cycle = fec_enet_us_to_itr_clock(ndev, fep->rx_time_itr);
	if (cycle > 0xFFFF) {
	if (cycle > 0xFFFF) {
		pr_err("Rx coalesced usec exceed hardware limitation\n");
		dev_err(dev, "Rx coalesced usec exceed hardware limitation\n");
		return -EINVAL;
		return -EINVAL;
	}
	}


	cycle = fec_enet_us_to_itr_clock(ndev, fep->tx_time_itr);
	cycle = fec_enet_us_to_itr_clock(ndev, fep->tx_time_itr);
	if (cycle > 0xFFFF) {
	if (cycle > 0xFFFF) {
		pr_err("Rx coalesced usec exceed hardware limitation\n");
		dev_err(dev, "Rx coalesced usec exceed hardware limitation\n");
		return -EINVAL;
		return -EINVAL;
	}
	}