From: Yoshinori Sato <ysato@users.sourceforge.jp>
To: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
Tejun Heo <tj@kernel.org>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>,
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 [thread overview]
Message-ID: <1460618763-1712-1-git-send-email-ysato@users.sourceforge.jp> (raw)
Support for non x86 targets.
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
---
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
next reply other threads:[~2016-04-14 7:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-14 7:26 Yoshinori Sato [this message]
2016-04-14 15:45 ` [PATCH] pata_artop: Use ioread8 Tejun Heo
2016-04-18 6:33 ` Yoshinori Sato
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1460618763-1712-1-git-send-email-ysato@users.sourceforge.jp \
--to=ysato@users.sourceforge.jp \
--cc=b.zolnierkie@samsung.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).