Skip to content

Commit

Permalink
pci: use pci_ioremap_bar() in drivers/misc
Browse files Browse the repository at this point in the history
Use the newly introduced pci_ioremap_bar() function in drivers/misc.
pci_ioremap_bar() just takes a pci device and a bar number, with the goal
of making it really hard to get wrong, while also having a central place
to stick sanity checks.

Signed-off-by: Arjan van de Ven <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
fenrus75 authored and torvalds committed Jan 6, 2009
1 parent ea43546 commit bdbeed7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions drivers/misc/ibmasm/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,7 @@ static int __devinit ibmasm_init_one(struct pci_dev *pdev, const struct pci_devi
}

sp->irq = pdev->irq;
sp->base_address = ioremap(pci_resource_start(pdev, 0),
pci_resource_len(pdev, 0));
sp->base_address = pci_ioremap_bar(pdev, 0);
if (!sp->base_address) {
dev_err(sp->dev, "Failed to ioremap pci memory\n");
result = -ENODEV;
Expand Down
3 changes: 1 addition & 2 deletions drivers/misc/tifm_7xx1.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,7 @@ static int tifm_7xx1_probe(struct pci_dev *dev,
fm->has_ms_pif = tifm_7xx1_has_ms_pif;
pci_set_drvdata(dev, fm);

fm->addr = ioremap(pci_resource_start(dev, 0),
pci_resource_len(dev, 0));
fm->addr = pci_ioremap_bar(dev, 0);
if (!fm->addr)
goto err_out_free;

Expand Down

0 comments on commit bdbeed7

Please sign in to comment.