Skip to content

Commit 0b20416

Browse files
PoojaShamiligregkh
authored andcommitted
staging: netlogic: Replacing pr_err with dev_err after the call to devm_kzalloc
The function devm_kzalloc has a first argument of type struct device *. This is the type of argument required by printing functions such as dev_info, dev_err, etc. Thus, functions like pr_info should not normally be used after a call to devm_kzalloc. Thus, all pr_err occurances are replaced with dev_err function calls Signed-off-by: G Pooja Shamili <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 8d4cd9c commit 0b20416

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

drivers/staging/netlogic/xlr_net.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,8 @@ static int xlr_net_probe(struct platform_device *pdev)
10281028
for (port = 0; port < pdev->num_resources / 2; port++) {
10291029
ndev = alloc_etherdev_mq(sizeof(struct xlr_net_priv), 32);
10301030
if (!ndev) {
1031-
pr_err("Allocation of Ethernet device failed\n");
1031+
dev_err(&pdev->dev,
1032+
"Allocation of Ethernet device failed\n");
10321033
return -ENOMEM;
10331034
}
10341035

@@ -1048,7 +1049,8 @@ static int xlr_net_probe(struct platform_device *pdev)
10481049

10491050
res = platform_get_resource(pdev, IORESOURCE_IRQ, port);
10501051
if (!res) {
1051-
pr_err("No irq resource for MAC %d\n", priv->port_id);
1052+
dev_err(&pdev->dev, "No irq resource for MAC %d\n",
1053+
priv->port_id);
10521054
err = -ENODEV;
10531055
goto err_gmac;
10541056
}
@@ -1083,7 +1085,8 @@ static int xlr_net_probe(struct platform_device *pdev)
10831085
if (strcmp(res->name, "gmac") == 0) {
10841086
err = xlr_gmac_init(priv, pdev);
10851087
if (err) {
1086-
pr_err("gmac%d init failed\n", priv->port_id);
1088+
dev_err(&pdev->dev, "gmac%d init failed\n",
1089+
priv->port_id);
10871090
goto err_gmac;
10881091
}
10891092
}
@@ -1096,8 +1099,9 @@ static int xlr_net_probe(struct platform_device *pdev)
10961099

10971100
err = register_netdev(ndev);
10981101
if (err) {
1099-
pr_err("Registering netdev failed for gmac%d\n",
1100-
priv->port_id);
1102+
dev_err(&pdev->dev,
1103+
"Registering netdev failed for gmac%d\n",
1104+
priv->port_id);
11011105
goto err_netdev;
11021106
}
11031107
platform_set_drvdata(pdev, priv);

0 commit comments

Comments
 (0)