diff options
author | Darius Augulis <augulis.darius@gmail.com> | 2009-04-08 16:17:50 +0300 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2009-04-16 13:03:11 +0200 |
commit | 3f2030163efe4a7ee820ae56dab9a4db8c1ebb49 (patch) | |
tree | cff93721de6e9f5ae9abe58a2dd3fc1651669ecc | |
parent | 3fa6dd6a7aa7ce1a7d490ef88c2c8ec7db0f196b (diff) | |
download | blackbird-op-linux-3f2030163efe4a7ee820ae56dab9a4db8c1ebb49.tar.gz blackbird-op-linux-3f2030163efe4a7ee820ae56dab9a4db8c1ebb49.zip |
Fix ifdef in plat-mxc/irc.c
Move ifdef under function brackets. This fixes compile crach when IRQ priorities
are disabled.
Signed-off-by: Darius Augulis <augulis.darius@gmail.com>
-rw-r--r-- | arch/arm/plat-mxc/include/mach/irqs.h | 2 | ||||
-rw-r--r-- | arch/arm/plat-mxc/irq.c | 14 |
2 files changed, 10 insertions, 6 deletions
diff --git a/arch/arm/plat-mxc/include/mach/irqs.h b/arch/arm/plat-mxc/include/mach/irqs.h index c02b8fc2d821..518a36504b88 100644 --- a/arch/arm/plat-mxc/include/mach/irqs.h +++ b/arch/arm/plat-mxc/include/mach/irqs.h @@ -45,7 +45,7 @@ #define NR_IRQS (MXC_IPU_IRQ_START + MX3_IPU_IRQS) -extern void imx_irq_set_priority(unsigned char irq, unsigned char prio); +extern int imx_irq_set_priority(unsigned char irq, unsigned char prio); /* all normal IRQs can be FIQs */ #define FIQ_START 0 diff --git a/arch/arm/plat-mxc/irq.c b/arch/arm/plat-mxc/irq.c index 6e7578a3514b..0fb68a531f55 100644 --- a/arch/arm/plat-mxc/irq.c +++ b/arch/arm/plat-mxc/irq.c @@ -50,23 +50,27 @@ #define IIM_PROD_REV_SH 3 #define IIM_PROD_REV_LEN 5 -#ifdef CONFIG_MXC_IRQ_PRIOR -void imx_irq_set_priority(unsigned char irq, unsigned char prio) +int imx_irq_set_priority(unsigned char irq, unsigned char prio) { +#ifdef CONFIG_MXC_IRQ_PRIOR unsigned int temp; unsigned int mask = 0x0F << irq % 8 * 4; - if (irq > 63) - return; + if (irq >= MXC_INTERNAL_IRQS) + return -EINVAL;; temp = __raw_readl(AVIC_NIPRIORITY(irq / 8)); temp &= ~mask; temp |= prio & mask; __raw_writel(temp, AVIC_NIPRIORITY(irq / 8)); + + return 0; +#else + return -ENOSYS; +#endif } EXPORT_SYMBOL(imx_irq_set_priority); -#endif #ifdef CONFIG_FIQ int mxc_set_irq_fiq(unsigned int irq, unsigned int type) |