Skip to content

Commit

Permalink
arm/imx: fix return type of callback passed to of_irq_init()
Browse files Browse the repository at this point in the history
The of_irq_init() expects the callback passed by .data of of_device_id
return 'int' instead of 'void'.  This patch fixes it to have
irq_init_cb() return the correct value, and in turn have the secondary
interrupt controller (gpio in this case) initialized properly and also
eliminate the error message 'of_irq_init: children remain, but no
parents' which was overlooked before.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
  • Loading branch information
Shawn Guo committed Dec 1, 2011
1 parent caca6a0 commit 2a3267a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
4 changes: 3 additions & 1 deletion arch/arm/mach-imx/mach-imx6q.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,16 @@ static void __init imx6q_map_io(void)
imx_scu_map_io();
}

static void __init imx6q_gpio_add_irq_domain(struct device_node *np,
static int __init imx6q_gpio_add_irq_domain(struct device_node *np,
struct device_node *interrupt_parent)
{
static int gpio_irq_base = MXC_GPIO_IRQ_START + ARCH_NR_GPIOS -
32 * 7; /* imx6q gets 7 gpio ports */

irq_domain_add_simple(np, gpio_irq_base);
gpio_irq_base += 32;

return 0;
}

static const struct of_device_id imx6q_irq_match[] __initconst = {
Expand Down
7 changes: 5 additions & 2 deletions arch/arm/mach-mx5/imx51-dt.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,23 @@ static const struct of_dev_auxdata imx51_auxdata_lookup[] __initconst = {
{ /* sentinel */ }
};

static void __init imx51_tzic_add_irq_domain(struct device_node *np,
static int __init imx51_tzic_add_irq_domain(struct device_node *np,
struct device_node *interrupt_parent)
{
irq_domain_add_simple(np, 0);
return 0;
}

static void __init imx51_gpio_add_irq_domain(struct device_node *np,
static int __init imx51_gpio_add_irq_domain(struct device_node *np,
struct device_node *interrupt_parent)
{
static int gpio_irq_base = MXC_GPIO_IRQ_START + ARCH_NR_GPIOS -
32 * 4; /* imx51 gets 4 gpio ports */

irq_domain_add_simple(np, gpio_irq_base);
gpio_irq_base += 32;

return 0;
}

static const struct of_device_id imx51_irq_match[] __initconst = {
Expand Down
7 changes: 5 additions & 2 deletions arch/arm/mach-mx5/imx53-dt.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,23 @@ static const struct of_dev_auxdata imx53_auxdata_lookup[] __initconst = {
{ /* sentinel */ }
};

static void __init imx53_tzic_add_irq_domain(struct device_node *np,
static int __init imx53_tzic_add_irq_domain(struct device_node *np,
struct device_node *interrupt_parent)
{
irq_domain_add_simple(np, 0);
return 0;
}

static void __init imx53_gpio_add_irq_domain(struct device_node *np,
static int __init imx53_gpio_add_irq_domain(struct device_node *np,
struct device_node *interrupt_parent)
{
static int gpio_irq_base = MXC_GPIO_IRQ_START + ARCH_NR_GPIOS -
32 * 7; /* imx53 gets 7 gpio ports */

irq_domain_add_simple(np, gpio_irq_base);
gpio_irq_base += 32;

return 0;
}

static const struct of_device_id imx53_irq_match[] __initconst = {
Expand Down

0 comments on commit 2a3267a

Please sign in to comment.