From: Philipp Rosenberger <p.rosenberger@linutronix.de>
To: linus.walleij@linaro.org, gnurou@gmail.com,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: tglx@linutronix.de, Philipp Rosenberger <p.rosenberger@linutronix.de>
Subject: [PATCH 2/2] gpio: gpio-mxc: gpio_set_wake_irq() use proper return values
Date: Wed, 12 Jul 2017 10:36:40 +0200 [thread overview]
Message-ID: <1499848600-7233-3-git-send-email-p.rosenberger@linutronix.de> (raw)
In-Reply-To: <1499848600-7233-1-git-send-email-p.rosenberger@linutronix.de>
Errors from enable_irq_wake() in gpio_set_wake_irq() were silently ignored.
Thus led to the problem that gpio_set_wake_irq() always returned
successfully, even if enable_irq_wake() returned an error.
Signed-off-by: Philipp Rosenberger <p.rosenberger@linutronix.de>
---
drivers/gpio/gpio-mxc.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c
index 9269225..3dcd990 100644
--- a/drivers/gpio/gpio-mxc.c
+++ b/drivers/gpio/gpio-mxc.c
@@ -324,20 +324,21 @@ static int gpio_set_wake_irq(struct irq_data *d, u32 enable)
struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
struct mxc_gpio_port *port = gc->private;
u32 gpio_idx = d->hwirq;
+ int ret;
if (enable) {
if (port->irq_high && (gpio_idx >= 16))
- enable_irq_wake(port->irq_high);
+ ret = enable_irq_wake(port->irq_high);
else
- enable_irq_wake(port->irq);
+ ret = enable_irq_wake(port->irq);
} else {
if (port->irq_high && (gpio_idx >= 16))
- disable_irq_wake(port->irq_high);
+ ret = disable_irq_wake(port->irq_high);
else
- disable_irq_wake(port->irq);
+ ret = disable_irq_wake(port->irq);
}
- return 0;
+ return ret;
}
static int mxc_gpio_init_gc(struct mxc_gpio_port *port, int irq_base)
--
2.1.4
next prev parent reply other threads:[~2017-07-12 8:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-12 8:36 [PATCH 0/2] gpio-mxc: Fix issue with gpios used as wake source on iMX27 Philipp Rosenberger
2017-07-12 8:36 ` [PATCH 1/2] gpio: gpio-mxc: Fix: higher 16 GPIOs usable as wake source Philipp Rosenberger
2017-08-01 8:37 ` Linus Walleij
2017-07-12 8:36 ` Philipp Rosenberger [this message]
2017-08-01 8:39 ` [PATCH 2/2] gpio: gpio-mxc: gpio_set_wake_irq() use proper return values Linus Walleij
2017-07-27 20:17 ` [PATCH 0/2] gpio-mxc: Fix issue with gpios used as wake source on iMX27 Thomas Gleixner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1499848600-7233-3-git-send-email-p.rosenberger@linutronix.de \
--to=p.rosenberger@linutronix.de \
--cc=gnurou@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).