@@ -71,16 +71,12 @@ static int max8925_onkey_probe(struct platform_device *pdev)
int irq[2], error;
irq[0] = platform_get_irq(pdev, 0);
- if (irq[0] < 0) {
- dev_err(&pdev->dev, "No IRQ resource!\n");
- return -EINVAL;
- }
+ if (irq[0] < 0)
+ goto report_failure;
irq[1] = platform_get_irq(pdev, 1);
- if (irq[1] < 0) {
- dev_err(&pdev->dev, "No IRQ resource!\n");
- return -EINVAL;
- }
+ if (irq[1] < 0)
+ goto report_failure;
info = devm_kzalloc(&pdev->dev, sizeof(struct max8925_onkey_info),
GFP_KERNEL);
@@ -131,6 +127,10 @@ static int max8925_onkey_probe(struct platform_device *pdev)
device_init_wakeup(&pdev->dev, 1);
return 0;
+
+report_failure:
+ dev_err(&pdev->dev, "No IRQ resource!\n");
+ return -EINVAL;
}
static int __maybe_unused max8925_onkey_suspend(struct device *dev)