From patchwork Wed Apr 24 12:26:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabien DESSENNE X-Patchwork-Id: 10914667 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7E95C14DB for ; Wed, 24 Apr 2019 12:27:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6AB2B28899 for ; Wed, 24 Apr 2019 12:27:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5DDE3288AD; Wed, 24 Apr 2019 12:27:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E1CFB28899 for ; Wed, 24 Apr 2019 12:27:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=zpWW7T39uuULI6iTTPG1RBv5wbFQxDFBFAbiqBoAd7I=; b=KY3dR/YoBPcLmD Zrx7wiY4ALxh74ccWNwmlFKGSy+DFVQghYTy4pVnb0vcC0DYQSUHKdutgC0zMpr/KhL13T87py2TS 4Hl7TZxftLj7b04nfj78QHvpGQSAtUI/RJpIs/NsQA0GrITP1DmPzmHPJSICX4q7qijqIqaBefW77 0o0ykzCBjlgGpMFJkj/ii3m2w8E5IB41jydO4279vHzttiTuB+SRQ0tUxTIgFnpZHdjvbHEuobKae zbebxWaYJpzSMhzZp6VT1HD+E2yCsNfZCCokGBnIcnUABHzlkkIgG4SS8ebJBmF77Rwq83nsRscPo hQgObzf8wIhxr5c5LOZA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hJGzk-0006xs-Kk; Wed, 24 Apr 2019 12:27:24 +0000 Received: from mx08-00178001.pphosted.com ([91.207.212.93] helo=mx07-00178001.pphosted.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hJGzM-0006DN-1i for linux-arm-kernel@lists.infradead.org; Wed, 24 Apr 2019 12:27:04 +0000 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x3OC6eQN024358; Wed, 24 Apr 2019 14:26:56 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=STMicroelectronics; bh=h9D+RmnNCvP7dwWVcYtp3MBpjBes7RInZNX3mwfwoo8=; b=iU1/aiQTc/ikYT7DchSugv7ll+UijXK1m05lk2SWXlxczUnjSsO5OZHgbN+hMNQ33eo/ vtRzQhZoe39oWMBznj5tCPI4EEPrZfsAWHSjD5VAwZ5+JyVsQAEfVHLI6WmlsAoZ+Ww8 kiLXyV5RnscLnOuzG0W77Nf6rv802g+yOAHBc9vTekTFw1Fx559yGIXCH8kIw/MM+BKM axoEJukU4PK7+MutFY6XpGCYmdl4+eAmsqq839gcOlsZiVXb+xdbNFfC+nV6gR8UT2Gm ZoRjldpibfpqt15lNZCTvrQUEASZg/5UrKEbliVEGIl4Gk53wJN8rjYTS8xW8Uq5d5oR 7g== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2rytad6fg8-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 24 Apr 2019 14:26:56 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 1492D31; Wed, 24 Apr 2019 12:26:55 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas24.st.com [10.75.90.94]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id DA84C254E; Wed, 24 Apr 2019 12:26:54 +0000 (GMT) Received: from SAFEX1HUBCAS23.st.com (10.75.90.47) by Safex1hubcas24.st.com (10.75.90.94) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 24 Apr 2019 14:26:54 +0200 Received: from localhost (10.201.23.25) by webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 24 Apr 2019 14:26:54 +0200 From: Fabien Dessenne To: Alessandro Zummo , Alexandre Belloni , Maxime Coquelin , Alexandre Torgue , Amelie Delaunay , , , , Subject: [PATCH] rtc: stm32: manage the get_irq probe defer case Date: Wed, 24 Apr 2019 14:26:48 +0200 Message-ID: <1556108808-32722-1-git-send-email-fabien.dessenne@st.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [10.201.23.25] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-04-24_08:, , signatures=0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190424_052700_895299_21D58A3B X-CRM114-Status: GOOD ( 15.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fabien Dessenne Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Manage the -EPROBE_DEFER error case for the wake IRQ. Signed-off-by: Fabien Dessenne Acked-by: Amelie Delaunay --- drivers/rtc/rtc-stm32.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/rtc/rtc-stm32.c b/drivers/rtc/rtc-stm32.c index c5908cf..8e6c9b3 100644 --- a/drivers/rtc/rtc-stm32.c +++ b/drivers/rtc/rtc-stm32.c @@ -788,11 +788,14 @@ static int stm32_rtc_probe(struct platform_device *pdev) ret = device_init_wakeup(&pdev->dev, true); if (rtc->data->has_wakeirq) { rtc->wakeirq_alarm = platform_get_irq(pdev, 1); - if (rtc->wakeirq_alarm <= 0) - ret = rtc->wakeirq_alarm; - else + if (rtc->wakeirq_alarm > 0) { ret = dev_pm_set_dedicated_wake_irq(&pdev->dev, rtc->wakeirq_alarm); + } else { + ret = rtc->wakeirq_alarm; + if (rtc->wakeirq_alarm == -EPROBE_DEFER) + goto err; + } } if (ret) dev_warn(&pdev->dev, "alarm can't wake up the system: %d", ret);