vserver 1.9.5.x5
[linux-2.6.git] / drivers / macintosh / macio-adb.c
index f8bc90f..cf6a6f2 100644 (file)
@@ -57,9 +57,9 @@ struct adb_regs {
 /* Bits in autopoll register */
 #define APE    1               /* autopoll enable */
 
-static volatile struct adb_regs *adb;
+static volatile struct adb_regs __iomem *adb;
 static struct adb_request *current_req, *last_req;
-static spinlock_t macio_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(macio_lock);
 
 static int macio_probe(void);
 static int macio_init(void);
@@ -105,8 +105,7 @@ int macio_init(void)
        printk("\n"); }
 #endif
        
-       adb = (volatile struct adb_regs *)
-               ioremap(adbs->addrs->address, sizeof(struct adb_regs));
+       adb = ioremap(adbs->addrs->address, sizeof(struct adb_regs));
 
        out_8(&adb->ctrl.r, 0);
        out_8(&adb->intr.r, 0);
@@ -175,7 +174,7 @@ static int macio_send_request(struct adb_request *req, int sync)
                req->data[i] = req->data[i+1];
        --req->nbytes;
        
-       req->next = 0;
+       req->next = NULL;
        req->sent = 0;
        req->complete = 0;
        req->reply_len = 0;
@@ -202,7 +201,7 @@ static irqreturn_t macio_adb_interrupt(int irq, void *arg,
                                       struct pt_regs *regs)
 {
        int i, n, err;
-       struct adb_request *req;
+       struct adb_request *req = NULL;
        unsigned char ibuf[16];
        int ibuf_len = 0;
        int complete = 0;
@@ -280,6 +279,6 @@ static void macio_adb_poll(void)
 
        local_irq_save(flags);
        if (in_8(&adb->intr.r) != 0)
-               macio_adb_interrupt(0, 0, 0);
+               macio_adb_interrupt(0, NULL, NULL);
        local_irq_restore(flags);
 }