aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/dm9000.c24
1 files changed, 4 insertions, 20 deletions
diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c
index 73270d93ae38..79bdd9e29a01 100644
--- a/drivers/net/dm9000.c
+++ b/drivers/net/dm9000.c
@@ -505,12 +505,6 @@ dm9000_poll_work(struct work_struct *w)
505static void 505static void
506dm9000_release_board(struct platform_device *pdev, struct board_info *db) 506dm9000_release_board(struct platform_device *pdev, struct board_info *db)
507{ 507{
508 if (db->data_res == NULL) {
509 if (db->addr_res != NULL)
510 release_mem_region((unsigned long)db->io_addr, 4);
511 return;
512 }
513
514 /* unmap our resources */ 508 /* unmap our resources */
515 509
516 iounmap(db->io_addr); 510 iounmap(db->io_addr);
@@ -518,15 +512,11 @@ dm9000_release_board(struct platform_device *pdev, struct board_info *db)
518 512
519 /* release the resources */ 513 /* release the resources */
520 514
521 if (db->data_req != NULL) { 515 release_resource(db->data_req);
522 release_resource(db->data_req); 516 kfree(db->data_req);
523 kfree(db->data_req);
524 }
525 517
526 if (db->addr_req != NULL) { 518 release_resource(db->addr_req);
527 release_resource(db->addr_req); 519 kfree(db->addr_req);
528 kfree(db->addr_req);
529 }
530} 520}
531 521
532static unsigned char dm9000_type_to_char(enum dm9000_type type) 522static unsigned char dm9000_type_to_char(enum dm9000_type type)
@@ -580,12 +570,6 @@ dm9000_probe(struct platform_device *pdev)
580 570
581 INIT_DELAYED_WORK(&db->phy_poll, dm9000_poll_work); 571 INIT_DELAYED_WORK(&db->phy_poll, dm9000_poll_work);
582 572
583
584 if (pdev->num_resources < 3) {
585 ret = -ENODEV;
586 goto out;
587 }
588
589 db->addr_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 573 db->addr_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
590 db->data_res = platform_get_resource(pdev, IORESOURCE_MEM, 1); 574 db->data_res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
591 db->irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); 575 db->irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);