Commit fc6de305 authored by Russell King's avatar Russell King

[ARM] Fix SA1111 and PXA iomem sparse warnings.

This adds some missing annotations found by making the raw IO
operations check their pointer type.
Signed-off-by: default avatarRussell King <rmk@arm.linux.org.uk>
parent 3f68f599
......@@ -53,7 +53,7 @@ struct sa1111 {
unsigned long phys;
int irq;
spinlock_t lock;
void *base;
void __iomem *base;
};
/*
......@@ -141,15 +141,16 @@ static void
sa1111_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
{
unsigned int stat0, stat1, i;
void __iomem *base = desc->data;
stat0 = sa1111_readl(desc->data + SA1111_INTSTATCLR0);
stat1 = sa1111_readl(desc->data + SA1111_INTSTATCLR1);
stat0 = sa1111_readl(base + SA1111_INTSTATCLR0);
stat1 = sa1111_readl(base + SA1111_INTSTATCLR1);
sa1111_writel(stat0, desc->data + SA1111_INTSTATCLR0);
sa1111_writel(stat0, base + SA1111_INTSTATCLR0);
desc->chip->ack(irq);
sa1111_writel(stat1, desc->data + SA1111_INTSTATCLR1);
sa1111_writel(stat1, base + SA1111_INTSTATCLR1);
if (stat0 == 0 && stat1 == 0) {
do_bad_IRQ(irq, desc, regs);
......@@ -177,7 +178,7 @@ static void sa1111_ack_irq(unsigned int irq)
static void sa1111_mask_lowirq(unsigned int irq)
{
void *mapbase = get_irq_chipdata(irq);
void __iomem *mapbase = get_irq_chipdata(irq);
unsigned long ie0;
ie0 = sa1111_readl(mapbase + SA1111_INTEN0);
......@@ -187,7 +188,7 @@ static void sa1111_mask_lowirq(unsigned int irq)
static void sa1111_unmask_lowirq(unsigned int irq)
{
void *mapbase = get_irq_chipdata(irq);
void __iomem *mapbase = get_irq_chipdata(irq);
unsigned long ie0;
ie0 = sa1111_readl(mapbase + SA1111_INTEN0);
......@@ -205,7 +206,7 @@ static void sa1111_unmask_lowirq(unsigned int irq)
static int sa1111_retrigger_lowirq(unsigned int irq)
{
unsigned int mask = SA1111_IRQMASK_LO(irq);
void *mapbase = get_irq_chipdata(irq);
void __iomem *mapbase = get_irq_chipdata(irq);
unsigned long ip0;
int i;
......@@ -226,7 +227,7 @@ static int sa1111_retrigger_lowirq(unsigned int irq)
static int sa1111_type_lowirq(unsigned int irq, unsigned int flags)
{
unsigned int mask = SA1111_IRQMASK_LO(irq);
void *mapbase = get_irq_chipdata(irq);
void __iomem *mapbase = get_irq_chipdata(irq);
unsigned long ip0;
if (flags == IRQT_PROBE)
......@@ -249,7 +250,7 @@ static int sa1111_type_lowirq(unsigned int irq, unsigned int flags)
static int sa1111_wake_lowirq(unsigned int irq, unsigned int on)
{
unsigned int mask = SA1111_IRQMASK_LO(irq);
void *mapbase = get_irq_chipdata(irq);
void __iomem *mapbase = get_irq_chipdata(irq);
unsigned long we0;
we0 = sa1111_readl(mapbase + SA1111_WAKEEN0);
......@@ -273,7 +274,7 @@ static struct irqchip sa1111_low_chip = {
static void sa1111_mask_highirq(unsigned int irq)
{
void *mapbase = get_irq_chipdata(irq);
void __iomem *mapbase = get_irq_chipdata(irq);
unsigned long ie1;
ie1 = sa1111_readl(mapbase + SA1111_INTEN1);
......@@ -283,7 +284,7 @@ static void sa1111_mask_highirq(unsigned int irq)
static void sa1111_unmask_highirq(unsigned int irq)
{
void *mapbase = get_irq_chipdata(irq);
void __iomem *mapbase = get_irq_chipdata(irq);
unsigned long ie1;
ie1 = sa1111_readl(mapbase + SA1111_INTEN1);
......@@ -301,7 +302,7 @@ static void sa1111_unmask_highirq(unsigned int irq)
static int sa1111_retrigger_highirq(unsigned int irq)
{
unsigned int mask = SA1111_IRQMASK_HI(irq);
void *mapbase = get_irq_chipdata(irq);
void __iomem *mapbase = get_irq_chipdata(irq);
unsigned long ip1;
int i;
......@@ -322,7 +323,7 @@ static int sa1111_retrigger_highirq(unsigned int irq)
static int sa1111_type_highirq(unsigned int irq, unsigned int flags)
{
unsigned int mask = SA1111_IRQMASK_HI(irq);
void *mapbase = get_irq_chipdata(irq);
void __iomem *mapbase = get_irq_chipdata(irq);
unsigned long ip1;
if (flags == IRQT_PROBE)
......@@ -345,7 +346,7 @@ static int sa1111_type_highirq(unsigned int irq, unsigned int flags)
static int sa1111_wake_highirq(unsigned int irq, unsigned int on)
{
unsigned int mask = SA1111_IRQMASK_HI(irq);
void *mapbase = get_irq_chipdata(irq);
void __iomem *mapbase = get_irq_chipdata(irq);
unsigned long we1;
we1 = sa1111_readl(mapbase + SA1111_WAKEEN1);
......@@ -369,7 +370,7 @@ static struct irqchip sa1111_high_chip = {
static void sa1111_setup_irq(struct sa1111 *sachip)
{
void *irqbase = sachip->base + SA1111_INTC;
void __iomem *irqbase = sachip->base + SA1111_INTC;
unsigned int irq;
/*
......@@ -723,7 +724,7 @@ __sa1111_probe(struct device *me, struct resource *mem, int irq)
static void __sa1111_remove(struct sa1111 *sachip)
{
struct list_head *l, *n;
void *irqbase = sachip->base + SA1111_INTC;
void __iomem *irqbase = sachip->base + SA1111_INTC;
list_for_each_safe(l, n, &sachip->dev->children) {
struct device *d = list_to_dev(l);
......@@ -805,7 +806,7 @@ static int sa1111_suspend(struct device *dev, u32 state, u32 level)
struct sa1111_save_data *save;
unsigned long flags;
unsigned int val;
char *base;
void __iomem *base;
if (level != SUSPEND_DISABLE)
return 0;
......@@ -866,7 +867,7 @@ static int sa1111_resume(struct device *dev, u32 level)
struct sa1111 *sachip = dev_get_drvdata(dev);
struct sa1111_save_data *save;
unsigned long flags, id;
char *base;
void __iomem *base;
if (level != RESUME_ENABLE)
return 0;
......@@ -1094,7 +1095,7 @@ void sa1111_set_io_dir(struct sa1111_dev *sadev,
struct sa1111 *sachip = sa1111_chip_driver(sadev);
unsigned long flags;
unsigned int val;
void *gpio = sachip->base + SA1111_GPIO;
void __iomem *gpio = sachip->base + SA1111_GPIO;
#define MODIFY_BITS(port, mask, dir) \
if (mask) { \
......@@ -1120,7 +1121,7 @@ void sa1111_set_io(struct sa1111_dev *sadev, unsigned int bits, unsigned int v)
struct sa1111 *sachip = sa1111_chip_driver(sadev);
unsigned long flags;
unsigned int val;
void *gpio = sachip->base + SA1111_GPIO;
void __iomem *gpio = sachip->base + SA1111_GPIO;
spin_lock_irqsave(&sachip->lock, flags);
MODIFY_BITS(gpio + SA1111_GPIO_PADWR, bits & 15, v);
......@@ -1134,7 +1135,7 @@ void sa1111_set_sleep_io(struct sa1111_dev *sadev, unsigned int bits, unsigned i
struct sa1111 *sachip = sa1111_chip_driver(sadev);
unsigned long flags;
unsigned int val;
void *gpio = sachip->base + SA1111_GPIO;
void __iomem *gpio = sachip->base + SA1111_GPIO;
spin_lock_irqsave(&sachip->lock, flags);
MODIFY_BITS(gpio + SA1111_GPIO_PASSR, bits & 15, v);
......
......@@ -28,7 +28,7 @@
struct ps2if {
struct serio *io;
struct sa1111_dev *dev;
unsigned long base;
void __iomem *base;
unsigned int open;
spinlock_t lock;
unsigned int head;
......@@ -272,7 +272,7 @@ static int ps2_probe(struct sa1111_dev *dev)
/*
* Our parent device has already mapped the region.
*/
ps2if->base = (unsigned long)dev->mapbase;
ps2if->base = dev->mapbase;
sa1111_enable_device(ps2if->dev);
......
......@@ -52,7 +52,7 @@ struct pxamci_host {
struct mmc_host *mmc;
spinlock_t lock;
struct resource *res;
void *base;
void __iomem *base;
int irq;
int dma;
unsigned int clkrt;
......
......@@ -397,8 +397,8 @@ soc_common_pcmcia_set_io_map(struct pcmcia_socket *sock, struct pccard_io_map *m
map->stop = PAGE_SIZE-1;
map->stop -= map->start;
map->stop += (unsigned long)skt->virt_io;
map->start = (unsigned long)skt->virt_io;
map->stop += skt->socket.io_offset;
map->start = skt->socket.io_offset;
return 0;
}
......
......@@ -53,7 +53,7 @@ struct soc_pcmcia_socket {
struct resource res_io;
struct resource res_mem;
struct resource res_attr;
void *virt_io;
void __iomem *virt_io;
unsigned int irq_state;
......
......@@ -49,8 +49,8 @@
*/
#define __CCREG(x) __REGP(SA1111_VBASE + (x))
#define sa1111_writel(val,addr) ({ *(volatile unsigned int *)(addr) = (val); })
#define sa1111_readl(addr) (*(volatile unsigned int *)(addr))
#define sa1111_writel(val,addr) __raw_writel(val, addr)
#define sa1111_readl(addr) __raw_readl(addr)
/*
* System Bus Interface (SBI)
......@@ -551,7 +551,7 @@ struct sa1111_dev {
struct device dev;
unsigned int devid;
struct resource res;
void *mapbase;
void __iomem *mapbase;
unsigned int skpcr_mask;
unsigned int irq[6];
u64 dma_mask;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment