Skip to content

Commit c392ed4

Browse files
hlefgregkh
authored andcommitted
tty/nozomi: use pci_iomap instead of ioremap_nocache
Use pci_iomap instead of ioremap_nocache in nozomi_card_init(). This is a cleaner way to do PCI MMIO (performs additional checks) and allows to drop the manual call to pci_resource_start. pci_iomap relies on ioremap for MMIO and thus has uncached behavior. Signed-off-by: Hugo Lefeuvre <hle@owl.eu.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 1355cba commit c392ed4

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

drivers/tty/nozomi.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,7 +1317,6 @@ static void remove_sysfs_files(struct nozomi *dc)
13171317
static int nozomi_card_init(struct pci_dev *pdev,
13181318
const struct pci_device_id *ent)
13191319
{
1320-
resource_size_t start;
13211320
int ret;
13221321
struct nozomi *dc = NULL;
13231322
int ndev_idx;
@@ -1357,17 +1356,10 @@ static int nozomi_card_init(struct pci_dev *pdev,
13571356
goto err_disable_device;
13581357
}
13591358

1360-
start = pci_resource_start(dc->pdev, 0);
1361-
if (start == 0) {
1362-
dev_err(&pdev->dev, "No I/O address for card detected\n");
1363-
ret = -ENODEV;
1364-
goto err_rel_regs;
1365-
}
1366-
13671359
/* Find out what card type it is */
13681360
nozomi_get_card_type(dc);
13691361

1370-
dc->base_addr = ioremap_nocache(start, dc->card_type);
1362+
dc->base_addr = pci_iomap(dc->pdev, 0, dc->card_type);
13711363
if (!dc->base_addr) {
13721364
dev_err(&pdev->dev, "Unable to map card MMIO\n");
13731365
ret = -ENODEV;

0 commit comments

Comments
 (0)