diff options
Diffstat (limited to 'drivers/ata/pata_artop.c')
-rw-r--r-- | drivers/ata/pata_artop.c | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/drivers/ata/pata_artop.c b/drivers/ata/pata_artop.c index ad3c5808aaad..20a8f31a3f57 100644 --- a/drivers/ata/pata_artop.c +++ b/drivers/ata/pata_artop.c @@ -28,7 +28,7 @@ #include <linux/ata.h> #define DRV_NAME "pata_artop" -#define DRV_VERSION "0.4.6" +#define DRV_VERSION "0.4.8" /* * The ARTOP has 33 Mhz and "over clocked" timing tables. Until we @@ -315,12 +315,15 @@ static struct ata_port_operations artop6260_ops = { static void atp8xx_fixup(struct pci_dev *pdev) { - if (pdev->device == 0x0005) + u8 reg; + + switch (pdev->device) { + case 0x0005: /* BIOS may have left us in UDMA, clear it before libata probe */ pci_write_config_byte(pdev, 0x54, 0); - else if (pdev->device == 0x0008 || pdev->device == 0x0009) { - u8 reg; - + break; + case 0x0008: + case 0x0009: /* Mac systems come up with some registers not set as we will need them */ @@ -338,6 +341,7 @@ static void atp8xx_fixup(struct pci_dev *pdev) /* Enable IRQ output and burst mode */ pci_read_config_byte(pdev, 0x4a, ®); pci_write_config_byte(pdev, 0x4a, (reg & ~0x01) | 0x80); + break; } } @@ -394,16 +398,19 @@ static int artop_init_one (struct pci_dev *pdev, const struct pci_device_id *id) if (rc) return rc; - if (id->driver_data == 0) /* 6210 variant */ + switch (id->driver_data) { + case 0: /* 6210 variant */ ppi[0] = &info_6210; - else if (id->driver_data == 1) /* 6260 */ + break; + case 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) + break; + case 2: /* 6280 or 6280 + fast */ + if (inb(pci_resource_start(pdev, 4)) & 0x10) ppi[0] = &info_628x_fast; + else + ppi[0] = &info_628x; + break; } BUG_ON(ppi[0] == NULL); |