diff mbox

irqchip: Return -EPERM for reserved IRQs

Message ID 1370696686-1666-1-git-send-email-grant.likely@linaro.org (mailing list archive)
State New, archived
Headers show

Commit Message

Grant Likely June 8, 2013, 1:04 p.m. UTC
The irqdomain core will report a log message for any attempted map call
that fails unless the error code is -EPERM. This patch changes the
Versatile irq controller drivers to use -EPERM because it is normal for
a subset of the IRQ inputs to be marked as reserved on the various
Versatile platforms.

Signed-off-by: Grant Likely <grant.likely@linaro.org>
Cc: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/irqchip/irq-versatile-fpga.c | 2 +-
 drivers/irqchip/irq-vic.c            | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Grant Likely June 8, 2013, 8:18 p.m. UTC | #1
On Sat, Jun 8, 2013 at 2:04 PM, Grant Likely <grant.likely@linaro.org> wrote:
> The irqdomain core will report a log message for any attempted map call
> that fails unless the error code is -EPERM. This patch changes the
> Versatile irq controller drivers to use -EPERM because it is normal for
> a subset of the IRQ inputs to be marked as reserved on the various
> Versatile platforms.
>
> Signed-off-by: Grant Likely <grant.likely@linaro.org>
> Cc: Linus Walleij <linus.walleij@linaro.org>

I'm going to go ahead and take this one through the irqdomain tree
since it is really an irqdomain bug fix. I'll be sending the pull
request to Linus shortly.

g.

> ---
>  drivers/irqchip/irq-versatile-fpga.c | 2 +-
>  drivers/irqchip/irq-vic.c            | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/irqchip/irq-versatile-fpga.c b/drivers/irqchip/irq-versatile-fpga.c
> index 065b7a3..47a52ab 100644
> --- a/drivers/irqchip/irq-versatile-fpga.c
> +++ b/drivers/irqchip/irq-versatile-fpga.c
> @@ -119,7 +119,7 @@ static int fpga_irqdomain_map(struct irq_domain *d, unsigned int irq,
>
>         /* Skip invalid IRQs, only register handlers for the real ones */
>         if (!(f->valid & BIT(hwirq)))
> -               return -ENOTSUPP;
> +               return -EPERM;
>         irq_set_chip_data(irq, f);
>         irq_set_chip_and_handler(irq, &f->chip,
>                                 handle_level_irq);
> diff --git a/drivers/irqchip/irq-vic.c b/drivers/irqchip/irq-vic.c
> index 884d11c..2bbb004 100644
> --- a/drivers/irqchip/irq-vic.c
> +++ b/drivers/irqchip/irq-vic.c
> @@ -197,7 +197,7 @@ static int vic_irqdomain_map(struct irq_domain *d, unsigned int irq,
>
>         /* Skip invalid IRQs, only register handlers for the real ones */
>         if (!(v->valid_sources & (1 << hwirq)))
> -               return -ENOTSUPP;
> +               return -EPERM;
>         irq_set_chip_and_handler(irq, &vic_chip, handle_level_irq);
>         irq_set_chip_data(irq, v->base);
>         set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
> --
> 1.8.1.2
>
Linus Walleij June 10, 2013, 7:45 a.m. UTC | #2
On Sat, Jun 8, 2013 at 3:04 PM, Grant Likely <grant.likely@linaro.org> wrote:

> The irqdomain core will report a log message for any attempted map call
> that fails unless the error code is -EPERM. This patch changes the
> Versatile irq controller drivers to use -EPERM because it is normal for
> a subset of the IRQ inputs to be marked as reserved on the various
> Versatile platforms.
>
> Signed-off-by: Grant Likely <grant.likely@linaro.org>
> Cc: Linus Walleij <linus.walleij@linaro.org>

Looks good:
Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij
diff mbox

Patch

diff --git a/drivers/irqchip/irq-versatile-fpga.c b/drivers/irqchip/irq-versatile-fpga.c
index 065b7a3..47a52ab 100644
--- a/drivers/irqchip/irq-versatile-fpga.c
+++ b/drivers/irqchip/irq-versatile-fpga.c
@@ -119,7 +119,7 @@  static int fpga_irqdomain_map(struct irq_domain *d, unsigned int irq,
 
 	/* Skip invalid IRQs, only register handlers for the real ones */
 	if (!(f->valid & BIT(hwirq)))
-		return -ENOTSUPP;
+		return -EPERM;
 	irq_set_chip_data(irq, f);
 	irq_set_chip_and_handler(irq, &f->chip,
 				handle_level_irq);
diff --git a/drivers/irqchip/irq-vic.c b/drivers/irqchip/irq-vic.c
index 884d11c..2bbb004 100644
--- a/drivers/irqchip/irq-vic.c
+++ b/drivers/irqchip/irq-vic.c
@@ -197,7 +197,7 @@  static int vic_irqdomain_map(struct irq_domain *d, unsigned int irq,
 
 	/* Skip invalid IRQs, only register handlers for the real ones */
 	if (!(v->valid_sources & (1 << hwirq)))
-		return -ENOTSUPP;
+		return -EPERM;
 	irq_set_chip_and_handler(irq, &vic_chip, handle_level_irq);
 	irq_set_chip_data(irq, v->base);
 	set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);