From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: linux-ide@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: [PATCH 21/20] ata_piix: add new PIIX_FLAG_* flags
Date: Tue, 8 Feb 2011 16:52:36 +0100 [thread overview]
Message-ID: <201102081652.36752.bzolnier@gmail.com> (raw)
Turn open-coded checks in piix_set_timings() into PIIX_FLAG_* flags
per suggestion from Alan Cox.
Suggested-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
On top of https://lkml.org/lkml/2011/2/8/97 patchset.
drivers/ata/ata_piix.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
Index: b/drivers/ata/ata_piix.c
===================================================================
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -133,6 +133,8 @@ enum {
PIIX_FLAG_CHECKINTR = (1 << 28), /* make sure PCI INTx enabled */
PIIX_FLAG_SIDPR = (1 << 29), /* SATA idx/data pair regs */
+ PIIX_FLAG_NO_SITRE = (1 << 30), /* no SITRE register */
+ PIIX_FLAG_RADISYS = (1 << 31), /* host is Radisys R82600 */
PIIX_PATA_FLAGS = ATA_FLAG_SLAVE_POSS,
PIIX_SATA_FLAGS = ATA_FLAG_SATA | PIIX_FLAG_CHECKINTR,
@@ -698,7 +700,7 @@ static struct ata_port_info piix_port_in
[oldpiix_pata] =
{
- .flags = PIIX_PATA_FLAGS,
+ .flags = PIIX_PATA_FLAGS | PIIX_FLAG_NO_SITRE,
.pio_mask = ATA_PIO4,
.mwdma_mask = ATA_MWDMA12_ONLY,
.port_ops = &oldpiix_pata_ops,
@@ -706,7 +708,8 @@ static struct ata_port_info piix_port_in
[radisys_pata] =
{
- .flags = PIIX_PATA_FLAGS,
+ .flags = PIIX_PATA_FLAGS | PIIX_FLAG_NO_SITRE |
+ PIIX_FLAG_RADISYS,
.pio_mask = ATA_PIO4,
.mwdma_mask = ATA_MWDMA12_ONLY,
.udma_mask = ATA_UDMA24_ONLY,
@@ -859,10 +862,8 @@ static void piix_set_timings(struct ata_
struct pci_dev *dev = to_pci_dev(ap->host->dev);
unsigned long flags;
unsigned int is_slave = (adev->devno != 0);
- unsigned int is_radisys = (dev->vendor == PCI_VENDOR_ID_RADISYS &&
- dev->device == 0x8201);
- unsigned int has_sitre = (dev->vendor != PCI_VENDOR_ID_INTEL ||
- dev->device != 0x1230) && !is_radisys;
+ unsigned int is_radisys = (ap->flags & PIIX_FLAG_RADISYS) ? 1 : 0;
+ unsigned int has_sitre = (ap->flags & PIIX_FLAG_NO_SITRE) ? 1 : 0;
unsigned int master_port= ap->port_no ? 0x42 : 0x40;
unsigned int slave_port = 0x44;
u16 master_data;
next reply other threads:[~2011-02-08 15:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-08 15:52 Bartlomiej Zolnierkiewicz [this message]
2011-02-08 16:03 ` [PATCH 21/20] ata_piix: add new PIIX_FLAG_* flags Bartlomiej Zolnierkiewicz
2011-02-08 17:12 ` Sergei Shtylyov
2011-02-08 18:18 ` Bartlomiej Zolnierkiewicz
2011-02-08 18:30 ` Sergei Shtylyov
2011-02-09 9:10 ` Bartlomiej Zolnierkiewicz
2011-02-11 13:04 ` Sergei Shtylyov
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=201102081652.36752.bzolnier@gmail.com \
--to=bzolnier@gmail.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.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).