Skip to content

Commit 403466f

Browse files
committed
Merge branch 'fsl-fman-next'
Christophe JAILLET says: ==================== fsl/fman: Fix some error handling code in mac_probe Commit c6e26ea ("dpaa_eth: change device used") generated some conflicts in my patches waiting for submission. So I took a closer look at it. So here is a serie of 4 patches. The 1st one is just about a spurious call to 'dev_set_drvdata()', which is done in only 1 error handling path in the function. The 2nd one removes some devm_iounmap/release/kfree functions which look useless to me. The 3rd one fixes a missing of_node_put. The 4th one is just cosmetic and removes a useless message. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 03ac738 + e51f37b commit 403466f

File tree

1 file changed

+3
-7
lines changed
  • drivers/net/ethernet/freescale/fman

1 file changed

+3
-7
lines changed

drivers/net/ethernet/freescale/fman/mac.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,6 @@ static int mac_probe(struct platform_device *_of_dev)
615615
mac_dev = devm_kzalloc(dev, sizeof(*mac_dev), GFP_KERNEL);
616616
if (!mac_dev) {
617617
err = -ENOMEM;
618-
dev_err(dev, "devm_kzalloc() = %d\n", err);
619618
goto _return;
620619
}
621620
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
@@ -709,12 +708,8 @@ static int mac_probe(struct platform_device *_of_dev)
709708
}
710709

711710
if (!of_device_is_available(mac_node)) {
712-
devm_iounmap(dev, priv->vaddr);
713-
__devm_release_region(dev, fman_get_mem_region(priv->fman),
714-
res.start, res.end + 1 - res.start);
715-
devm_kfree(dev, mac_dev);
716-
dev_set_drvdata(dev, NULL);
717-
return -ENODEV;
711+
err = -ENODEV;
712+
goto _return_of_get_parent;
718713
}
719714

720715
/* Get the cell-index */
@@ -825,6 +820,7 @@ static int mac_probe(struct platform_device *_of_dev)
825820
phy = of_phy_find_device(mac_dev->phy_node);
826821
if (!phy) {
827822
err = -EINVAL;
823+
of_node_put(mac_dev->phy_node);
828824
goto _return_of_get_parent;
829825
}
830826

0 commit comments

Comments
 (0)