From patchwork Thu Mar 23 08:19:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dhruva Gole X-Patchwork-Id: 1760179 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-rtc-owner@vger.kernel.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.a=rsa-sha256 header.s=ti-com-17Q1 header.b=syZkzMks; dkim-atps=neutral Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4PhywV1g22z1yXt for ; Thu, 23 Mar 2023 19:21:14 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230172AbjCWIVK (ORCPT ); Thu, 23 Mar 2023 04:21:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231149AbjCWIVJ (ORCPT ); Thu, 23 Mar 2023 04:21:09 -0400 Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9959A2FCC2; Thu, 23 Mar 2023 01:21:04 -0700 (PDT) Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 32N8Ko7T026331; Thu, 23 Mar 2023 03:20:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1679559650; bh=dPNdU4ue14DzCPDHyhU/4abFD76OFIMPf62lgDWUi98=; h=From:To:CC:Subject:Date; b=syZkzMksRL7rNhY8sOv+ZueGzkhyZwPnlZN0O5EqrW72xgFg6P5SHbiMufmmdNQqF qTxH78hGYjjH5cGroSAPkn7h7rpufHh70Aa1DNJBFBZCb+TciJka5pQBvhJUwN/CBr xtqde92KQ8SLZJE8BRE8n06CPis2HVINPoWEldE0= Received: from DFLE100.ent.ti.com (dfle100.ent.ti.com [10.64.6.21]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 32N8KoMd006966 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 23 Mar 2023 03:20:50 -0500 Received: from DFLE105.ent.ti.com (10.64.6.26) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Thu, 23 Mar 2023 03:20:49 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16 via Frontend Transport; Thu, 23 Mar 2023 03:20:49 -0500 Received: from localhost (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 32N8KmuK043249; Thu, 23 Mar 2023 03:20:49 -0500 From: Dhruva Gole To: Alexandre Belloni CC: Vibhore Vardhan , Dhruva Gole , , Alessandro Zummo , , Nishanth Menon Subject: [PATCH] rtc: k3: handle errors while enabling wake irq Date: Thu, 23 Mar 2023 13:49:42 +0530 Message-ID: <20230323081942.951542-1-d-gole@ti.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-rtc@vger.kernel.org Due to the potential failure of enable_irq_wake(), it would be better to check it and return error if it fails. Fixes: b09d633575e5 ("rtc: Introduce ti-k3-rtc") Cc: Nishanth Menon Signed-off-by: Dhruva Gole --- drivers/rtc/rtc-ti-k3.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/rtc/rtc-ti-k3.c b/drivers/rtc/rtc-ti-k3.c index ba23163cc042..ef9d7e1cf92e 100644 --- a/drivers/rtc/rtc-ti-k3.c +++ b/drivers/rtc/rtc-ti-k3.c @@ -630,9 +630,18 @@ MODULE_DEVICE_TABLE(of, ti_k3_rtc_of_match_table); static int __maybe_unused ti_k3_rtc_suspend(struct device *dev) { struct ti_k3_rtc *priv = dev_get_drvdata(dev); + int error; if (device_may_wakeup(dev)) - enable_irq_wake(priv->irq); + error = enable_irq_wake(priv->irq); + + if (error) { + dev_err(dev, + "failed to enable irq wake on IRQ %d: %d\n", + priv->irq, error); + return error; + } + return 0; }