From: arvind.yadav.cs@gmail.com (Arvind Yadav)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/3] mfd: sun4i-gpadc: Handle return value of platform_get_irq
Date: Sat, 18 Nov 2017 12:06:33 +0530 [thread overview]
Message-ID: <1510986993-4936-4-git-send-email-arvind.yadav.cs@gmail.com> (raw)
In-Reply-To: <1510986993-4936-1-git-send-email-arvind.yadav.cs@gmail.com>
platform_get_irq() can fail here and we must check its return value.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/mfd/sun4i-gpadc.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/mfd/sun4i-gpadc.c b/drivers/mfd/sun4i-gpadc.c
index 9cfc881..1c89235 100644
--- a/drivers/mfd/sun4i-gpadc.c
+++ b/drivers/mfd/sun4i-gpadc.c
@@ -100,8 +100,8 @@ static int sun4i_gpadc_probe(struct platform_device *pdev)
struct resource *mem;
const struct of_device_id *of_id;
const struct mfd_cell *cells;
- unsigned int irq, size;
- int ret;
+ unsigned int size;
+ int ret, irq;
of_id = of_match_node(sun4i_gpadc_of_match, pdev->dev.of_node);
if (!of_id)
@@ -148,6 +148,9 @@ static int sun4i_gpadc_probe(struct platform_device *pdev)
regmap_write(dev->regmap, SUN4I_GPADC_INT_FIFOC, 0);
irq = platform_get_irq(pdev, 0);
+ if (irq < 0)
+ return irq;
+
ret = devm_regmap_add_irq_chip(&pdev->dev, dev->regmap, irq,
IRQF_ONESHOT, 0,
&sun4i_gpadc_regmap_irq_chip,
--
2.7.4
next prev parent reply other threads:[~2017-11-18 6:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-18 6:36 [PATCH 0/3] mfd: Handle platform_get_irq's error checking and return Arvind Yadav
2017-11-18 6:36 ` [PATCH 1/3] mfd: ipaq-micro: Fix platform_get_irq's error checking Arvind Yadav
2017-11-18 6:36 ` [PATCH 2/3] mfd: intel-lpss: Handle return value of platform_get_* Arvind Yadav
2017-11-18 6:36 ` Arvind Yadav [this message]
2017-11-18 8:15 ` [PATCH 0/3] mfd: Handle platform_get_irq's error checking and return Russell King - ARM Linux
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1510986993-4936-4-git-send-email-arvind.yadav.cs@gmail.com \
--to=arvind.yadav.cs@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).