From patchwork Tue Feb 6 11:38:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charles Keepax X-Patchwork-Id: 770406 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A175EC4828D for ; Tue, 6 Feb 2024 11:40:10 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 4B1C5201; Tue, 6 Feb 2024 12:39:58 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4B1C5201 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1707219608; bh=VT/+OxIyoOo6H3eZuB5ps/bmedQcEHIv03PdGa9zsOc=; h=From:To:CC:Subject:Date:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=iPiedhOO7WKVTP5uTDMU5cR3PYIVdijY7KFZijqEPgCU3+jgB/NfNZIzCRpQom3A2 B0+bEEwHPIM/0bWDIRzDC++UfyKhygYv+SaPrtCjgGChmsfPeahsmyThJaNxQDSkf/ VaVaDy5wcIuSeyltKzz0qMsJmS6lNfiazDhrvFN4= Received: by alsa1.perex.cz (Postfix, from userid 50401) id DBF8CF805C9; Tue, 6 Feb 2024 12:39:18 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id DED04F805AF; Tue, 6 Feb 2024 12:39:17 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id BACB4F801EB; Tue, 6 Feb 2024 12:39:10 +0100 (CET) Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id C7D35F800E3 for ; Tue, 6 Feb 2024 12:39:03 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C7D35F800E3 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=cirrus.com header.i=@cirrus.com header.a=rsa-sha256 header.s=PODMain02222019 header.b=l6+/Q2KZ Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 416AS7om031521; Tue, 6 Feb 2024 05:38:52 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding:content-type; s=PODMain02222019; bh=U 3jrdINzTbzsq4ZEzk9Ff+i2j8C7e/Bjf0XM9izjTuE=; b=l6+/Q2KZtA7BAUY41 pBTB19kdyapEFJhsEUz2Y1Q7CRrZJOLHKUDYtxQsrQoZYkC8g9ImnEzQAc+w4qFz 5x4PyOwfHd21l6GcL2NKlNGU+sFuTrDnl4JFieLpvOHvEACj+D5TQ2KKm+ARUTkb ejv1spRZGsBkKLJqWLUxF7zTakCGQ7wJi51zLj3dWjZrZbTbOvlYzk0XchHgNcl9 nXfAb5dyZN5LciNpap9a/OZGjFKWw16PGLCIPfVUi/8mB3G7jOEpj/kCvbyafz5H 8iI8s7xRwveH6i7aocFLXGQTbH2WxVwcWpN2R302tH5qhRqQtpG/UlbJ5mfbb0v8 aZe/g== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3w1ks2bap3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 06 Feb 2024 05:38:52 -0600 (CST) Received: from ediex02.ad.cirrus.com (198.61.84.81) by ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Tue, 6 Feb 2024 11:38:50 +0000 Received: from ediswmail9.ad.cirrus.com (198.61.86.93) by anon-ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server id 15.2.1118.40 via Frontend Transport; Tue, 6 Feb 2024 11:38:50 +0000 Received: from ediswws07.ad.cirrus.com (ediswws07.ad.cirrus.com [198.90.208.14]) by ediswmail9.ad.cirrus.com (Postfix) with ESMTP id 2E016820241; Tue, 6 Feb 2024 11:38:50 +0000 (UTC) From: Charles Keepax To: CC: , , , Subject: [PATCH 1/2] ASoC: cs42l43: Handle error from devm_pm_runtime_enable Date: Tue, 6 Feb 2024 11:38:49 +0000 Message-ID: <20240206113850.719888-1-ckeepax@opensource.cirrus.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Proofpoint-GUID: uCVt0nHFigik6zGnt1jeAwXSiXzMyFIa X-Proofpoint-ORIG-GUID: uCVt0nHFigik6zGnt1jeAwXSiXzMyFIa X-Proofpoint-Spam-Reason: safe Message-ID-Hash: IGSOONMBG4EFS3MASYDENFXZM7ZH5UHL X-Message-ID-Hash: IGSOONMBG4EFS3MASYDENFXZM7ZH5UHL X-MailFrom: prvs=9766772a2b=ckeepax@opensource.cirrus.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: As devm_pm_runtime_enable can fail due to memory allocations, it is best to handle the error. Signed-off-by: Charles Keepax --- sound/soc/codecs/cs42l43.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/cs42l43.c b/sound/soc/codecs/cs42l43.c index 256767ef4c03..f1e119277622 100644 --- a/sound/soc/codecs/cs42l43.c +++ b/sound/soc/codecs/cs42l43.c @@ -2283,7 +2283,10 @@ static int cs42l43_codec_probe(struct platform_device *pdev) pm_runtime_use_autosuspend(priv->dev); pm_runtime_set_active(priv->dev); pm_runtime_get_noresume(priv->dev); - devm_pm_runtime_enable(priv->dev); + + ret = devm_pm_runtime_enable(priv->dev); + if (ret) + goto err_pm; for (i = 0; i < ARRAY_SIZE(cs42l43_irqs); i++) { ret = cs42l43_request_irq(priv, dom, cs42l43_irqs[i].name,