All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Mack <zonque@gmail.com>
To: linux-input@vger.kernel.org
Cc: dmitry.torokhov@gmail.com, jhovold@gmail.com,
	hartleys@visionengravers.com, Daniel Mack <zonque@gmail.com>
Subject: [PATCH v3 1/3] input: rotary-encoder: defer calls gpio_to_irq()
Date: Wed, 25 Jul 2012 20:25:12 +0200	[thread overview]
Message-ID: <1343240714-11399-1-git-send-email-zonque@gmail.com> (raw)

Don't call gpio_to_irq() on GPIOs before gpio_request() succeeded on
them. This avoids Ooopses with incorrect DT bindings.

Signed-off-by: Daniel Mack <zonque@gmail.com>
---
 drivers/input/misc/rotary_encoder.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/input/misc/rotary_encoder.c b/drivers/input/misc/rotary_encoder.c
index f07f784..00a7bda 100644
--- a/drivers/input/misc/rotary_encoder.c
+++ b/drivers/input/misc/rotary_encoder.c
@@ -163,8 +163,6 @@ static int __devinit rotary_encoder_probe(struct platform_device *pdev)
 
 	encoder->input = input;
 	encoder->pdata = pdata;
-	encoder->irq_a = gpio_to_irq(pdata->gpio_a);
-	encoder->irq_b = gpio_to_irq(pdata->gpio_b);
 
 	/* create and register the input driver */
 	input->name = pdev->name;
@@ -215,6 +213,9 @@ static int __devinit rotary_encoder_probe(struct platform_device *pdev)
 		goto exit_free_gpio_a;
 	}
 
+	encoder->irq_a = gpio_to_irq(pdata->gpio_a);
+	encoder->irq_b = gpio_to_irq(pdata->gpio_b);
+
 	/* request the IRQs */
 	if (pdata->half_period) {
 		handler = &rotary_encoder_half_period_irq;
-- 
1.7.10.4


             reply	other threads:[~2012-07-25 18:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-25 18:25 Daniel Mack [this message]
2012-07-25 18:25 ` [PATCH v3 2/3] input: rotary-encoder: use gpio_request_one() Daniel Mack
2012-07-25 18:25 ` [PATCH v3 3/3] input: rotary-encoder: add DT bindings Daniel Mack
2012-07-31  6:12   ` Dmitry Torokhov
2012-07-31 13:56     ` Daniel Mack
2012-08-03  4:59       ` Daniel Mack
2012-08-21  7:58       ` Daniel Mack
2012-07-30  9:39 ` [PATCH v3 1/3] input: rotary-encoder: defer calls gpio_to_irq() Daniel Mack

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=1343240714-11399-1-git-send-email-zonque@gmail.com \
    --to=zonque@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=hartleys@visionengravers.com \
    --cc=jhovold@gmail.com \
    --cc=linux-input@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.