Path: csiph.com!news.redatomik.org!aioe.org!bofh.it!news.nic.it!robomod From: Daniel Schultz Newsgroups: linux.kernel Subject: [PATCH] driver: rtc: tps65910: Add parameter check Date: Wed, 15 Mar 2017 12:00:02 +0100 Message-ID: X-Mailer: git-send-email 1.9.1 X-Mimetrack: Itemize by SMTP Server on Idefix/Phytec(Release 9.0.1FP7|August 17, 2016) at 15.03.2017 11:52:32, Serialize by Router on Idefix/Phytec(Release 9.0.1FP7|August 17, 2016) at 15.03.2017 11:52:32, Serialize complete at 15.03.2017 11:52:32 X-Tnefevaluated: 1 Sender: robomod@news.nic.it List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Approved: robomod@news.nic.it Lines: 30 Organization: linux.* mail to news gateway X-Original-Date: Wed, 15 Mar 2017 11:52:32 +0100 X-Original-Message-ID: <1489575152-29931-1-git-send-email-d.schultz@phytec.de> X-Original-Sender: linux-kernel-owner@vger.kernel.org Xref: csiph.com linux.kernel:1601271 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 --- 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