Commit 406dc004 authored by Sachin Kamat's avatar Sachin Kamat Committed by Linus Torvalds

drivers/rtc/rtc-max8997.c: fix incorrect return value on error

'ret' was being returned without initializing it to error code.  While at
it also remove duplicate return statement.
Signed-off-by: default avatarSachin Kamat <sachin.kamat@linaro.org>
Cc: Jonghwa Lee <jonghwa3.lee@samsung.com>
Cc: Chiwoong Byun <woong.byun@samsung.com>
Cc: Laxman dewangan <ldewangan@nvidia.com>
Cc: Venu Byravarasu <vbyravarasu@nvidia.com>
Cc: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent dbda161b
...@@ -491,6 +491,7 @@ static int max8997_rtc_probe(struct platform_device *pdev) ...@@ -491,6 +491,7 @@ static int max8997_rtc_probe(struct platform_device *pdev)
virq = irq_create_mapping(max8997->irq_domain, MAX8997_PMICIRQ_RTCA1); virq = irq_create_mapping(max8997->irq_domain, MAX8997_PMICIRQ_RTCA1);
if (!virq) { if (!virq) {
dev_err(&pdev->dev, "Failed to create mapping alarm IRQ\n"); dev_err(&pdev->dev, "Failed to create mapping alarm IRQ\n");
ret = -ENXIO;
goto err_out; goto err_out;
} }
info->virq = virq; info->virq = virq;
...@@ -498,13 +499,9 @@ static int max8997_rtc_probe(struct platform_device *pdev) ...@@ -498,13 +499,9 @@ static int max8997_rtc_probe(struct platform_device *pdev)
ret = devm_request_threaded_irq(&pdev->dev, virq, NULL, ret = devm_request_threaded_irq(&pdev->dev, virq, NULL,
max8997_rtc_alarm_irq, 0, max8997_rtc_alarm_irq, 0,
"rtc-alarm0", info); "rtc-alarm0", info);
if (ret < 0) { if (ret < 0)
dev_err(&pdev->dev, "Failed to request alarm IRQ: %d: %d\n", dev_err(&pdev->dev, "Failed to request alarm IRQ: %d: %d\n",
info->virq, ret); info->virq, ret);
goto err_out;
}
return ret;
err_out: err_out:
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment