diff options
author | Daniel Mack <zonque@gmail.com> | 2012-08-01 01:08:47 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-08-22 01:29:50 -0400 |
commit | a78769b80d73468d53d0ad70c5a9e3fd9ff9dc54 (patch) | |
tree | 1b1e90df01fecc0294c3015a2315bbcd73e2f253 /drivers/input/misc | |
parent | a2f25245269d754a9fd687a15db975271a58c5e0 (diff) |
Input: rotary-encoder - defer calls gpio_to_irq()
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>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/misc')
-rw-r--r-- | drivers/input/misc/rotary_encoder.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/input/misc/rotary_encoder.c b/drivers/input/misc/rotary_encoder.c index f07f784198b9..00a7bdabb0b3 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) | |||
163 | 163 | ||
164 | encoder->input = input; | 164 | encoder->input = input; |
165 | encoder->pdata = pdata; | 165 | encoder->pdata = pdata; |
166 | encoder->irq_a = gpio_to_irq(pdata->gpio_a); | ||
167 | encoder->irq_b = gpio_to_irq(pdata->gpio_b); | ||
168 | 166 | ||
169 | /* create and register the input driver */ | 167 | /* create and register the input driver */ |
170 | input->name = pdev->name; | 168 | input->name = pdev->name; |
@@ -215,6 +213,9 @@ static int __devinit rotary_encoder_probe(struct platform_device *pdev) | |||
215 | goto exit_free_gpio_a; | 213 | goto exit_free_gpio_a; |
216 | } | 214 | } |
217 | 215 | ||
216 | encoder->irq_a = gpio_to_irq(pdata->gpio_a); | ||
217 | encoder->irq_b = gpio_to_irq(pdata->gpio_b); | ||
218 | |||
218 | /* request the IRQs */ | 219 | /* request the IRQs */ |
219 | if (pdata->half_period) { | 220 | if (pdata->half_period) { |
220 | handler = &rotary_encoder_half_period_irq; | 221 | handler = &rotary_encoder_half_period_irq; |