diff options
-rw-r--r-- | drivers/input/serio/altera_ps2.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/input/serio/altera_ps2.c b/drivers/input/serio/altera_ps2.c index 457da76d4c83..320b7ca48bf8 100644 --- a/drivers/input/serio/altera_ps2.c +++ b/drivers/input/serio/altera_ps2.c | |||
@@ -83,7 +83,7 @@ static int __devinit altera_ps2_probe(struct platform_device *pdev) | |||
83 | { | 83 | { |
84 | struct ps2if *ps2if; | 84 | struct ps2if *ps2if; |
85 | struct serio *serio; | 85 | struct serio *serio; |
86 | int error; | 86 | int error, irq; |
87 | 87 | ||
88 | ps2if = kzalloc(sizeof(struct ps2if), GFP_KERNEL); | 88 | ps2if = kzalloc(sizeof(struct ps2if), GFP_KERNEL); |
89 | serio = kzalloc(sizeof(struct serio), GFP_KERNEL); | 89 | serio = kzalloc(sizeof(struct serio), GFP_KERNEL); |
@@ -108,11 +108,13 @@ static int __devinit altera_ps2_probe(struct platform_device *pdev) | |||
108 | goto err_free_mem; | 108 | goto err_free_mem; |
109 | } | 109 | } |
110 | 110 | ||
111 | ps2if->irq = platform_get_irq(pdev, 0); | 111 | |
112 | if (ps2if->irq < 0) { | 112 | irq = platform_get_irq(pdev, 0); |
113 | if (irq < 0) { | ||
113 | error = -ENXIO; | 114 | error = -ENXIO; |
114 | goto err_free_mem; | 115 | goto err_free_mem; |
115 | } | 116 | } |
117 | ps2if->irq = irq; | ||
116 | 118 | ||
117 | if (!request_mem_region(ps2if->iomem_res->start, | 119 | if (!request_mem_region(ps2if->iomem_res->start, |
118 | resource_size(ps2if->iomem_res), pdev->name)) { | 120 | resource_size(ps2if->iomem_res), pdev->name)) { |