aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/siimage.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/pci/siimage.c')
-rw-r--r--drivers/ide/pci/siimage.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/ide/pci/siimage.c b/drivers/ide/pci/siimage.c
index db2b88a369ab..174a873b4c64 100644
--- a/drivers/ide/pci/siimage.c
+++ b/drivers/ide/pci/siimage.c
@@ -39,7 +39,6 @@
39#include <linux/types.h> 39#include <linux/types.h>
40#include <linux/module.h> 40#include <linux/module.h>
41#include <linux/pci.h> 41#include <linux/pci.h>
42#include <linux/hdreg.h>
43#include <linux/ide.h> 42#include <linux/ide.h>
44#include <linux/init.h> 43#include <linux/init.h>
45#include <linux/io.h> 44#include <linux/io.h>
@@ -223,7 +222,9 @@ static u8 sil_pata_udma_filter(ide_drive_t *drive)
223 222
224static u8 sil_sata_udma_filter(ide_drive_t *drive) 223static u8 sil_sata_udma_filter(ide_drive_t *drive)
225{ 224{
226 return strstr(drive->id->model, "Maxtor") ? ATA_UDMA5 : ATA_UDMA6; 225 char *m = (char *)&drive->id[ATA_ID_PROD];
226
227 return strstr(m, "Maxtor") ? ATA_UDMA5 : ATA_UDMA6;
227} 228}
228 229
229/** 230/**
@@ -243,7 +244,7 @@ static void sil_set_pio_mode(ide_drive_t *drive, u8 pio)
243 244
244 ide_hwif_t *hwif = HWIF(drive); 245 ide_hwif_t *hwif = HWIF(drive);
245 struct pci_dev *dev = to_pci_dev(hwif->dev); 246 struct pci_dev *dev = to_pci_dev(hwif->dev);
246 ide_drive_t *pair = ide_get_paired_drive(drive); 247 ide_drive_t *pair = ide_get_pair_dev(drive);
247 u32 speedt = 0; 248 u32 speedt = 0;
248 u16 speedp = 0; 249 u16 speedp = 0;
249 unsigned long addr = siimage_seldev(drive, 0x04); 250 unsigned long addr = siimage_seldev(drive, 0x04);
@@ -257,7 +258,7 @@ static void sil_set_pio_mode(ide_drive_t *drive, u8 pio)
257 u8 unit = drive->select.b.unit; 258 u8 unit = drive->select.b.unit;
258 259
259 /* trim *taskfile* PIO to the slowest of the master/slave */ 260 /* trim *taskfile* PIO to the slowest of the master/slave */
260 if (pair->present) { 261 if (pair) {
261 u8 pair_pio = ide_get_best_pio_mode(pair, 255, 4); 262 u8 pair_pio = ide_get_best_pio_mode(pair, 255, 4);
262 263
263 if (pair_pio < tf_pio) 264 if (pair_pio < tf_pio)
@@ -462,7 +463,7 @@ static void sil_sata_pre_reset(ide_drive_t *drive)
462 * to 133 MHz clocking if the system isn't already set up to do it. 463 * to 133 MHz clocking if the system isn't already set up to do it.
463 */ 464 */
464 465
465static unsigned int __devinit init_chipset_siimage(struct pci_dev *dev) 466static unsigned int init_chipset_siimage(struct pci_dev *dev)
466{ 467{
467 struct ide_host *host = pci_get_drvdata(dev); 468 struct ide_host *host = pci_get_drvdata(dev);
468 void __iomem *ioaddr = host->host_priv; 469 void __iomem *ioaddr = host->host_priv;
@@ -616,8 +617,8 @@ static void __devinit init_mmio_iops_siimage(ide_hwif_t *hwif)
616 617
617static int is_dev_seagate_sata(ide_drive_t *drive) 618static int is_dev_seagate_sata(ide_drive_t *drive)
618{ 619{
619 const char *s = &drive->id->model[0]; 620 const char *s = (const char *)&drive->id[ATA_ID_PROD];
620 unsigned len = strnlen(s, sizeof(drive->id->model)); 621 unsigned len = strnlen(s, ATA_ID_PROD_LEN);
621 622
622 if ((len > 4) && (!memcmp(s, "ST", 2))) 623 if ((len > 4) && (!memcmp(s, "ST", 2)))
623 if ((!memcmp(s + len - 2, "AS", 2)) || 624 if ((!memcmp(s + len - 2, "AS", 2)) ||
@@ -833,6 +834,8 @@ static struct pci_driver driver = {
833 .id_table = siimage_pci_tbl, 834 .id_table = siimage_pci_tbl,
834 .probe = siimage_init_one, 835 .probe = siimage_init_one,
835 .remove = __devexit_p(siimage_remove), 836 .remove = __devexit_p(siimage_remove),
837 .suspend = ide_pci_suspend,
838 .resume = ide_pci_resume,
836}; 839};
837 840
838static int __init siimage_ide_init(void) 841static int __init siimage_ide_init(void)