Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753616AbcDNH0L (ORCPT ); Thu, 14 Apr 2016 03:26:11 -0400 Received: from mail1.asahi-net.or.jp ([202.224.39.197]:57535 "EHLO mail1.asahi-net.or.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750889AbcDNH0K (ORCPT ); Thu, 14 Apr 2016 03:26:10 -0400 X-Greylist: delayed 441 seconds by postgrey-1.27 at vger.kernel.org; Thu, 14 Apr 2016 03:26:09 EDT From: Yoshinori Sato To: Bartlomiej Zolnierkiewicz , Tejun Heo Cc: Yoshinori Sato , linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] pata_artop: Use ioread8. Date: Thu, 14 Apr 2016 16:26:03 +0900 Message-Id: <1460618763-1712-1-git-send-email-ysato@users.sourceforge.jp> X-Mailer: git-send-email 2.7.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1138 Lines: 44 Support for non x86 targets. Signed-off-by: Yoshinori Sato --- drivers/ata/pata_artop.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/ata/pata_artop.c b/drivers/ata/pata_artop.c index 96c05c9..3731dea 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; } -- 2.7.0