Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752719AbdDCLBa (ORCPT ); Mon, 3 Apr 2017 07:01:30 -0400 Received: from mail.free-electrons.com ([62.4.15.54]:58203 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752075AbdDCLB3 (ORCPT ); Mon, 3 Apr 2017 07:01:29 -0400 Date: Mon, 3 Apr 2017 13:01:27 +0200 From: Alexandre Belloni To: Daniel Schultz Cc: a.zummo@towertech.it, rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] driver: rtc: tps65910: Add parameter check Message-ID: <20170403110127.asqdxbyny63bpr67@piout.net> References: <1489575152-29931-1-git-send-email-d.schultz@phytec.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1489575152-29931-1-git-send-email-d.schultz@phytec.de> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1232 Lines: 43 Hi, On 15/03/2017 at 11:52:32 +0100, Daniel Schultz wrote: > 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. > Can you elaborate on what this is fixing? If the probe already fails I'm not sure why your patch is also making it fail. > 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 > -- Alexandre Belloni, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com