diff options
Diffstat (limited to 'arch/arm/common/locomo.c')
-rw-r--r-- | arch/arm/common/locomo.c | 49 |
1 files changed, 23 insertions, 26 deletions
diff --git a/arch/arm/common/locomo.c b/arch/arm/common/locomo.c index 23609400a8e2..a7dc1370695b 100644 --- a/arch/arm/common/locomo.c +++ b/arch/arm/common/locomo.c | |||
@@ -60,7 +60,7 @@ struct locomo { | |||
60 | unsigned long phys; | 60 | unsigned long phys; |
61 | unsigned int irq; | 61 | unsigned int irq; |
62 | spinlock_t lock; | 62 | spinlock_t lock; |
63 | void *base; | 63 | void __iomem *base; |
64 | }; | 64 | }; |
65 | 65 | ||
66 | struct locomo_dev_info { | 66 | struct locomo_dev_info { |
@@ -162,7 +162,7 @@ static void locomo_handler(unsigned int irq, struct irqdesc *desc, | |||
162 | { | 162 | { |
163 | int req, i; | 163 | int req, i; |
164 | struct irqdesc *d; | 164 | struct irqdesc *d; |
165 | void *mapbase = get_irq_chipdata(irq); | 165 | void __iomem *mapbase = get_irq_chipdata(irq); |
166 | 166 | ||
167 | /* Acknowledge the parent IRQ */ | 167 | /* Acknowledge the parent IRQ */ |
168 | desc->chip->ack(irq); | 168 | desc->chip->ack(irq); |
@@ -189,7 +189,7 @@ static void locomo_ack_irq(unsigned int irq) | |||
189 | 189 | ||
190 | static void locomo_mask_irq(unsigned int irq) | 190 | static void locomo_mask_irq(unsigned int irq) |
191 | { | 191 | { |
192 | void *mapbase = get_irq_chipdata(irq); | 192 | void __iomem *mapbase = get_irq_chipdata(irq); |
193 | unsigned int r; | 193 | unsigned int r; |
194 | r = locomo_readl(mapbase + LOCOMO_ICR); | 194 | r = locomo_readl(mapbase + LOCOMO_ICR); |
195 | r &= ~(0x0010 << (irq - LOCOMO_IRQ_START)); | 195 | r &= ~(0x0010 << (irq - LOCOMO_IRQ_START)); |
@@ -198,7 +198,7 @@ static void locomo_mask_irq(unsigned int irq) | |||
198 | 198 | ||
199 | static void locomo_unmask_irq(unsigned int irq) | 199 | static void locomo_unmask_irq(unsigned int irq) |
200 | { | 200 | { |
201 | void *mapbase = get_irq_chipdata(irq); | 201 | void __iomem *mapbase = get_irq_chipdata(irq); |
202 | unsigned int r; | 202 | unsigned int r; |
203 | r = locomo_readl(mapbase + LOCOMO_ICR); | 203 | r = locomo_readl(mapbase + LOCOMO_ICR); |
204 | r |= (0x0010 << (irq - LOCOMO_IRQ_START)); | 204 | r |= (0x0010 << (irq - LOCOMO_IRQ_START)); |
@@ -215,7 +215,7 @@ static void locomo_key_handler(unsigned int irq, struct irqdesc *desc, | |||
215 | struct pt_regs *regs) | 215 | struct pt_regs *regs) |
216 | { | 216 | { |
217 | struct irqdesc *d; | 217 | struct irqdesc *d; |
218 | void *mapbase = get_irq_chipdata(irq); | 218 | void __iomem *mapbase = get_irq_chipdata(irq); |
219 | 219 | ||
220 | if (locomo_readl(mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC) & 0x0001) { | 220 | if (locomo_readl(mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC) & 0x0001) { |
221 | d = irq_desc + LOCOMO_IRQ_KEY_START; | 221 | d = irq_desc + LOCOMO_IRQ_KEY_START; |
@@ -225,7 +225,7 @@ static void locomo_key_handler(unsigned int irq, struct irqdesc *desc, | |||
225 | 225 | ||
226 | static void locomo_key_ack_irq(unsigned int irq) | 226 | static void locomo_key_ack_irq(unsigned int irq) |
227 | { | 227 | { |
228 | void *mapbase = get_irq_chipdata(irq); | 228 | void __iomem *mapbase = get_irq_chipdata(irq); |
229 | unsigned int r; | 229 | unsigned int r; |
230 | r = locomo_readl(mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC); | 230 | r = locomo_readl(mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC); |
231 | r &= ~(0x0100 << (irq - LOCOMO_IRQ_KEY_START)); | 231 | r &= ~(0x0100 << (irq - LOCOMO_IRQ_KEY_START)); |
@@ -234,7 +234,7 @@ static void locomo_key_ack_irq(unsigned int irq) | |||
234 | 234 | ||
235 | static void locomo_key_mask_irq(unsigned int irq) | 235 | static void locomo_key_mask_irq(unsigned int irq) |
236 | { | 236 | { |
237 | void *mapbase = get_irq_chipdata(irq); | 237 | void __iomem *mapbase = get_irq_chipdata(irq); |
238 | unsigned int r; | 238 | unsigned int r; |
239 | r = locomo_readl(mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC); | 239 | r = locomo_readl(mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC); |
240 | r &= ~(0x0010 << (irq - LOCOMO_IRQ_KEY_START)); | 240 | r &= ~(0x0010 << (irq - LOCOMO_IRQ_KEY_START)); |
@@ -243,7 +243,7 @@ static void locomo_key_mask_irq(unsigned int irq) | |||
243 | 243 | ||
244 | static void locomo_key_unmask_irq(unsigned int irq) | 244 | static void locomo_key_unmask_irq(unsigned int irq) |
245 | { | 245 | { |
246 | void *mapbase = get_irq_chipdata(irq); | 246 | void __iomem *mapbase = get_irq_chipdata(irq); |
247 | unsigned int r; | 247 | unsigned int r; |
248 | r = locomo_readl(mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC); | 248 | r = locomo_readl(mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC); |
249 | r |= (0x0010 << (irq - LOCOMO_IRQ_KEY_START)); | 249 | r |= (0x0010 << (irq - LOCOMO_IRQ_KEY_START)); |
@@ -261,7 +261,7 @@ static void locomo_gpio_handler(unsigned int irq, struct irqdesc *desc, | |||
261 | { | 261 | { |
262 | int req, i; | 262 | int req, i; |
263 | struct irqdesc *d; | 263 | struct irqdesc *d; |
264 | void *mapbase = get_irq_chipdata(irq); | 264 | void __iomem *mapbase = get_irq_chipdata(irq); |
265 | 265 | ||
266 | req = locomo_readl(mapbase + LOCOMO_GIR) & | 266 | req = locomo_readl(mapbase + LOCOMO_GIR) & |
267 | locomo_readl(mapbase + LOCOMO_GPD) & | 267 | locomo_readl(mapbase + LOCOMO_GPD) & |
@@ -280,7 +280,7 @@ static void locomo_gpio_handler(unsigned int irq, struct irqdesc *desc, | |||
280 | 280 | ||
281 | static void locomo_gpio_ack_irq(unsigned int irq) | 281 | static void locomo_gpio_ack_irq(unsigned int irq) |
282 | { | 282 | { |
283 | void *mapbase = get_irq_chipdata(irq); | 283 | void __iomem *mapbase = get_irq_chipdata(irq); |
284 | unsigned int r; | 284 | unsigned int r; |
285 | r = locomo_readl(mapbase + LOCOMO_GWE); | 285 | r = locomo_readl(mapbase + LOCOMO_GWE); |
286 | r |= (0x0001 << (irq - LOCOMO_IRQ_GPIO_START)); | 286 | r |= (0x0001 << (irq - LOCOMO_IRQ_GPIO_START)); |
@@ -297,7 +297,7 @@ static void locomo_gpio_ack_irq(unsigned int irq) | |||
297 | 297 | ||
298 | static void locomo_gpio_mask_irq(unsigned int irq) | 298 | static void locomo_gpio_mask_irq(unsigned int irq) |
299 | { | 299 | { |
300 | void *mapbase = get_irq_chipdata(irq); | 300 | void __iomem *mapbase = get_irq_chipdata(irq); |
301 | unsigned int r; | 301 | unsigned int r; |
302 | r = locomo_readl(mapbase + LOCOMO_GIE); | 302 | r = locomo_readl(mapbase + LOCOMO_GIE); |
303 | r &= ~(0x0001 << (irq - LOCOMO_IRQ_GPIO_START)); | 303 | r &= ~(0x0001 << (irq - LOCOMO_IRQ_GPIO_START)); |
@@ -306,7 +306,7 @@ static void locomo_gpio_mask_irq(unsigned int irq) | |||
306 | 306 | ||
307 | static void locomo_gpio_unmask_irq(unsigned int irq) | 307 | static void locomo_gpio_unmask_irq(unsigned int irq) |
308 | { | 308 | { |
309 | void *mapbase = get_irq_chipdata(irq); | 309 | void __iomem *mapbase = get_irq_chipdata(irq); |
310 | unsigned int r; | 310 | unsigned int r; |
311 | r = locomo_readl(mapbase + LOCOMO_GIE); | 311 | r = locomo_readl(mapbase + LOCOMO_GIE); |
312 | r |= (0x0001 << (irq - LOCOMO_IRQ_GPIO_START)); | 312 | r |= (0x0001 << (irq - LOCOMO_IRQ_GPIO_START)); |
@@ -323,7 +323,7 @@ static void locomo_lt_handler(unsigned int irq, struct irqdesc *desc, | |||
323 | struct pt_regs *regs) | 323 | struct pt_regs *regs) |
324 | { | 324 | { |
325 | struct irqdesc *d; | 325 | struct irqdesc *d; |
326 | void *mapbase = get_irq_chipdata(irq); | 326 | void __iomem *mapbase = get_irq_chipdata(irq); |
327 | 327 | ||
328 | if (locomo_readl(mapbase + LOCOMO_LTINT) & 0x0001) { | 328 | if (locomo_readl(mapbase + LOCOMO_LTINT) & 0x0001) { |
329 | d = irq_desc + LOCOMO_IRQ_LT_START; | 329 | d = irq_desc + LOCOMO_IRQ_LT_START; |
@@ -333,7 +333,7 @@ static void locomo_lt_handler(unsigned int irq, struct irqdesc *desc, | |||
333 | 333 | ||
334 | static void locomo_lt_ack_irq(unsigned int irq) | 334 | static void locomo_lt_ack_irq(unsigned int irq) |
335 | { | 335 | { |
336 | void *mapbase = get_irq_chipdata(irq); | 336 | void __iomem *mapbase = get_irq_chipdata(irq); |
337 | unsigned int r; | 337 | unsigned int r; |
338 | r = locomo_readl(mapbase + LOCOMO_LTINT); | 338 | r = locomo_readl(mapbase + LOCOMO_LTINT); |
339 | r &= ~(0x0100 << (irq - LOCOMO_IRQ_LT_START)); | 339 | r &= ~(0x0100 << (irq - LOCOMO_IRQ_LT_START)); |
@@ -342,7 +342,7 @@ static void locomo_lt_ack_irq(unsigned int irq) | |||
342 | 342 | ||
343 | static void locomo_lt_mask_irq(unsigned int irq) | 343 | static void locomo_lt_mask_irq(unsigned int irq) |
344 | { | 344 | { |
345 | void *mapbase = get_irq_chipdata(irq); | 345 | void __iomem *mapbase = get_irq_chipdata(irq); |
346 | unsigned int r; | 346 | unsigned int r; |
347 | r = locomo_readl(mapbase + LOCOMO_LTINT); | 347 | r = locomo_readl(mapbase + LOCOMO_LTINT); |
348 | r &= ~(0x0010 << (irq - LOCOMO_IRQ_LT_START)); | 348 | r &= ~(0x0010 << (irq - LOCOMO_IRQ_LT_START)); |
@@ -351,7 +351,7 @@ static void locomo_lt_mask_irq(unsigned int irq) | |||
351 | 351 | ||
352 | static void locomo_lt_unmask_irq(unsigned int irq) | 352 | static void locomo_lt_unmask_irq(unsigned int irq) |
353 | { | 353 | { |
354 | void *mapbase = get_irq_chipdata(irq); | 354 | void __iomem *mapbase = get_irq_chipdata(irq); |
355 | unsigned int r; | 355 | unsigned int r; |
356 | r = locomo_readl(mapbase + LOCOMO_LTINT); | 356 | r = locomo_readl(mapbase + LOCOMO_LTINT); |
357 | r |= (0x0010 << (irq - LOCOMO_IRQ_LT_START)); | 357 | r |= (0x0010 << (irq - LOCOMO_IRQ_LT_START)); |
@@ -369,7 +369,7 @@ static void locomo_spi_handler(unsigned int irq, struct irqdesc *desc, | |||
369 | { | 369 | { |
370 | int req, i; | 370 | int req, i; |
371 | struct irqdesc *d; | 371 | struct irqdesc *d; |
372 | void *mapbase = get_irq_chipdata(irq); | 372 | void __iomem *mapbase = get_irq_chipdata(irq); |
373 | 373 | ||
374 | req = locomo_readl(mapbase + LOCOMO_SPIIR) & 0x000F; | 374 | req = locomo_readl(mapbase + LOCOMO_SPIIR) & 0x000F; |
375 | if (req) { | 375 | if (req) { |
@@ -386,7 +386,7 @@ static void locomo_spi_handler(unsigned int irq, struct irqdesc *desc, | |||
386 | 386 | ||
387 | static void locomo_spi_ack_irq(unsigned int irq) | 387 | static void locomo_spi_ack_irq(unsigned int irq) |
388 | { | 388 | { |
389 | void *mapbase = get_irq_chipdata(irq); | 389 | void __iomem *mapbase = get_irq_chipdata(irq); |
390 | unsigned int r; | 390 | unsigned int r; |
391 | r = locomo_readl(mapbase + LOCOMO_SPIWE); | 391 | r = locomo_readl(mapbase + LOCOMO_SPIWE); |
392 | r |= (0x0001 << (irq - LOCOMO_IRQ_SPI_START)); | 392 | r |= (0x0001 << (irq - LOCOMO_IRQ_SPI_START)); |
@@ -403,7 +403,7 @@ static void locomo_spi_ack_irq(unsigned int irq) | |||
403 | 403 | ||
404 | static void locomo_spi_mask_irq(unsigned int irq) | 404 | static void locomo_spi_mask_irq(unsigned int irq) |
405 | { | 405 | { |
406 | void *mapbase = get_irq_chipdata(irq); | 406 | void __iomem *mapbase = get_irq_chipdata(irq); |
407 | unsigned int r; | 407 | unsigned int r; |
408 | r = locomo_readl(mapbase + LOCOMO_SPIIE); | 408 | r = locomo_readl(mapbase + LOCOMO_SPIIE); |
409 | r &= ~(0x0001 << (irq - LOCOMO_IRQ_SPI_START)); | 409 | r &= ~(0x0001 << (irq - LOCOMO_IRQ_SPI_START)); |
@@ -412,7 +412,7 @@ static void locomo_spi_mask_irq(unsigned int irq) | |||
412 | 412 | ||
413 | static void locomo_spi_unmask_irq(unsigned int irq) | 413 | static void locomo_spi_unmask_irq(unsigned int irq) |
414 | { | 414 | { |
415 | void *mapbase = get_irq_chipdata(irq); | 415 | void __iomem *mapbase = get_irq_chipdata(irq); |
416 | unsigned int r; | 416 | unsigned int r; |
417 | r = locomo_readl(mapbase + LOCOMO_SPIIE); | 417 | r = locomo_readl(mapbase + LOCOMO_SPIIE); |
418 | r |= (0x0001 << (irq - LOCOMO_IRQ_SPI_START)); | 418 | r |= (0x0001 << (irq - LOCOMO_IRQ_SPI_START)); |
@@ -428,7 +428,7 @@ static struct irqchip locomo_spi_chip = { | |||
428 | static void locomo_setup_irq(struct locomo *lchip) | 428 | static void locomo_setup_irq(struct locomo *lchip) |
429 | { | 429 | { |
430 | int irq; | 430 | int irq; |
431 | void *irqbase = lchip->base; | 431 | void __iomem *irqbase = lchip->base; |
432 | 432 | ||
433 | /* | 433 | /* |
434 | * Install handler for IRQ_LOCOMO_HW. | 434 | * Install handler for IRQ_LOCOMO_HW. |
@@ -501,12 +501,11 @@ locomo_init_one_child(struct locomo *lchip, struct locomo_dev_info *info) | |||
501 | struct locomo_dev *dev; | 501 | struct locomo_dev *dev; |
502 | int ret; | 502 | int ret; |
503 | 503 | ||
504 | dev = kmalloc(sizeof(struct locomo_dev), GFP_KERNEL); | 504 | dev = kzalloc(sizeof(struct locomo_dev), GFP_KERNEL); |
505 | if (!dev) { | 505 | if (!dev) { |
506 | ret = -ENOMEM; | 506 | ret = -ENOMEM; |
507 | goto out; | 507 | goto out; |
508 | } | 508 | } |
509 | memset(dev, 0, sizeof(struct locomo_dev)); | ||
510 | 509 | ||
511 | strncpy(dev->dev.bus_id,info->name,sizeof(dev->dev.bus_id)); | 510 | strncpy(dev->dev.bus_id,info->name,sizeof(dev->dev.bus_id)); |
512 | /* | 511 | /* |
@@ -664,12 +663,10 @@ __locomo_probe(struct device *me, struct resource *mem, int irq) | |||
664 | unsigned long r; | 663 | unsigned long r; |
665 | int i, ret = -ENODEV; | 664 | int i, ret = -ENODEV; |
666 | 665 | ||
667 | lchip = kmalloc(sizeof(struct locomo), GFP_KERNEL); | 666 | lchip = kzalloc(sizeof(struct locomo), GFP_KERNEL); |
668 | if (!lchip) | 667 | if (!lchip) |
669 | return -ENOMEM; | 668 | return -ENOMEM; |
670 | 669 | ||
671 | memset(lchip, 0, sizeof(struct locomo)); | ||
672 | |||
673 | spin_lock_init(&lchip->lock); | 670 | spin_lock_init(&lchip->lock); |
674 | 671 | ||
675 | lchip->dev = me; | 672 | lchip->dev = me; |