aboutsummaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--drivers/ide/pci/siimage.c25
-rw-r--r--include/linux/ide.h6
2 files changed, 16 insertions, 15 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 }
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 4871437a52b2..e2048d2ca64c 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -112,18 +112,12 @@ typedef unsigned char byte; /* used everywhere */
112#define SATA_NR_PORTS (3) /* 16 possible ?? */ 112#define SATA_NR_PORTS (3) /* 16 possible ?? */
113 113
114#define SATA_STATUS_OFFSET (0) 114#define SATA_STATUS_OFFSET (0)
115#define SATA_STATUS_REG (HWIF(drive)->sata_scr[SATA_STATUS_OFFSET])
116#define SATA_ERROR_OFFSET (1) 115#define SATA_ERROR_OFFSET (1)
117#define SATA_ERROR_REG (HWIF(drive)->sata_scr[SATA_ERROR_OFFSET])
118#define SATA_CONTROL_OFFSET (2) 116#define SATA_CONTROL_OFFSET (2)
119#define SATA_CONTROL_REG (HWIF(drive)->sata_scr[SATA_CONTROL_OFFSET])
120 117
121#define SATA_MISC_OFFSET (0) 118#define SATA_MISC_OFFSET (0)
122#define SATA_MISC_REG (HWIF(drive)->sata_misc[SATA_MISC_OFFSET])
123#define SATA_PHY_OFFSET (1) 119#define SATA_PHY_OFFSET (1)
124#define SATA_PHY_REG (HWIF(drive)->sata_misc[SATA_PHY_OFFSET])
125#define SATA_IEN_OFFSET (2) 120#define SATA_IEN_OFFSET (2)
126#define SATA_IEN_REG (HWIF(drive)->sata_misc[SATA_IEN_OFFSET])
127 121
128/* 122/*
129 * Our Physical Region Descriptor (PRD) table should be large enough 123 * Our Physical Region Descriptor (PRD) table should be large enough