From: Daniel Schultz <d.schultz@phytec.de>
To: a.zummo@towertech.it, alexandre.belloni@free-electrons.com,
rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org
Subject: [PATCH] driver: rtc: tps65910: Add parameter check
Date: Wed, 15 Mar 2017 11:52:32 +0100 [thread overview]
Message-ID: <1489575152-29931-1-git-send-email-d.schultz@phytec.de> (raw)
If the tps65910 driver has no interrupt, the probe of tps65910-rtc will
fail.
This patch adds a check in the probe of the rtc if an interrupt exist.
The check is similar to the check in the function which creates the
interrupt.
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
---
drivers/rtc/rtc-tps65910.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/rtc/rtc-tps65910.c b/drivers/rtc/rtc-tps65910.c
index d0244d7..8c5ca11 100644
--- a/drivers/rtc/rtc-tps65910.c
+++ b/drivers/rtc/rtc-tps65910.c
@@ -375,6 +375,11 @@ static int tps65910_rtc_probe(struct platform_device *pdev)
tps65910 = dev_get_drvdata(pdev->dev.parent);
+ if (!tps65910->chip_irq) {
+ dev_warn(&pdev->dev, "No interrupt support, not created\n");
+ return -EINVAL;
+ }
+
tps_rtc = devm_kzalloc(&pdev->dev, sizeof(struct tps65910_rtc),
GFP_KERNEL);
if (!tps_rtc)
--
1.9.1
next reply other threads:[~2017-03-15 10:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-15 10:52 Daniel Schultz [this message]
2017-04-03 11:01 ` [PATCH] driver: rtc: tps65910: Add parameter check Alexandre Belloni
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=1489575152-29931-1-git-send-email-d.schultz@phytec.de \
--to=d.schultz@phytec.de \
--cc=a.zummo@towertech.it \
--cc=alexandre.belloni@free-electrons.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rtc-linux@googlegroups.com \
/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