提交 a78769b8 编写于 作者: D Daniel Mack 提交者: Dmitry Torokhov

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: NDaniel Mack <zonque@gmail.com>
Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
上级 a2f25245
...@@ -163,8 +163,6 @@ static int __devinit rotary_encoder_probe(struct platform_device *pdev) ...@@ -163,8 +163,6 @@ static int __devinit rotary_encoder_probe(struct platform_device *pdev)
encoder->input = input; encoder->input = input;
encoder->pdata = pdata; 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 */ /* create and register the input driver */
input->name = pdev->name; input->name = pdev->name;
...@@ -215,6 +213,9 @@ static int __devinit rotary_encoder_probe(struct platform_device *pdev) ...@@ -215,6 +213,9 @@ static int __devinit rotary_encoder_probe(struct platform_device *pdev)
goto exit_free_gpio_a; 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 */ /* request the IRQs */
if (pdata->half_period) { if (pdata->half_period) {
handler = &rotary_encoder_half_period_irq; handler = &rotary_encoder_half_period_irq;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册