aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/siimage.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-02-02 13:56:45 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-02-02 13:56:45 -0500
commit835457def90c86fe84d7729c0531fd551fb14eda (patch)
treeac433b04a7f81855f0418fe62fc584e151812f42 /drivers/ide/pci/siimage.c
parent92b83c8f3219c36d61a6600ceb422e65c409be59 (diff)
ide: remove SATA_*_REG macros
* siimage.c: use hwif->sata_scr[SATA_{ERROR,STATUS}_OFFSET] instead of SATA_{ERROR,STATUS}_REG macros. * Remove no longer needed SATA_*_REG macros. While at it: * Remove needless SATA Status register read from sil_sata_reset_poll(). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci/siimage.c')
-rw-r--r--drivers/ide/pci/siimage.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/drivers/ide/pci/siimage.c b/drivers/ide/pci/siimage.c
index 5c1bd7928c27..ef5b39fa042b 100644
--- a/drivers/ide/pci/siimage.c
+++ b/drivers/ide/pci/siimage.c
@@ -331,15 +331,18 @@ static int siimage_mmio_ide_dma_test_irq (ide_drive_t *drive)
331{ 331{
332 ide_hwif_t *hwif = HWIF(drive); 332 ide_hwif_t *hwif = HWIF(drive);
333 unsigned long addr = siimage_selreg(hwif, 0x1); 333 unsigned long addr = siimage_selreg(hwif, 0x1);
334 void __iomem *sata_error_addr
335 = (void __iomem *)hwif->sata_scr[SATA_ERROR_OFFSET];
334 336
335 if (SATA_ERROR_REG) { 337 if (sata_error_addr) {
336 unsigned long base = (unsigned long)hwif->hwif_data; 338 unsigned long base = (unsigned long)hwif->hwif_data;
337
338 u32 ext_stat = readl((void __iomem *)(base + 0x10)); 339 u32 ext_stat = readl((void __iomem *)(base + 0x10));
339 u8 watchdog = 0; 340 u8 watchdog = 0;
341
340 if (ext_stat & ((hwif->channel) ? 0x40 : 0x10)) { 342 if (ext_stat & ((hwif->channel) ? 0x40 : 0x10)) {
341 u32 sata_error = readl((void __iomem *)SATA_ERROR_REG); 343 u32 sata_error = readl(sata_error_addr);
342 writel(sata_error, (void __iomem *)SATA_ERROR_REG); 344
345 writel(sata_error, sata_error_addr);
343 watchdog = (sata_error & 0x00680000) ? 1 : 0; 346 watchdog = (sata_error & 0x00680000) ? 1 : 0;
344 printk(KERN_WARNING "%s: sata_error = 0x%08x, " 347 printk(KERN_WARNING "%s: sata_error = 0x%08x, "
345 "watchdog = %d, %s\n", 348 "watchdog = %d, %s\n",
@@ -418,13 +421,17 @@ static int sil_sata_busproc(ide_drive_t * drive, int state)
418 421
419static int sil_sata_reset_poll(ide_drive_t *drive) 422static int sil_sata_reset_poll(ide_drive_t *drive)
420{ 423{
421 if (SATA_STATUS_REG) { 424 ide_hwif_t *hwif = drive->hwif;
422 ide_hwif_t *hwif = HWIF(drive); 425 void __iomem *sata_status_addr
426 = (void __iomem *)hwif->sata_scr[SATA_STATUS_OFFSET];
427
428 if (sata_status_addr) {
429 /* SATA Status is available only when in MMIO mode */
430 u32 sata_stat = readl(sata_status_addr);
423 431
424 /* SATA_STATUS_REG is valid only when in MMIO mode */ 432 if ((sata_stat & 0x03) != 0x03) {
425 if ((readl((void __iomem *)SATA_STATUS_REG) & 0x03) != 0x03) {
426 printk(KERN_WARNING "%s: reset phy dead, status=0x%08x\n", 433 printk(KERN_WARNING "%s: reset phy dead, status=0x%08x\n",
427 hwif->name, readl((void __iomem *)SATA_STATUS_REG)); 434 hwif->name, sata_stat);
428 HWGROUP(drive)->polling = 0; 435 HWGROUP(drive)->polling = 0;
429 return ide_started; 436 return ide_started;
430 } 437 }