From patchwork Wed Mar 15 10:52:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Schultz X-Patchwork-Id: 739111 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-lf0-x23b.google.com (mail-lf0-x23b.google.com [IPv6:2a00:1450:4010:c07::23b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vjpN50Csrz9ryT for ; Wed, 15 Mar 2017 21:52:36 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.b="NrQLDioz"; dkim-atps=neutral Received: by mail-lf0-x23b.google.com with SMTP id p31sf4481829lfg.0 for ; Wed, 15 Mar 2017 03:52:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:mime-version:from:to:subject:date:message-id :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=jaeZryBmILZCwogDuWd3Rf5jOdvciHvRcnqmOBpdRDA=; b=NrQLDiozDEM1RoYvbVTKt++I4AI7mesrCJoiHNN399sjdY7JPD+dgd+tQzZ1iWgu6T V0q1XmRqqRP3RjMA62Sr6zA+W6eji75STgXCcwelcpqxBV3XrUMeIZmByqwhUUrxK89I /lZJMzSeU0X7K8EjNgUDc61qqoR/36EYhMyRLUr+b8Kj7gGg8+LJYjTiugPLFK7FAH9h 3KMTOZV+e3chCkA60wVXDmVOKW0qREcbr5vEXw/Zc75wT+kmo2kmLx45QRczR/HXNTFU yC0KhbcUCCtMam8qMs2i53xQlR73FA/2hw95bM7CrMv5nw+UeXU2h9VIOLXDZUcPEZuC Wxyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:mime-version:from:to:subject:date :message-id:x-original-sender:x-original-authentication-results :reply-to:precedence:mailing-list:list-id:x-spam-checked-in-group :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=jaeZryBmILZCwogDuWd3Rf5jOdvciHvRcnqmOBpdRDA=; b=EIaepOGpInzSpcixcutSRy+9/6A5sgyd43Zw3ahZ4WRmZXb4YgPmUvR++bJzfgg/2Q Ateb0C7D20vOyHtoOQhY6ncXHJBybSAoyOQ4x8cTgJKM+s0b1axo2+xcNW+64RW33no6 69yYrcXiul3Y5KRS0bTIU05eDLqfLRltshZEPKoLBa62L5kXf3J7Iv6Mt4pp16TPt9fl q+BoAdEHvfvrbpUt/tKoNP8PRg61xzqf6zQ7RJPH67KTomc5L4Kb+QWXvUNZbxDqhEDg yCot8BHs92tPOkfMLgVZ6JPgsMf50nAbysbe4JMrx59+rHWIVZr8BppMcwzI7QLMuAE5 qXDA== Sender: rtc-linux@googlegroups.com X-Gm-Message-State: AFeK/H2gq9gRfc1CTIDAm2EuGR+KyEUVJzTcpBNzqQCNt1j86nQBPi8GOXxZVozMJwOafw== X-Received: by 10.25.22.207 with SMTP id 76mr20942lfw.10.1489575152973; Wed, 15 Mar 2017 03:52:32 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: rtc-linux@googlegroups.com Received: by 10.46.22.2 with SMTP id w2ls180978ljd.48.gmail; Wed, 15 Mar 2017 03:52:32 -0700 (PDT) X-Received: by 10.46.22.16 with SMTP id w16mr343000ljd.18.1489575152643; Wed, 15 Mar 2017 03:52:32 -0700 (PDT) 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) Received-SPF: pass (google.com: best guess record for domain of d.schultz@phytec.de designates 217.6.246.34 as permitted sender) client-ip=217.6.246.34; Received: from idefix.phytec.de (idefix.phytec.de [172.16.0.10]) by root.phytec.de (Postfix) with ESMTP id 99035A003C0; Wed, 15 Mar 2017 11:53:01 +0100 (CET) Received: from augenblix.phytec.de ([172.16.0.56]) by idefix.phytec.de (IBM Domino Release 9.0.1FP7) with ESMTP id 2017031511523201-355965 ; Wed, 15 Mar 2017 11:52:32 +0100 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> 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 X-Original-Sender: d.schultz@phytec.de X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of d.schultz@phytec.de designates 217.6.246.34 as permitted sender) smtp.mailfrom=d.schultz@phytec.de Reply-To: rtc-linux@googlegroups.com Precedence: list Mailing-list: list rtc-linux@googlegroups.com; contact rtc-linux+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: rtc-linux@googlegroups.com X-Google-Group-Id: 712029733259 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)