diff options
Diffstat (limited to 'drivers/net/ll_temac_main.c')
-rw-r--r-- | drivers/net/ll_temac_main.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/net/ll_temac_main.c b/drivers/net/ll_temac_main.c index 7b12d0e8f4bd..fa303c881a48 100644 --- a/drivers/net/ll_temac_main.c +++ b/drivers/net/ll_temac_main.c | |||
@@ -985,7 +985,7 @@ temac_of_probe(struct of_device *op, const struct of_device_id *match) | |||
985 | np = of_parse_phandle(op->dev.of_node, "llink-connected", 0); | 985 | np = of_parse_phandle(op->dev.of_node, "llink-connected", 0); |
986 | if (!np) { | 986 | if (!np) { |
987 | dev_err(&op->dev, "could not find DMA node\n"); | 987 | dev_err(&op->dev, "could not find DMA node\n"); |
988 | goto nodev; | 988 | goto err_iounmap; |
989 | } | 989 | } |
990 | 990 | ||
991 | /* Setup the DMA register accesses, could be DCR or memory mapped */ | 991 | /* Setup the DMA register accesses, could be DCR or memory mapped */ |
@@ -999,7 +999,7 @@ temac_of_probe(struct of_device *op, const struct of_device_id *match) | |||
999 | dev_dbg(&op->dev, "MEM base: %p\n", lp->sdma_regs); | 999 | dev_dbg(&op->dev, "MEM base: %p\n", lp->sdma_regs); |
1000 | } else { | 1000 | } else { |
1001 | dev_err(&op->dev, "unable to map DMA registers\n"); | 1001 | dev_err(&op->dev, "unable to map DMA registers\n"); |
1002 | goto nodev; | 1002 | goto err_iounmap; |
1003 | } | 1003 | } |
1004 | } | 1004 | } |
1005 | 1005 | ||
@@ -1008,7 +1008,7 @@ temac_of_probe(struct of_device *op, const struct of_device_id *match) | |||
1008 | if ((lp->rx_irq == NO_IRQ) || (lp->tx_irq == NO_IRQ)) { | 1008 | if ((lp->rx_irq == NO_IRQ) || (lp->tx_irq == NO_IRQ)) { |
1009 | dev_err(&op->dev, "could not determine irqs\n"); | 1009 | dev_err(&op->dev, "could not determine irqs\n"); |
1010 | rc = -ENOMEM; | 1010 | rc = -ENOMEM; |
1011 | goto nodev; | 1011 | goto err_iounmap_2; |
1012 | } | 1012 | } |
1013 | 1013 | ||
1014 | of_node_put(np); /* Finished with the DMA node; drop the reference */ | 1014 | of_node_put(np); /* Finished with the DMA node; drop the reference */ |
@@ -1018,7 +1018,7 @@ temac_of_probe(struct of_device *op, const struct of_device_id *match) | |||
1018 | if ((!addr) || (size != 6)) { | 1018 | if ((!addr) || (size != 6)) { |
1019 | dev_err(&op->dev, "could not find MAC address\n"); | 1019 | dev_err(&op->dev, "could not find MAC address\n"); |
1020 | rc = -ENODEV; | 1020 | rc = -ENODEV; |
1021 | goto nodev; | 1021 | goto err_iounmap_2; |
1022 | } | 1022 | } |
1023 | temac_set_mac_address(ndev, (void *)addr); | 1023 | temac_set_mac_address(ndev, (void *)addr); |
1024 | 1024 | ||
@@ -1034,7 +1034,7 @@ temac_of_probe(struct of_device *op, const struct of_device_id *match) | |||
1034 | rc = sysfs_create_group(&lp->dev->kobj, &temac_attr_group); | 1034 | rc = sysfs_create_group(&lp->dev->kobj, &temac_attr_group); |
1035 | if (rc) { | 1035 | if (rc) { |
1036 | dev_err(lp->dev, "Error creating sysfs files\n"); | 1036 | dev_err(lp->dev, "Error creating sysfs files\n"); |
1037 | goto nodev; | 1037 | goto err_iounmap_2; |
1038 | } | 1038 | } |
1039 | 1039 | ||
1040 | rc = register_netdev(lp->ndev); | 1040 | rc = register_netdev(lp->ndev); |
@@ -1047,6 +1047,11 @@ temac_of_probe(struct of_device *op, const struct of_device_id *match) | |||
1047 | 1047 | ||
1048 | err_register_ndev: | 1048 | err_register_ndev: |
1049 | sysfs_remove_group(&lp->dev->kobj, &temac_attr_group); | 1049 | sysfs_remove_group(&lp->dev->kobj, &temac_attr_group); |
1050 | err_iounmap_2: | ||
1051 | if (lp->sdma_regs) | ||
1052 | iounmap(lp->sdma_regs); | ||
1053 | err_iounmap: | ||
1054 | iounmap(lp->regs); | ||
1050 | nodev: | 1055 | nodev: |
1051 | free_netdev(ndev); | 1056 | free_netdev(ndev); |
1052 | ndev = NULL; | 1057 | ndev = NULL; |
@@ -1065,6 +1070,9 @@ static int __devexit temac_of_remove(struct of_device *op) | |||
1065 | of_node_put(lp->phy_node); | 1070 | of_node_put(lp->phy_node); |
1066 | lp->phy_node = NULL; | 1071 | lp->phy_node = NULL; |
1067 | dev_set_drvdata(&op->dev, NULL); | 1072 | dev_set_drvdata(&op->dev, NULL); |
1073 | iounmap(lp->regs); | ||
1074 | if (lp->sdma_regs) | ||
1075 | iounmap(lp->sdma_regs); | ||
1068 | free_netdev(ndev); | 1076 | free_netdev(ndev); |
1069 | return 0; | 1077 | return 0; |
1070 | } | 1078 | } |