From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752713AbdCOKwg (ORCPT ); Wed, 15 Mar 2017 06:52:36 -0400 Received: from mail.phycard.co.uk ([217.6.246.34]:33581 "EHLO root.phytec.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751672AbdCOKwe (ORCPT ); Wed, 15 Mar 2017 06:52:34 -0400 From: Daniel Schultz 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 Message-Id: <1489575152-29931-1-git-send-email-d.schultz@phytec.de> 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: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Sender: rtc-linux@googlegroups.com MIME-Version: 1.0 Received: from root.phytec.de (mail.phytec.de. [217.6.246.34]) by gmr-mx.google.com with ESMTP id e72si1682wma.0.2017.03.15.03.52.32 for ; Wed, 15 Mar 2017 03:52:32 -0700 (PDT) From: Daniel Schultz To: a.zummo@towertech.it, alexandre.belloni@free-electrons.com, rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org Subject: [rtc-linux] [PATCH] driver: rtc: tps65910: Add parameter check Date: Wed, 15 Mar 2017 11:52:32 +0100 Message-Id: <1489575152-29931-1-git-send-email-d.schultz@phytec.de> Reply-To: rtc-linux@googlegroups.com Content-Type: text/plain; charset=UTF-8 List-ID: List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , 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 -- You received this message because you are subscribed to "rtc-linux". Membership options at http://groups.google.com/group/rtc-linux . Please read http://groups.google.com/group/rtc-linux/web/checklist before submitting a driver. --- You received this message because you are subscribed to the Google Groups "rtc-linux" group. To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/d/optout.