[PATCH v4 3/3] staging: octeon: ethernet: replace pr_err and pr_info with dev_err and netdev_err
From: Ayush Mukkanwar
Date: Sun Apr 05 2026 - 10:15:22 EST
Replace pr_err() and pr_info() calls in cvm_oct_probe() with
dev_err(), netdev_err(), and netdev_info() to include device
information in log messages. Use dev_err() where no net_device
is available (allocation failures), and netdev_err()/netdev_info()
where a net_device exists.
Signed-off-by: Ayush Mukkanwar <ayushmukkanwar@xxxxxxxxx>
---
drivers/staging/octeon/ethernet.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c
index a7ac29c0a4ca..7c3cfd9efa7e 100644
--- a/drivers/staging/octeon/ethernet.c
+++ b/drivers/staging/octeon/ethernet.c
@@ -698,7 +698,7 @@ static int cvm_oct_probe(struct platform_device *pdev)
pip = pdev->dev.of_node;
if (!pip) {
- pr_err("Error: No 'pip' in /aliases\n");
+ dev_err(&pdev->dev, "No 'pip' in /aliases\n");
return -EINVAL;
}
@@ -796,16 +796,16 @@ static int cvm_oct_probe(struct platform_device *pdev)
dev->max_mtu = OCTEON_MAX_MTU - mtu_overhead;
if (register_netdev(dev) < 0) {
- pr_err("Failed to register ethernet device for POW\n");
+ netdev_err(dev, "Failed to register ethernet device for POW\n");
free_netdev(dev);
} else {
cvm_oct_device[CVMX_PIP_NUM_INPUT_PORTS] = dev;
- pr_info("%s: POW send group %d, receive group %d\n",
- dev->name, pow_send_group,
- pow_receive_group);
+ netdev_info(dev, "POW send group %d, receive group %d\n",
+ pow_send_group,
+ pow_receive_group);
}
} else {
- pr_err("Failed to allocate ethernet device for POW\n");
+ dev_err(&pdev->dev, "Failed to allocate ethernet device for POW\n");
}
}
@@ -825,8 +825,8 @@ static int cvm_oct_probe(struct platform_device *pdev)
struct net_device *dev =
alloc_etherdev(sizeof(struct octeon_ethernet));
if (!dev) {
- pr_err("Failed to allocate ethernet device for port %d\n",
- port);
+ dev_err(&pdev->dev, "Failed to allocate ethernet device for port %d\n",
+ port);
continue;
}
@@ -910,8 +910,8 @@ static int cvm_oct_probe(struct platform_device *pdev)
if (!dev->netdev_ops) {
free_netdev(dev);
} else if (register_netdev(dev) < 0) {
- pr_err("Failed to register ethernet device for interface %d, port %d\n",
- interface, priv->port);
+ netdev_err(dev, "Failed to register ethernet device for interface %d, port %d\n",
+ interface, priv->port);
free_netdev(dev);
} else {
cvm_oct_device[priv->port] = dev;
--
2.53.0