]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ata/sata_inic162x.c
Fix procfs compat_ioctl regression
[linux-2.6-omap-h63xx.git] / drivers / ata / sata_inic162x.c
index dc3bbce046766b871b2b7ad581d6efc2530d34d9..a9c948d7604af602632ed3fba4c5772ad456e3ea 100644 (file)
@@ -190,34 +190,34 @@ static void inic_reset_port(void __iomem *port_base)
        writew(ctl, idma_ctl);
 }
 
-static u32 inic_scr_read(struct ata_port *ap, unsigned sc_reg)
+static int inic_scr_read(struct ata_port *ap, unsigned sc_reg, u32 *val)
 {
-       void __iomem *scr_addr = (void __iomem *)ap->ioaddr.scr_addr;
+       void __iomem *scr_addr = ap->ioaddr.scr_addr;
        void __iomem *addr;
-       u32 val;
 
        if (unlikely(sc_reg >= ARRAY_SIZE(scr_map)))
-               return 0xffffffffU;
+               return -EINVAL;
 
        addr = scr_addr + scr_map[sc_reg] * 4;
-       val = readl(scr_addr + scr_map[sc_reg] * 4);
+       *val = readl(scr_addr + scr_map[sc_reg] * 4);
 
        /* this controller has stuck DIAG.N, ignore it */
        if (sc_reg == SCR_ERROR)
-               val &= ~SERR_PHYRDY_CHG;
-       return val;
+               *val &= ~SERR_PHYRDY_CHG;
+       return 0;
 }
 
-static void inic_scr_write(struct ata_port *ap, unsigned sc_reg, u32 val)
+static int inic_scr_write(struct ata_port *ap, unsigned sc_reg, u32 val)
 {
-       void __iomem *scr_addr = (void __iomem *)ap->ioaddr.scr_addr;
+       void __iomem *scr_addr = ap->ioaddr.scr_addr;
        void __iomem *addr;
 
        if (unlikely(sc_reg >= ARRAY_SIZE(scr_map)))
-               return;
+               return -EINVAL;
 
        addr = scr_addr + scr_map[sc_reg] * 4;
        writel(val, scr_addr + scr_map[sc_reg] * 4);
+       return 0;
 }
 
 /*
@@ -594,7 +594,7 @@ static struct ata_port_info inic_port_info = {
        .flags                  = ATA_FLAG_SATA | ATA_FLAG_PIO_DMA,
        .pio_mask               = 0x1f, /* pio0-4 */
        .mwdma_mask             = 0x07, /* mwdma0-2 */
-       .udma_mask              = 0x7f, /* udma0-6 */
+       .udma_mask              = ATA_UDMA6,
        .port_ops               = &inic_port_ops
 };