mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-11 16:24:26 +08:00
Input: palmas-pwrbutton - handle return value of platform_get_irq()
platform_get_irq() can fail here and we must check its return value. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
This commit is contained in:
parent
d5f9c43d41
commit
daf87bffd0
@ -210,6 +210,11 @@ static int palmas_pwron_probe(struct platform_device *pdev)
|
||||
INIT_DELAYED_WORK(&pwron->input_work, palmas_power_button_work);
|
||||
|
||||
pwron->irq = platform_get_irq(pdev, 0);
|
||||
if (pwron->irq < 0) {
|
||||
error = pwron->irq;
|
||||
goto err_free_input;
|
||||
}
|
||||
|
||||
error = request_threaded_irq(pwron->irq, NULL, pwron_irq,
|
||||
IRQF_TRIGGER_HIGH |
|
||||
IRQF_TRIGGER_LOW |
|
||||
|
Loading…
Reference in New Issue
Block a user