diff options
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/dm9000.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c index 24996da4c1c4..631e0d9f2e40 100644 --- a/drivers/net/dm9000.c +++ b/drivers/net/dm9000.c | |||
@@ -410,10 +410,7 @@ dm9000_probe(struct platform_device *pdev) | |||
410 | if (pdev->num_resources < 2) { | 410 | if (pdev->num_resources < 2) { |
411 | ret = -ENODEV; | 411 | ret = -ENODEV; |
412 | goto out; | 412 | goto out; |
413 | } | 413 | } else if (pdev->num_resources == 2) { |
414 | |||
415 | switch (pdev->num_resources) { | ||
416 | case 2: | ||
417 | base = pdev->resource[0].start; | 414 | base = pdev->resource[0].start; |
418 | 415 | ||
419 | if (!request_mem_region(base, 4, ndev->name)) { | 416 | if (!request_mem_region(base, 4, ndev->name)) { |
@@ -423,17 +420,16 @@ dm9000_probe(struct platform_device *pdev) | |||
423 | 420 | ||
424 | ndev->base_addr = base; | 421 | ndev->base_addr = base; |
425 | ndev->irq = pdev->resource[1].start; | 422 | ndev->irq = pdev->resource[1].start; |
426 | db->io_addr = (void *)base; | 423 | db->io_addr = (void __iomem *)base; |
427 | db->io_data = (void *)(base + 4); | 424 | db->io_data = (void __iomem *)(base + 4); |
428 | |||
429 | break; | ||
430 | 425 | ||
431 | case 3: | 426 | } else { |
432 | db->addr_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 427 | db->addr_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
433 | db->data_res = platform_get_resource(pdev, IORESOURCE_MEM, 1); | 428 | db->data_res = platform_get_resource(pdev, IORESOURCE_MEM, 1); |
434 | db->irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); | 429 | db->irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); |
435 | 430 | ||
436 | if (db->addr_res == NULL || db->data_res == NULL) { | 431 | if (db->addr_res == NULL || db->data_res == NULL || |
432 | db->irq_res == NULL) { | ||
437 | printk(KERN_ERR PFX "insufficient resources\n"); | 433 | printk(KERN_ERR PFX "insufficient resources\n"); |
438 | ret = -ENOENT; | 434 | ret = -ENOENT; |
439 | goto out; | 435 | goto out; |
@@ -482,7 +478,6 @@ dm9000_probe(struct platform_device *pdev) | |||
482 | 478 | ||
483 | /* ensure at least we have a default set of IO routines */ | 479 | /* ensure at least we have a default set of IO routines */ |
484 | dm9000_set_io(db, iosize); | 480 | dm9000_set_io(db, iosize); |
485 | |||
486 | } | 481 | } |
487 | 482 | ||
488 | /* check to see if anything is being over-ridden */ | 483 | /* check to see if anything is being over-ridden */ |