From: Yoshinori Sato Date: Thu, 14 Apr 2016 07:19:45 +0000 (+0900) Subject: pata_artop: Use ioread8. X-Git-Url: http://git.osdn.net/view?p=uclinux-h8%2Flinux.git;a=commitdiff_plain;h=26e77c47f16f30ea5b11a13c9b607855bd077034 pata_artop: Use ioread8. Support for non x86 targets. Signed-off-by: Yoshinori Sato --- diff --git a/drivers/ata/pata_artop.c b/drivers/ata/pata_artop.c index 96c05c9494fa..3731deaa23a0 100644 --- a/drivers/ata/pata_artop.c +++ b/drivers/ata/pata_artop.c @@ -340,6 +340,18 @@ static void atp8xx_fixup(struct pci_dev *pdev) } } +static int is_fast(struct pci_dev *pdev) +{ + int ret = 0; + void __iomem *addr; + + addr = pci_iomap(pdev, 4, 1); + if (ioread8(addr) & 0x10) + ret = 1; + pci_iounmap(pdev, addr); + + return ret; +} /** * artop_init_one - Register ARTOP ATA PCI device with kernel services * @pdev: PCI device to register @@ -398,10 +410,8 @@ static int artop_init_one (struct pci_dev *pdev, const struct pci_device_id *id) else if (id->driver_data == 1) /* 6260 */ ppi[0] = &info_626x; else if (id->driver_data == 2) { /* 6280 or 6280 + fast */ - unsigned long io = pci_resource_start(pdev, 4); - ppi[0] = &info_628x; - if (inb(io) & 0x10) + if (is_fast(pdev)) ppi[0] = &info_628x_fast; }