]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/block/xsysace.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
[linux-2.6-omap-h63xx.git] / drivers / block / xsysace.c
index 3ea172b7b7a40476d91f8db0095b3321ef718f16..82effce97c514601dfbc3f5d9f5e953fe98bcd5b 100644 (file)
@@ -195,7 +195,7 @@ struct ace_device {
 
        /* Details of hardware device */
        unsigned long physaddr;
-       void *baseaddr;
+       void __iomem *baseaddr;
        int irq;
        int bus_width;          /* 0 := 8 bit; 1 := 16 bit */
        struct ace_reg_ops *reg_ops;
@@ -227,20 +227,20 @@ struct ace_reg_ops {
 /* 8 Bit bus width */
 static u16 ace_in_8(struct ace_device *ace, int reg)
 {
-       void *r = ace->baseaddr + reg;
+       void __iomem *r = ace->baseaddr + reg;
        return in_8(r) | (in_8(r + 1) << 8);
 }
 
 static void ace_out_8(struct ace_device *ace, int reg, u16 val)
 {
-       void *r = ace->baseaddr + reg;
+       void __iomem *r = ace->baseaddr + reg;
        out_8(r, val);
        out_8(r + 1, val >> 8);
 }
 
 static void ace_datain_8(struct ace_device *ace)
 {
-       void *r = ace->baseaddr + 0x40;
+       void __iomem *r = ace->baseaddr + 0x40;
        u8 *dst = ace->data_ptr;
        int i = ACE_FIFO_SIZE;
        while (i--)
@@ -250,7 +250,7 @@ static void ace_datain_8(struct ace_device *ace)
 
 static void ace_dataout_8(struct ace_device *ace)
 {
-       void *r = ace->baseaddr + 0x40;
+       void __iomem *r = ace->baseaddr + 0x40;
        u8 *src = ace->data_ptr;
        int i = ACE_FIFO_SIZE;
        while (i--)
@@ -390,8 +390,8 @@ static inline void ace_dump_mem(void *base, int len)
 static void ace_dump_regs(struct ace_device *ace)
 {
        dev_info(ace->dev, "    ctrl:  %.8x  seccnt/cmd: %.4x      ver:%.4x\n"
-                "    status:%.8x  mpu_lba:%.8x  busmode:%4x\n"
-                "    error: %.8x  cfg_lba:%.8x  fatstat:%.4x\n",
+                KERN_INFO "    status:%.8x  mpu_lba:%.8x  busmode:%4x\n"
+                KERN_INFO "    error: %.8x  cfg_lba:%.8x  fatstat:%.4x\n",
                 ace_in32(ace, ACE_CTRL),
                 ace_in(ace, ACE_SECCNTCMD),
                 ace_in(ace, ACE_VERSION),
@@ -1005,11 +1005,6 @@ static int __devinit ace_setup(struct ace_device *ace)
        ace_out(ace, ACE_CTRL, ACE_CTRL_FORCECFGMODE |
                ACE_CTRL_DATABUFRDYIRQ | ACE_CTRL_ERRORIRQ);
 
-       /* Enable interrupts */
-       val = ace_in(ace, ACE_CTRL);
-       val |= ACE_CTRL_DATABUFRDYIRQ | ACE_CTRL_ERRORIRQ;
-       ace_out(ace, ACE_CTRL, val);
-
        /* Now we can hook up the irq handler */
        if (ace->irq != NO_IRQ) {
                rc = request_irq(ace->irq, ace_interrupt, 0, "systemace", ace);
@@ -1020,6 +1015,11 @@ static int __devinit ace_setup(struct ace_device *ace)
                }
        }
 
+       /* Enable interrupts */
+       val = ace_in(ace, ACE_CTRL);
+       val |= ACE_CTRL_DATABUFRDYIRQ | ACE_CTRL_ERRORIRQ;
+       ace_out(ace, ACE_CTRL, val);
+
        /* Print the identification */
        dev_info(ace->dev, "Xilinx SystemACE revision %i.%i.%i\n",
                 (version >> 12) & 0xf, (version >> 8) & 0x0f, version & 0xff);
@@ -1091,7 +1091,8 @@ ace_alloc(struct device *dev, int id, unsigned long physaddr,
        ace->bus_width = bus_width;
 
        /* Call the setup code */
-       if ((rc = ace_setup(ace)) != 0)
+       rc = ace_setup(ace);
+       if (rc)
                goto err_setup;
 
        dev_set_drvdata(dev, ace);
@@ -1253,11 +1254,13 @@ static int __init ace_init(void)
                goto err_blk;
        }
 
-       if ((rc = ace_of_register()) != 0)
+       rc = ace_of_register();
+       if (rc)
                goto err_of;
 
        pr_debug("xsysace: registering platform binding\n");
-       if ((rc = platform_driver_register(&ace_platform_driver)) != 0)
+       rc = platform_driver_register(&ace_platform_driver);
+       if (rc)
                goto err_plat;
 
        pr_info("Xilinx SystemACE device driver, major=%i\n", ace_major);