diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-03-27 06:30:31 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-03-27 06:30:31 -0400 |
commit | b0df89868006517417251e02cc4ce5d4b0165885 (patch) | |
tree | 6800388c633a13f64fd1f7845ce026ca2606522f /drivers | |
parent | 4ba21e868f4b6e2ce5432055e206edadc6319533 (diff) | |
parent | 6c634726352f0d796a4b5e6aa9849ee5b45712ce (diff) |
Merge branch 'devel-stable' into for-linus
Conflicts:
arch/arm/Kconfig.debug
arch/arm/plat-versatile/Kconfig
Merge fixes:
arch/arm/mach-integrator/Kconfig
drivers/clocksource/Kconfig
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/amba/bus.c | 105 | ||||
-rw-r--r-- | drivers/clocksource/Kconfig | 1 | ||||
-rw-r--r-- | drivers/gpio/gpio-pxa.c | 2 | ||||
-rw-r--r-- | drivers/mmc/host/mmci.c | 2 | ||||
-rw-r--r-- | drivers/of/platform.c | 6 | ||||
-rw-r--r-- | drivers/sh/intc/balancing.c | 2 | ||||
-rw-r--r-- | drivers/sh/intc/core.c | 2 | ||||
-rw-r--r-- | drivers/sh/intc/handle.c | 2 | ||||
-rw-r--r-- | drivers/sh/intc/virq.c | 2 |
9 files changed, 89 insertions, 35 deletions
diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c index 54eaf96ab217..01c2cf4efcdd 100644 --- a/drivers/amba/bus.c +++ b/drivers/amba/bus.c | |||
@@ -497,37 +497,22 @@ static void amba_device_release(struct device *dev) | |||
497 | } | 497 | } |
498 | 498 | ||
499 | /** | 499 | /** |
500 | * amba_device_register - register an AMBA device | 500 | * amba_device_add - add a previously allocated AMBA device structure |
501 | * @dev: AMBA device to register | 501 | * @dev: AMBA device allocated by amba_device_alloc |
502 | * @parent: parent memory resource | 502 | * @parent: resource parent for this devices resources |
503 | * | 503 | * |
504 | * Setup the AMBA device, reading the cell ID if present. | 504 | * Claim the resource, and read the device cell ID if not already |
505 | * Claim the resource, and register the AMBA device with | 505 | * initialized. Register the AMBA device with the Linux device |
506 | * the Linux device manager. | 506 | * manager. |
507 | */ | 507 | */ |
508 | int amba_device_register(struct amba_device *dev, struct resource *parent) | 508 | int amba_device_add(struct amba_device *dev, struct resource *parent) |
509 | { | 509 | { |
510 | u32 size; | 510 | u32 size; |
511 | void __iomem *tmp; | 511 | void __iomem *tmp; |
512 | int i, ret; | 512 | int i, ret; |
513 | 513 | ||
514 | device_initialize(&dev->dev); | 514 | WARN_ON(dev->irq[0] == (unsigned int)-1); |
515 | 515 | WARN_ON(dev->irq[1] == (unsigned int)-1); | |
516 | /* | ||
517 | * Copy from device_add | ||
518 | */ | ||
519 | if (dev->dev.init_name) { | ||
520 | dev_set_name(&dev->dev, "%s", dev->dev.init_name); | ||
521 | dev->dev.init_name = NULL; | ||
522 | } | ||
523 | |||
524 | dev->dev.release = amba_device_release; | ||
525 | dev->dev.bus = &amba_bustype; | ||
526 | dev->dev.dma_mask = &dev->dma_mask; | ||
527 | dev->res.name = dev_name(&dev->dev); | ||
528 | |||
529 | if (!dev->dev.coherent_dma_mask && dev->dma_mask) | ||
530 | dev_warn(&dev->dev, "coherent dma mask is unset\n"); | ||
531 | 516 | ||
532 | ret = request_resource(parent, &dev->res); | 517 | ret = request_resource(parent, &dev->res); |
533 | if (ret) | 518 | if (ret) |
@@ -582,9 +567,9 @@ int amba_device_register(struct amba_device *dev, struct resource *parent) | |||
582 | if (ret) | 567 | if (ret) |
583 | goto err_release; | 568 | goto err_release; |
584 | 569 | ||
585 | if (dev->irq[0] != NO_IRQ) | 570 | if (dev->irq[0] && dev->irq[0] != NO_IRQ) |
586 | ret = device_create_file(&dev->dev, &dev_attr_irq0); | 571 | ret = device_create_file(&dev->dev, &dev_attr_irq0); |
587 | if (ret == 0 && dev->irq[1] != NO_IRQ) | 572 | if (ret == 0 && dev->irq[1] && dev->irq[1] != NO_IRQ) |
588 | ret = device_create_file(&dev->dev, &dev_attr_irq1); | 573 | ret = device_create_file(&dev->dev, &dev_attr_irq1); |
589 | if (ret == 0) | 574 | if (ret == 0) |
590 | return ret; | 575 | return ret; |
@@ -596,6 +581,74 @@ int amba_device_register(struct amba_device *dev, struct resource *parent) | |||
596 | err_out: | 581 | err_out: |
597 | return ret; | 582 | return ret; |
598 | } | 583 | } |
584 | EXPORT_SYMBOL_GPL(amba_device_add); | ||
585 | |||
586 | static void amba_device_initialize(struct amba_device *dev, const char *name) | ||
587 | { | ||
588 | device_initialize(&dev->dev); | ||
589 | if (name) | ||
590 | dev_set_name(&dev->dev, "%s", name); | ||
591 | dev->dev.release = amba_device_release; | ||
592 | dev->dev.bus = &amba_bustype; | ||
593 | dev->dev.dma_mask = &dev->dma_mask; | ||
594 | dev->res.name = dev_name(&dev->dev); | ||
595 | } | ||
596 | |||
597 | /** | ||
598 | * amba_device_alloc - allocate an AMBA device | ||
599 | * @name: sysfs name of the AMBA device | ||
600 | * @base: base of AMBA device | ||
601 | * @size: size of AMBA device | ||
602 | * | ||
603 | * Allocate and initialize an AMBA device structure. Returns %NULL | ||
604 | * on failure. | ||
605 | */ | ||
606 | struct amba_device *amba_device_alloc(const char *name, resource_size_t base, | ||
607 | size_t size) | ||
608 | { | ||
609 | struct amba_device *dev; | ||
610 | |||
611 | dev = kzalloc(sizeof(*dev), GFP_KERNEL); | ||
612 | if (dev) { | ||
613 | amba_device_initialize(dev, name); | ||
614 | dev->res.start = base; | ||
615 | dev->res.end = base + size - 1; | ||
616 | dev->res.flags = IORESOURCE_MEM; | ||
617 | } | ||
618 | |||
619 | return dev; | ||
620 | } | ||
621 | EXPORT_SYMBOL_GPL(amba_device_alloc); | ||
622 | |||
623 | /** | ||
624 | * amba_device_register - register an AMBA device | ||
625 | * @dev: AMBA device to register | ||
626 | * @parent: parent memory resource | ||
627 | * | ||
628 | * Setup the AMBA device, reading the cell ID if present. | ||
629 | * Claim the resource, and register the AMBA device with | ||
630 | * the Linux device manager. | ||
631 | */ | ||
632 | int amba_device_register(struct amba_device *dev, struct resource *parent) | ||
633 | { | ||
634 | amba_device_initialize(dev, dev->dev.init_name); | ||
635 | dev->dev.init_name = NULL; | ||
636 | |||
637 | if (!dev->dev.coherent_dma_mask && dev->dma_mask) | ||
638 | dev_warn(&dev->dev, "coherent dma mask is unset\n"); | ||
639 | |||
640 | return amba_device_add(dev, parent); | ||
641 | } | ||
642 | |||
643 | /** | ||
644 | * amba_device_put - put an AMBA device | ||
645 | * @dev: AMBA device to put | ||
646 | */ | ||
647 | void amba_device_put(struct amba_device *dev) | ||
648 | { | ||
649 | put_device(&dev->dev); | ||
650 | } | ||
651 | EXPORT_SYMBOL_GPL(amba_device_put); | ||
599 | 652 | ||
600 | /** | 653 | /** |
601 | * amba_device_unregister - unregister an AMBA device | 654 | * amba_device_unregister - unregister an AMBA device |
diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig index 999d6a03e436..5138927a416c 100644 --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig | |||
@@ -26,7 +26,6 @@ config CLKSRC_DBX500_PRCMU | |||
26 | config CLKSRC_DBX500_PRCMU_SCHED_CLOCK | 26 | config CLKSRC_DBX500_PRCMU_SCHED_CLOCK |
27 | bool "Clocksource PRCMU Timer sched_clock" | 27 | bool "Clocksource PRCMU Timer sched_clock" |
28 | depends on (CLKSRC_DBX500_PRCMU && !NOMADIK_MTU_SCHED_CLOCK) | 28 | depends on (CLKSRC_DBX500_PRCMU && !NOMADIK_MTU_SCHED_CLOCK) |
29 | select HAVE_SCHED_CLOCK | ||
30 | default y | 29 | default y |
31 | help | 30 | help |
32 | Use the always on PRCMU Timer as sched_clock | 31 | Use the always on PRCMU Timer as sched_clock |
diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c index b2d3ee1d183a..5689ce62fd81 100644 --- a/drivers/gpio/gpio-pxa.c +++ b/drivers/gpio/gpio-pxa.c | |||
@@ -22,6 +22,8 @@ | |||
22 | #include <linux/syscore_ops.h> | 22 | #include <linux/syscore_ops.h> |
23 | #include <linux/slab.h> | 23 | #include <linux/slab.h> |
24 | 24 | ||
25 | #include <mach/irqs.h> | ||
26 | |||
25 | /* | 27 | /* |
26 | * We handle the GPIOs by banks, each bank covers up to 32 GPIOs with | 28 | * We handle the GPIOs by banks, each bank covers up to 32 GPIOs with |
27 | * one set of registers. The register offsets are organized below: | 29 | * one set of registers. The register offsets are organized below: |
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 0d955ffaf44e..304f2f98b680 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c | |||
@@ -1325,7 +1325,7 @@ static int __devinit mmci_probe(struct amba_device *dev, | |||
1325 | if (ret) | 1325 | if (ret) |
1326 | goto unmap; | 1326 | goto unmap; |
1327 | 1327 | ||
1328 | if (dev->irq[1] == NO_IRQ) | 1328 | if (dev->irq[1] == NO_IRQ || !dev->irq[1]) |
1329 | host->singleirq = true; | 1329 | host->singleirq = true; |
1330 | else { | 1330 | else { |
1331 | ret = request_irq(dev->irq[1], mmci_pio_irq, IRQF_SHARED, | 1331 | ret = request_irq(dev->irq[1], mmci_pio_irq, IRQF_SHARED, |
diff --git a/drivers/of/platform.c b/drivers/of/platform.c index 63b3ec48c203..cae9477a6ed3 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c | |||
@@ -253,7 +253,7 @@ static struct amba_device *of_amba_device_create(struct device_node *node, | |||
253 | if (!of_device_is_available(node)) | 253 | if (!of_device_is_available(node)) |
254 | return NULL; | 254 | return NULL; |
255 | 255 | ||
256 | dev = kzalloc(sizeof(*dev), GFP_KERNEL); | 256 | dev = amba_device_alloc(NULL, 0, 0); |
257 | if (!dev) | 257 | if (!dev) |
258 | return NULL; | 258 | return NULL; |
259 | 259 | ||
@@ -283,14 +283,14 @@ static struct amba_device *of_amba_device_create(struct device_node *node, | |||
283 | if (ret) | 283 | if (ret) |
284 | goto err_free; | 284 | goto err_free; |
285 | 285 | ||
286 | ret = amba_device_register(dev, &iomem_resource); | 286 | ret = amba_device_add(dev, &iomem_resource); |
287 | if (ret) | 287 | if (ret) |
288 | goto err_free; | 288 | goto err_free; |
289 | 289 | ||
290 | return dev; | 290 | return dev; |
291 | 291 | ||
292 | err_free: | 292 | err_free: |
293 | kfree(dev); | 293 | amba_device_put(dev); |
294 | return NULL; | 294 | return NULL; |
295 | } | 295 | } |
296 | #else /* CONFIG_ARM_AMBA */ | 296 | #else /* CONFIG_ARM_AMBA */ |
diff --git a/drivers/sh/intc/balancing.c b/drivers/sh/intc/balancing.c index cec7a96f2c09..bc780807ccb0 100644 --- a/drivers/sh/intc/balancing.c +++ b/drivers/sh/intc/balancing.c | |||
@@ -9,7 +9,7 @@ | |||
9 | */ | 9 | */ |
10 | #include "internals.h" | 10 | #include "internals.h" |
11 | 11 | ||
12 | static unsigned long dist_handle[NR_IRQS]; | 12 | static unsigned long dist_handle[INTC_NR_IRQS]; |
13 | 13 | ||
14 | void intc_balancing_enable(unsigned int irq) | 14 | void intc_balancing_enable(unsigned int irq) |
15 | { | 15 | { |
diff --git a/drivers/sh/intc/core.c b/drivers/sh/intc/core.c index e53e449b4eca..2fde8970dfd0 100644 --- a/drivers/sh/intc/core.c +++ b/drivers/sh/intc/core.c | |||
@@ -42,7 +42,7 @@ unsigned int nr_intc_controllers; | |||
42 | * - this needs to be at least 2 for 5-bit priorities on 7780 | 42 | * - this needs to be at least 2 for 5-bit priorities on 7780 |
43 | */ | 43 | */ |
44 | static unsigned int default_prio_level = 2; /* 2 - 16 */ | 44 | static unsigned int default_prio_level = 2; /* 2 - 16 */ |
45 | static unsigned int intc_prio_level[NR_IRQS]; /* for now */ | 45 | static unsigned int intc_prio_level[INTC_NR_IRQS]; /* for now */ |
46 | 46 | ||
47 | unsigned int intc_get_dfl_prio_level(void) | 47 | unsigned int intc_get_dfl_prio_level(void) |
48 | { | 48 | { |
diff --git a/drivers/sh/intc/handle.c b/drivers/sh/intc/handle.c index 057ce56829bf..f461d5300b81 100644 --- a/drivers/sh/intc/handle.c +++ b/drivers/sh/intc/handle.c | |||
@@ -13,7 +13,7 @@ | |||
13 | #include <linux/spinlock.h> | 13 | #include <linux/spinlock.h> |
14 | #include "internals.h" | 14 | #include "internals.h" |
15 | 15 | ||
16 | static unsigned long ack_handle[NR_IRQS]; | 16 | static unsigned long ack_handle[INTC_NR_IRQS]; |
17 | 17 | ||
18 | static intc_enum __init intc_grp_id(struct intc_desc *desc, | 18 | static intc_enum __init intc_grp_id(struct intc_desc *desc, |
19 | intc_enum enum_id) | 19 | intc_enum enum_id) |
diff --git a/drivers/sh/intc/virq.c b/drivers/sh/intc/virq.c index c7ec49ffd9f6..93cec21e788b 100644 --- a/drivers/sh/intc/virq.c +++ b/drivers/sh/intc/virq.c | |||
@@ -17,7 +17,7 @@ | |||
17 | #include <linux/export.h> | 17 | #include <linux/export.h> |
18 | #include "internals.h" | 18 | #include "internals.h" |
19 | 19 | ||
20 | static struct intc_map_entry intc_irq_xlate[NR_IRQS]; | 20 | static struct intc_map_entry intc_irq_xlate[INTC_NR_IRQS]; |
21 | 21 | ||
22 | struct intc_virq_list { | 22 | struct intc_virq_list { |
23 | unsigned int irq; | 23 | unsigned int irq; |