]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] pmac iomem annotations
authorAlexander Viro <viro@parcelfarce.linux.theplanet.co.uk>
Sat, 27 Nov 2004 08:04:36 +0000 (00:04 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Sat, 27 Nov 2004 08:04:36 +0000 (00:04 -0800)
Signed-off-by: Al Viro <viro@parcelfarce.linux.theplanet.co.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/ppc/platforms/pmac_feature.c
drivers/macintosh/ans-lcd.c
drivers/macintosh/macio-adb.c
drivers/macintosh/mediabay.c
drivers/macintosh/via-cuda.c
drivers/macintosh/via-pmu.c
include/asm-ppc/pmac_feature.h

index 24b22145028fc5b9e67f72903ac7639cea697e2c..c87d52bf032769dc82ab7b6d6930143342d94db9 100644 (file)
@@ -117,10 +117,10 @@ static const char* macio_names[] __pmacdata =
 #define UN_BIC(r,v)    (UN_OUT((r), UN_IN(r) & ~(v)))
 
 static struct device_node* uninorth_node __pmacdata;
-static u32* uninorth_base __pmacdata;
+static u32 __iomem * uninorth_base __pmacdata;
 static u32 uninorth_rev __pmacdata;
 static int uninorth_u3 __pmacdata;
-static void *u3_ht;
+static void __iomem *u3_ht;
 
 /*
  * For each motherboard family, we have a table of functions pointers
@@ -517,7 +517,7 @@ dbdma_save(struct macio_chip* macio, struct dbdma_regs* save)
 
        /* Save state & config of DBDMA channels */
        for (i=0; i<13; i++) {
-               volatile struct dbdma_regs* chan = (volatile struct dbdma_regs*)
+               volatile struct dbdma_regs __iomem * chan = (void __iomem *)
                        (macio->base + ((0x8000+i*0x100)>>2));
                save[i].cmdptr_hi = in_le32(&chan->cmdptr_hi);
                save[i].cmdptr = in_le32(&chan->cmdptr);
@@ -534,7 +534,7 @@ dbdma_restore(struct macio_chip* macio, struct dbdma_regs* save)
 
        /* Save state & config of DBDMA channels */
        for (i=0; i<13; i++) {
-               volatile struct dbdma_regs* chan = (volatile struct dbdma_regs*)
+               volatile struct dbdma_regs __iomem * chan = (void __iomem *)
                        (macio->base + ((0x8000+i*0x100)>>2));
                out_le32(&chan->control, (ACTIVE|DEAD|WAKE|FLUSH|PAUSE|RUN)<<16);
                while (in_le32(&chan->status) & ACTIVE)
@@ -2286,14 +2286,14 @@ found:
 #ifndef CONFIG_POWER4
        /* Fixup Hooper vs. Comet */
        if (pmac_mb.model_id == PMAC_TYPE_HOOPER) {
-               u32* mach_id_ptr = (u32*)ioremap(0xf3000034, 4);
+               u32 __iomem * mach_id_ptr = ioremap(0xf3000034, 4);
                if (!mach_id_ptr)
                        return -ENODEV;
                /* Here, I used to disable the media-bay on comet. It
                 * appears this is wrong, the floppy connector is actually
                 * a kind of media-bay and works with the current driver.
                 */
-               if ((*mach_id_ptr) & 0x20000000UL)
+               if (__raw_readl(mach_id_ptr) & 0x20000000UL)
                        pmac_mb.model_id = PMAC_TYPE_COMET;
                iounmap(mach_id_ptr);
        }
@@ -2394,7 +2394,7 @@ probe_one_macio(const char* name, const char* compat, int type)
 {
        struct device_node*     node;
        int                     i;
-       volatile u32*           base;
+       volatile u32 __iomem *  base;
        u32*                    revp;
 
        node = find_devices(name);
@@ -2419,7 +2419,7 @@ probe_one_macio(const char* name, const char* compat, int type)
                printk(KERN_ERR "pmac_feature: %s skipped\n", node->full_name);
                return;
        }
-       base = (volatile u32*)ioremap(node->addrs[0].address, node->addrs[0].size);
+       base = ioremap(node->addrs[0].address, node->addrs[0].size);
        if (!base) {
                printk(KERN_ERR "pmac_feature: Can't map mac-io chip !\n");
                return;
index 26bdcd7da386779638291c9aace4f297af998584..c5adb05e3ff09257287d91655f4d1912b578aabe 100644 (file)
@@ -23,7 +23,7 @@
 
 static unsigned long anslcd_short_delay = 80;
 static unsigned long anslcd_long_delay = 3280;
-static volatile unsigned charanslcd_ptr;
+static volatile unsigned char __iomem *anslcd_ptr;
 
 #undef DEBUG
 
@@ -151,12 +151,12 @@ anslcd_init(void)
        if (strcmp(node->parent->name, "gc"))
                return -ENODEV;
 
-       anslcd_ptr = (volatile unsigned char*)ioremap(ANSLCD_ADDR, 0x20);
+       anslcd_ptr = ioremap(ANSLCD_ADDR, 0x20);
        
        retval = misc_register(&anslcd_dev);
        if(retval < 0){
                printk(KERN_INFO "LCD: misc_register failed\n");
-               iounmap((void *)anslcd_ptr);
+               iounmap(anslcd_ptr);
                return retval;
        }
 
@@ -179,7 +179,7 @@ static void __exit
 anslcd_exit(void)
 {
        misc_deregister(&anslcd_dev);
-       iounmap((void *)anslcd_ptr);
+       iounmap(anslcd_ptr);
 }
 
 module_init(anslcd_init);
index 8d9699dee946f864c139001ae030fa9b5fd5708f..d4e651b01d57ba9f45e1ddb06a9499d354e31dba 100644 (file)
@@ -57,7 +57,7 @@ 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;
 
@@ -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);
index 416cd08b1cba39a211c197c812b88e1cd7458dbe..9f0e47d28be2f112e25b9ea0300a83ac6bf18c44 100644 (file)
@@ -45,7 +45,7 @@
 #endif
 
 #define MB_FCR32(bay, r)       ((bay)->base + ((r) >> 2))
-#define MB_FCR8(bay, r)                (((volatile __iomem u8*)((bay)->base)) + (r))
+#define MB_FCR8(bay, r)                (((volatile u8 __iomem *)((bay)->base)) + (r))
 
 #define MB_IN32(bay,r)         (in_le32(MB_FCR32(bay,r)))
 #define MB_OUT32(bay,r,v)      (out_le32(MB_FCR32(bay,r), (v)))
index 70723139f155665a52a1556b6ad46ebbb831bfba..e5e3d0202820593996c7731590b2feba36d2f3e7 100644 (file)
@@ -32,7 +32,7 @@
 #include <asm/system.h>
 #include <linux/init.h>
 
-static volatile unsigned char *via;
+static volatile unsigned char __iomem *via;
 static spinlock_t cuda_lock = SPIN_LOCK_UNLOCKED;
 
 #ifdef CONFIG_MAC
@@ -160,7 +160,7 @@ find_via_cuda(void)
        if (vias->n_addrs < 1 || vias->n_intrs < 1)
            return 0;
     }
-    via = (volatile unsigned char *) ioremap(vias->addrs->address, 0x2000);
+    via = ioremap(vias->addrs->address, 0x2000);
 
     cuda_state = idle;
     sys_ctrler = SYS_CTRLER_CUDA;
index d27ae685897aa4f95247b09913d11450f594eb55..85e375692b26ba8f4834a8bc27c1de8cb9d3317e 100644 (file)
@@ -72,7 +72,7 @@
 /* How many iterations between battery polls */
 #define BATTERY_POLLING_COUNT  2
 
-static volatile unsigned char *via;
+static volatile unsigned char __iomem *via;
 
 /* VIA registers - spaced 0x200 bytes apart */
 #define RS             0x200           /* skip between registers */
@@ -141,7 +141,7 @@ static struct device_node *vias;
 static int pmu_kind = PMU_UNKNOWN;
 static int pmu_fully_inited = 0;
 static int pmu_has_adb;
-static unsigned char *gpio_reg = NULL;
+static unsigned char __iomem *gpio_reg = NULL;
 static int gpio_irq = -1;
 static int gpio_irq_enabled = -1;
 static volatile int pmu_suspended = 0;
@@ -352,7 +352,7 @@ find_via_pmu(void)
        } else
                pmu_kind = PMU_UNKNOWN;
 
-       via = (volatile unsigned char *) ioremap(vias->addrs->address, 0x2000);
+       via = ioremap(vias->addrs->address, 0x2000);
        
        out_8(&via[IER], IER_CLR | 0x7f);       /* disable all intrs */
        out_8(&via[IFR], 0x7f);                 /* clear IFR */
@@ -1164,7 +1164,7 @@ wait_for_ack(void)
 static inline void
 send_byte(int x)
 {
-       volatile unsigned char *v = via;
+       volatile unsigned char __iomem *v = via;
 
        out_8(&v[ACR], in_8(&v[ACR]) | SR_OUT | SR_EXT);
        out_8(&v[SR], x);
@@ -1175,7 +1175,7 @@ send_byte(int x)
 static inline void
 recv_byte(void)
 {
-       volatile unsigned char *v = via;
+       volatile unsigned char __iomem *v = via;
 
        out_8(&v[ACR], (in_8(&v[ACR]) & ~SR_OUT) | SR_EXT);
        in_8(&v[SR]);           /* resets SR */
@@ -2630,8 +2630,8 @@ powerbook_sleep_3400(void)
        unsigned int hid0;
        unsigned long p;
        struct adb_request sleep_req;
-       char *mem_ctrl;
-       unsigned int *mem_ctrl_sleep;
+       void __iomem *mem_ctrl;
+       unsigned int __iomem *mem_ctrl_sleep;
 
        /* first map in the memory controller registers */
        mem_ctrl = ioremap(PB3400_MEM_CTRL, 0x100);
@@ -2639,7 +2639,7 @@ powerbook_sleep_3400(void)
                printk("powerbook_sleep_3400: ioremap failed\n");
                return -ENOMEM;
        }
-       mem_ctrl_sleep = (unsigned int *) (mem_ctrl + PB3400_MEM_CTRL_SLEEP);
+       mem_ctrl_sleep = mem_ctrl + PB3400_MEM_CTRL_SLEEP;
 
        /* Allocate room for PCI save */
        pbook_alloc_pci_save();
@@ -2977,7 +2977,7 @@ void pmu_device_init(void)
 
 #ifdef DEBUG_SLEEP
 static inline void  __pmac
-polled_handshake(volatile unsigned char *via)
+polled_handshake(volatile unsigned char __iomem *via)
 {
        via[B] &= ~TREQ; eieio();
        while ((via[B] & TACK) != 0)
@@ -2988,7 +2988,7 @@ polled_handshake(volatile unsigned char *via)
 }
 
 static inline void  __pmac
-polled_send_byte(volatile unsigned char *via, int x)
+polled_send_byte(volatile unsigned char __iomem *via, int x)
 {
        via[ACR] |= SR_OUT | SR_EXT; eieio();
        via[SR] = x; eieio();
@@ -2996,7 +2996,7 @@ polled_send_byte(volatile unsigned char *via, int x)
 }
 
 static inline int __pmac
-polled_recv_byte(volatile unsigned char *via)
+polled_recv_byte(volatile unsigned char __iomem *via)
 {
        int x;
 
@@ -3012,7 +3012,7 @@ pmu_polled_request(struct adb_request *req)
 {
        unsigned long flags;
        int i, l, c;
-       volatile unsigned char *v = via;
+       volatile unsigned char __iomem *v = via;
 
        req->complete = 1;
        c = req->data[0];
index 33b852186d908be96e7188bec90df5a80a698827..6540eb82c339011c2da74f6b7c3d8c24a805e020 100644 (file)
@@ -315,7 +315,7 @@ struct macio_chip
        int                     type;
        const char              *name;
        int                     rev;
-       volatile u32            *base;
+       volatile u32            __iomem *base;
        unsigned long           flags;
 
        /* For use by macio_asic PCI driver */
@@ -333,7 +333,7 @@ extern struct macio_chip macio_chips[MAX_MACIO_CHIPS];
 extern struct macio_chip* macio_find(struct device_node* child, int type);
 
 #define MACIO_FCR32(macio, r)  ((macio)->base + ((r) >> 2))
-#define MACIO_FCR8(macio, r)   (((volatile u8*)((macio)->base)) + (r))
+#define MACIO_FCR8(macio, r)   (((volatile u8 __iomem *)((macio)->base)) + (r))
 
 #define MACIO_IN32(r)          (in_le32(MACIO_FCR32(macio,r)))
 #define MACIO_OUT32(r,v)       (out_le32(MACIO_FCR32(macio,r), (v)))