aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/dm9000.c
diff options
context:
space:
mode:
authorBen Dooks <ben-linux@fluff.org>2008-06-24 17:16:00 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-06-24 22:57:28 -0400
commit9088fa4fa2f0b10bf4d9a17381a5ec3485751cb7 (patch)
tree2d10f15edfb8b1bd888c23d022ee777cbfee99c0 /drivers/net/dm9000.c
parent6d406b3c76b369a7b043470719761aa6ee1a38d1 (diff)
DM9000: Cleanups after the resource changes
Remove the now extraneous checks in dm9000_release_board() now that the two-resource case is removed. Also remove the check on pdev->num_resources, as we check the return data from platform_get_resource() to ensure we have not only the right number but the right type of resources as well. Signed-off-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/dm9000.c')
-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);