* [PATCH v2] genirq: devres: Fix testing return value of request_any_context_irq()
@ 2015-05-11 9:02 Axel Lin
2015-05-11 18:06 ` Stephen Boyd
2015-05-13 8:48 ` [tip:irq/core] " tip-bot for Axel Lin
0 siblings, 2 replies; 3+ messages in thread
From: Axel Lin @ 2015-05-11 9:02 UTC (permalink / raw)
To: Thomas Gleixner; +Cc: Stephen Boyd, linux-kernel@vger.kernel.org
request_any_context_irq() returns a negative value on failure.
It returns either IRQC_IS_HARDIRQ or IRQC_IS_NESTED on success.
So fix testing return value of request_any_context_irq().
Also fixup the return value of devm_request_any_context_irq() to make it
consistent with request_any_context_irq().
Fixes: 0668d3065128 ("genirq: Add devm_request_any_context_irq()")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
v2: Also fixup return value of devm_request_any_context_irq
kernel/irq/devres.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/irq/devres.c b/kernel/irq/devres.c
index d5d0f73..74d90a7 100644
--- a/kernel/irq/devres.c
+++ b/kernel/irq/devres.c
@@ -104,7 +104,7 @@ int devm_request_any_context_irq(struct device *dev, unsigned int irq,
return -ENOMEM;
rc = request_any_context_irq(irq, handler, irqflags, devname, dev_id);
- if (rc) {
+ if (rc < 0) {
devres_free(dr);
return rc;
}
@@ -113,7 +113,7 @@ int devm_request_any_context_irq(struct device *dev, unsigned int irq,
dr->dev_id = dev_id;
devres_add(dev, dr);
- return 0;
+ return rc;
}
EXPORT_SYMBOL(devm_request_any_context_irq);
--
2.1.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] genirq: devres: Fix testing return value of request_any_context_irq()
2015-05-11 9:02 [PATCH v2] genirq: devres: Fix testing return value of request_any_context_irq() Axel Lin
@ 2015-05-11 18:06 ` Stephen Boyd
2015-05-13 8:48 ` [tip:irq/core] " tip-bot for Axel Lin
1 sibling, 0 replies; 3+ messages in thread
From: Stephen Boyd @ 2015-05-11 18:06 UTC (permalink / raw)
To: Axel Lin, Thomas Gleixner; +Cc: linux-kernel@vger.kernel.org
On 05/11/15 02:02, Axel Lin wrote:
> request_any_context_irq() returns a negative value on failure.
> It returns either IRQC_IS_HARDIRQ or IRQC_IS_NESTED on success.
> So fix testing return value of request_any_context_irq().
>
> Also fixup the return value of devm_request_any_context_irq() to make it
> consistent with request_any_context_irq().
>
> Fixes: 0668d3065128 ("genirq: Add devm_request_any_context_irq()")
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply [flat|nested] 3+ messages in thread
* [tip:irq/core] genirq: devres: Fix testing return value of request_any_context_irq()
2015-05-11 9:02 [PATCH v2] genirq: devres: Fix testing return value of request_any_context_irq() Axel Lin
2015-05-11 18:06 ` Stephen Boyd
@ 2015-05-13 8:48 ` tip-bot for Axel Lin
1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Axel Lin @ 2015-05-13 8:48 UTC (permalink / raw)
To: linux-tip-commits; +Cc: hpa, linux-kernel, mingo, tglx, axel.lin, sboyd
Commit-ID: 63781394c540dd9e666a6b21d70b64dd52bce76e
Gitweb: http://git.kernel.org/tip/63781394c540dd9e666a6b21d70b64dd52bce76e
Author: Axel Lin <axel.lin@ingics.com>
AuthorDate: Mon, 11 May 2015 17:02:58 +0800
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Wed, 13 May 2015 10:47:37 +0200
genirq: devres: Fix testing return value of request_any_context_irq()
request_any_context_irq() returns a negative value on failure.
It returns either IRQC_IS_HARDIRQ or IRQC_IS_NESTED on success.
So fix testing return value of request_any_context_irq().
Also fixup the return value of devm_request_any_context_irq() to make it
consistent with request_any_context_irq().
Fixes: 0668d3065128 ("genirq: Add devm_request_any_context_irq()")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Cc: stable@vger.kernel.org
Link: http://lkml.kernel.org/r/1431334978.17783.4.camel@ingics.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
kernel/irq/devres.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/irq/devres.c b/kernel/irq/devres.c
index d5d0f73..74d90a7 100644
--- a/kernel/irq/devres.c
+++ b/kernel/irq/devres.c
@@ -104,7 +104,7 @@ int devm_request_any_context_irq(struct device *dev, unsigned int irq,
return -ENOMEM;
rc = request_any_context_irq(irq, handler, irqflags, devname, dev_id);
- if (rc) {
+ if (rc < 0) {
devres_free(dr);
return rc;
}
@@ -113,7 +113,7 @@ int devm_request_any_context_irq(struct device *dev, unsigned int irq,
dr->dev_id = dev_id;
devres_add(dev, dr);
- return 0;
+ return rc;
}
EXPORT_SYMBOL(devm_request_any_context_irq);
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-05-13 8:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-11 9:02 [PATCH v2] genirq: devres: Fix testing return value of request_any_context_irq() Axel Lin
2015-05-11 18:06 ` Stephen Boyd
2015-05-13 8:48 ` [tip:irq/core] " tip-bot for Axel Lin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox