diff options
-rw-r--r-- | drivers/net/ucc_geth.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c index 052ad71365de..defdad445ecb 100644 --- a/drivers/net/ucc_geth.c +++ b/drivers/net/ucc_geth.c | |||
@@ -2218,7 +2218,10 @@ static void ucc_geth_memclean(struct ucc_geth_private *ugeth) | |||
2218 | while (!list_empty(&ugeth->ind_hash_q)) | 2218 | while (!list_empty(&ugeth->ind_hash_q)) |
2219 | put_enet_addr_container(ENET_ADDR_CONT_ENTRY | 2219 | put_enet_addr_container(ENET_ADDR_CONT_ENTRY |
2220 | (dequeue(&ugeth->ind_hash_q))); | 2220 | (dequeue(&ugeth->ind_hash_q))); |
2221 | 2221 | if (ugeth->ug_regs) { | |
2222 | iounmap(ugeth->ug_regs); | ||
2223 | ugeth->ug_regs = NULL; | ||
2224 | } | ||
2222 | } | 2225 | } |
2223 | 2226 | ||
2224 | static void ucc_geth_set_multi(struct net_device *dev) | 2227 | static void ucc_geth_set_multi(struct net_device *dev) |
@@ -2423,7 +2426,12 @@ static int ucc_struct_init(struct ucc_geth_private *ugeth) | |||
2423 | return -ENOMEM; | 2426 | return -ENOMEM; |
2424 | } | 2427 | } |
2425 | 2428 | ||
2426 | ugeth->ug_regs = (struct ucc_geth __iomem *) ioremap(uf_info->regs, sizeof(struct ucc_geth)); | 2429 | ugeth->ug_regs = ioremap(uf_info->regs, sizeof(*ugeth->ug_regs)); |
2430 | if (!ugeth->ug_regs) { | ||
2431 | if (netif_msg_probe(ugeth)) | ||
2432 | ugeth_err("%s: Failed to ioremap regs.", __func__); | ||
2433 | return -ENOMEM; | ||
2434 | } | ||
2427 | 2435 | ||
2428 | return 0; | 2436 | return 0; |
2429 | } | 2437 | } |
@@ -3689,7 +3697,7 @@ static int ucc_geth_open(struct net_device *dev) | |||
3689 | if (err) { | 3697 | if (err) { |
3690 | if (netif_msg_ifup(ugeth)) | 3698 | if (netif_msg_ifup(ugeth)) |
3691 | ugeth_err("%s: Cannot configure internal struct, aborting.", dev->name); | 3699 | ugeth_err("%s: Cannot configure internal struct, aborting.", dev->name); |
3692 | return err; | 3700 | goto out_err_stop; |
3693 | } | 3701 | } |
3694 | 3702 | ||
3695 | napi_enable(&ugeth->napi); | 3703 | napi_enable(&ugeth->napi); |
@@ -3752,6 +3760,7 @@ static int ucc_geth_open(struct net_device *dev) | |||
3752 | 3760 | ||
3753 | out_err: | 3761 | out_err: |
3754 | napi_disable(&ugeth->napi); | 3762 | napi_disable(&ugeth->napi); |
3763 | out_err_stop: | ||
3755 | ucc_geth_stop(ugeth); | 3764 | ucc_geth_stop(ugeth); |
3756 | return err; | 3765 | return err; |
3757 | } | 3766 | } |