From nobody Sun Feb 8 14:34:37 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86DA3C74A5B for ; Thu, 23 Mar 2023 08:21:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231201AbjCWIVL (ORCPT ); Thu, 23 Mar 2023 04:21:11 -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 Content-Transfer-Encoding: quoted-printable X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 =3D dev_get_drvdata(dev); + int error; =20 if (device_may_wakeup(dev)) - enable_irq_wake(priv->irq); + error =3D 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; } =20 --=20 2.25.1