mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 15:18:19 +00:00
Input: sun4i-ps2 - fix handling of platform_get_irq() error
platform_get_irq() returns -ERRNO on error. In such case comparison
to 0 would pass the check.
Fixes: e443631d20
("Input: serio - add support for Alwinner A10/A20 PS/2 controller")
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Link: https://lore.kernel.org/r/20200828145744.3636-4-krzk@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
This commit is contained in:
parent
c277e1f0dc
commit
cafb3abea6
1 changed files with 3 additions and 6 deletions
|
@ -211,7 +211,6 @@ static int sun4i_ps2_probe(struct platform_device *pdev)
|
|||
struct sun4i_ps2data *drvdata;
|
||||
struct serio *serio;
|
||||
struct device *dev = &pdev->dev;
|
||||
unsigned int irq;
|
||||
int error;
|
||||
|
||||
drvdata = kzalloc(sizeof(struct sun4i_ps2data), GFP_KERNEL);
|
||||
|
@ -264,14 +263,12 @@ static int sun4i_ps2_probe(struct platform_device *pdev)
|
|||
writel(0, drvdata->reg_base + PS2_REG_GCTL);
|
||||
|
||||
/* Get IRQ for the device */
|
||||
irq = platform_get_irq(pdev, 0);
|
||||
if (!irq) {
|
||||
dev_err(dev, "no IRQ found\n");
|
||||
error = -ENXIO;
|
||||
drvdata->irq = platform_get_irq(pdev, 0);
|
||||
if (drvdata->irq < 0) {
|
||||
error = drvdata->irq;
|
||||
goto err_disable_clk;
|
||||
}
|
||||
|
||||
drvdata->irq = irq;
|
||||
drvdata->serio = serio;
|
||||
drvdata->dev = dev;
|
||||
|
||||
|
|
Loading…
Reference in a new issue