mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-06 22:58:29 +00:00
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>
This commit is contained in:
parent
6d406b3c76
commit
9088fa4fa2
1 changed files with 4 additions and 20 deletions
|
@ -505,12 +505,6 @@ dm9000_poll_work(struct work_struct *w)
|
||||||
static void
|
static void
|
||||||
dm9000_release_board(struct platform_device *pdev, struct board_info *db)
|
dm9000_release_board(struct platform_device *pdev, struct board_info *db)
|
||||||
{
|
{
|
||||||
if (db->data_res == NULL) {
|
|
||||||
if (db->addr_res != NULL)
|
|
||||||
release_mem_region((unsigned long)db->io_addr, 4);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* unmap our resources */
|
/* unmap our resources */
|
||||||
|
|
||||||
iounmap(db->io_addr);
|
iounmap(db->io_addr);
|
||||||
|
@ -518,15 +512,11 @@ dm9000_release_board(struct platform_device *pdev, struct board_info *db)
|
||||||
|
|
||||||
/* release the resources */
|
/* release the resources */
|
||||||
|
|
||||||
if (db->data_req != NULL) {
|
release_resource(db->data_req);
|
||||||
release_resource(db->data_req);
|
kfree(db->data_req);
|
||||||
kfree(db->data_req);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (db->addr_req != NULL) {
|
release_resource(db->addr_req);
|
||||||
release_resource(db->addr_req);
|
kfree(db->addr_req);
|
||||||
kfree(db->addr_req);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned char dm9000_type_to_char(enum dm9000_type type)
|
static unsigned char dm9000_type_to_char(enum dm9000_type type)
|
||||||
|
@ -580,12 +570,6 @@ dm9000_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
INIT_DELAYED_WORK(&db->phy_poll, dm9000_poll_work);
|
INIT_DELAYED_WORK(&db->phy_poll, dm9000_poll_work);
|
||||||
|
|
||||||
|
|
||||||
if (pdev->num_resources < 3) {
|
|
||||||
ret = -ENODEV;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
db->addr_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
db->addr_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||||
db->data_res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
|
db->data_res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
|
||||||
db->irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
|
db->irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
|
||||||
|
|
Loading…
Add table
Reference in a new issue