Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 95185
b: refs/heads/master
c: e46a5e3
h: refs/heads/master
i:
  95183: 7f3b789
v: v3
  • Loading branch information
Jiri Slaby authored and Linus Torvalds committed Apr 30, 2008
1 parent 7fdabc1 commit fbc1c91
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 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: d353eca4e0480fddcb088c4692e1edba0a82eac9
refs/heads/master: e46a5e3ff06b70690d567bdc81faf6c1c32e742f
16 changes: 13 additions & 3 deletions trunk/drivers/char/moxa.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,17 @@ static int __devinit moxa_pci_probe(struct pci_dev *pdev,
}

board = &moxa_boards[i];
board->basemem = pci_iomap(pdev, 2, 0x4000);

retval = pci_request_region(pdev, 2, "moxa-base");
if (retval) {
dev_err(&pdev->dev, "can't request pci region 2\n");
goto err;
}

board->basemem = ioremap(pci_resource_start(pdev, 2), 0x4000);
if (board->basemem == NULL) {
dev_err(&pdev->dev, "can't remap io space 2\n");
goto err;
goto err_reg;
}

board->boardType = board_type;
Expand All @@ -315,6 +322,8 @@ static int __devinit moxa_pci_probe(struct pci_dev *pdev,
pci_set_drvdata(pdev, board);

return (0);
err_reg:
pci_release_region(pdev, 2);
err:
return retval;
}
Expand All @@ -323,8 +332,9 @@ static void __devexit moxa_pci_remove(struct pci_dev *pdev)
{
struct moxa_board_conf *brd = pci_get_drvdata(pdev);

pci_iounmap(pdev, brd->basemem);
iounmap(brd->basemem);
brd->basemem = NULL;
pci_release_region(pdev, 2);
}

static struct pci_driver moxa_pci_driver = {
Expand Down

0 comments on commit fbc1c91

Please sign in to comment.