Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 43655
b: refs/heads/master
c: 7a7a5c3
h: refs/heads/master
i:
  43653: 687ab37
  43651: 02749a0
  43647: f6df9bc
v: v3
  • Loading branch information
Jiri Slaby authored and Linus Torvalds committed Dec 8, 2006
1 parent fc2b5df commit f9a0b9b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 596280156afa99cb02f2193e0e06e6e4f2434f30
refs/heads/master: 7a7a5c3303a66c9000f270d6dd03ddeda8c80768
21 changes: 17 additions & 4 deletions trunk/drivers/char/mxser_new.c
Original file line number Diff line number Diff line change
Expand Up @@ -622,19 +622,24 @@ static int __init mxser_get_PCI_conf(int board_type, struct mxser_board *brd,
{
unsigned int i, j;
unsigned long ioaddress;
int retval;

/* io address */
brd->board_type = board_type;
brd->nports = mxser_numports[board_type - 1];
ioaddress = pci_resource_start(pdev, 2);
pci_request_region(pdev, 2, "mxser(IO)");
retval = pci_request_region(pdev, 2, "mxser(IO)");
if (retval)
goto err;

for (i = 0; i < brd->nports; i++)
brd->ports[i].ioaddr = ioaddress + 8 * i;

/* vector */
ioaddress = pci_resource_start(pdev, 3);
pci_request_region(pdev, 3, "mxser(vector)");
retval = pci_request_region(pdev, 3, "mxser(vector)");
if (retval)
goto err_relio;
brd->vector = ioaddress;

/* irq */
Expand Down Expand Up @@ -674,6 +679,10 @@ static int __init mxser_get_PCI_conf(int board_type, struct mxser_board *brd,
brd->ports[i].baud_base = 921600;
}
return 0;
err_relio:
pci_release_region(pdev, 2);
err:
return retval;
}

static int __init mxser_init(void)
Expand Down Expand Up @@ -3009,8 +3018,12 @@ static int __init mxser_get_ISA_conf(int cap, struct mxser_board *brd)
brd->nports = 8;
else
brd->nports = 4;
request_region(brd->ports[0].ioaddr, 8 * brd->nports, "mxser(IO)");
request_region(brd->vector, 1, "mxser(vector)");
if (!request_region(brd->ports[0].ioaddr, 8 * brd->nports, "mxser(IO)"))
return MXSER_ERR_IOADDR;
if (!request_region(brd->vector, 1, "mxser(vector)")) {
release_region(brd->ports[0].ioaddr, 8 * brd->nports);
return MXSER_ERR_VECTOR;
}
return brd->nports;
}

Expand Down

0 comments on commit f9a0b9b

Please sign in to comment.