Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1678547

[PATCH v2] clocksource: em_sti: fix error return codes in em_sti_probe()

From "Gustavo A. R. Silva" <garsilva@embeddedor.com>
Newsgroups linux.kernel
Subject [PATCH v2] clocksource: em_sti: fix error return codes in em_sti_probe()
Date 2017-06-30 09:10 +0200
Message-ID <tXYdY-2mX-23@gated-at.bofh.it> (permalink)
References <tXX8e-1pk-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Propagate the return values of platform_get_irq and
devm_request_irq on failure.

Cc: Frans Klaver <fransklaver@gmail.com>
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
Changes in v2:
 Use 'ret' instead of 'irq' for taking the result of devm_request_irq.

 drivers/clocksource/em_sti.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/clocksource/em_sti.c b/drivers/clocksource/em_sti.c
index bc48cbf..269db74 100644
--- a/drivers/clocksource/em_sti.c
+++ b/drivers/clocksource/em_sti.c
@@ -305,7 +305,7 @@ static int em_sti_probe(struct platform_device *pdev)
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0) {
 		dev_err(&pdev->dev, "failed to get irq\n");
-		return -EINVAL;
+		return irq;
 	}
 
 	/* map memory, let base point to the STI instance */
@@ -314,11 +314,12 @@ static int em_sti_probe(struct platform_device *pdev)
 	if (IS_ERR(p->base))
 		return PTR_ERR(p->base);
 
-	if (devm_request_irq(&pdev->dev, irq, em_sti_interrupt,
-			     IRQF_TIMER | IRQF_IRQPOLL | IRQF_NOBALANCING,
-			     dev_name(&pdev->dev), p)) {
+	ret = devm_request_irq(&pdev->dev, irq, em_sti_interrupt,
+			       IRQF_TIMER | IRQF_IRQPOLL | IRQF_NOBALANCING,
+			       dev_name(&pdev->dev), p);
+	if (ret) {
 		dev_err(&pdev->dev, "failed to request low IRQ\n");
-		return -ENOENT;
+		return ret;
 	}
 
 	/* get hold of clock */
-- 
2.5.0

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] clocksource: em_sti: fix error return codes in em_sti_probe() "Gustavo A. R. Silva" <garsilva@embeddedor.com> - 2017-06-30 06:50 +0200
  Re: [PATCH] clocksource: em_sti: fix error return codes in em_sti_probe() Frans Klaver <fransklaver@gmail.com> - 2017-06-30 07:50 +0200
    Re: [PATCH] clocksource: em_sti: fix error return codes in  em_sti_probe() "Gustavo A. R. Silva" <garsilva@embeddedor.com> - 2017-06-30 08:00 +0200
      [PATCH v2] clocksource: em_sti: fix error return codes in  em_sti_probe() "Gustavo A. R. Silva" <garsilva@embeddedor.com> - 2017-06-30 09:10 +0200

csiph-web