From patchwork Thu Aug 8 18:49:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 13758107 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 8E65EC3DA4A for ; Thu, 8 Aug 2024 18:52:25 +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 18AB3E67; Thu, 8 Aug 2024 20:52:13 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 18AB3E67 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1723143143; bh=DaTT56HwWTXhqRQOruorS7NdSThzxpJeGMYGKESqA14=; h=From:To:Cc:Subject:Date:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=OfpP9+TFACp7V1DY3A3xC6PZtpuzkiMPt+qsxPsSl8SC5bZ1/IV9ece2c3QmeLllI SOS+oHprZhuYsp/PXVU/GXJVtbfpdW1oYDyo09p0Qx9zfVH3f8jqVpXUGggJP6BOpt RShVOAF7a+FenSDIx5se0bXhggCdQ0CVdOmtFYvw= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8F270F805AC; Thu, 8 Aug 2024 20:51:51 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 9A6FBF8059F; Thu, 8 Aug 2024 20:51:50 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4FB6BF8047C; Thu, 8 Aug 2024 20:50:36 +0200 (CEST) Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 68969F80236 for ; Thu, 8 Aug 2024 20:50:29 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 68969F80236 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=YRE5mkPg Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1fc53171e56so708735ad.3 for ; Thu, 08 Aug 2024 11:50:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723143027; x=1723747827; darn=alsa-project.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=wG1tqS3eErBEKRyG5e7foes5NY/LKwy15yIXBQJIJ5I=; b=YRE5mkPgj5o/UOheAf3leSWRode4VA+V0qkGhV4hkXjDjYiLUOUoEouG5+YFmatV1j +Mvf5lrrahkun2pvjKmNyQtmhRhnV1tHYEMcjfBhjrs9K6NqxwcQmt5OXb0wi7mqVtkg BRgv0LpkdgHxT+s0FQFcCbyFJRwpFC3NJctY9D9WD+SVWRAMmYZM4u0tX90fLN0t8CD9 39yzHb36wzHVUb+Wa0EmsiXx/xTkB6Y4EFoMfSxrdKz8x4qqVeBJKxC8Dxvp/T9E86JU 4JWT9/rN8sQz4dPBI/CHJQ5HcbMQJe+H/yXF2ccWInYpDlHQppi+uHraac1nYWvqlAvw T+Rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723143027; x=1723747827; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=wG1tqS3eErBEKRyG5e7foes5NY/LKwy15yIXBQJIJ5I=; b=lVgn05lkZm61O5j15Jcf00wjbML1/KehIOkTCIqp/qotYJ4S50n2YgYdlkvXXV0mhC lulCfPu9ZCHXT1Q7Z2kXocdqwWUqtrvFDpZ9DeQ/XZO3SiZrM3f2uPhlgpQIr5vNF78x XsC+GFsKqga85dHIf0a5+14bz9+9GCR92cpIMWDrgCU/oBt5zWSLM4ToqHdCR7U3rT9t OMk2TxmLLVkAnPqH2kSHjhTRtLSa5G9Ayre/+VHRb81J0GBFrzxbWO/MVMSyAXifdYFz rBvqPJrOGW0iPhVgQHN9/qL5TftQosecmg8BuGOPK7jm7F4cOfG1W8gSqqR1fQDunD8z mejw== X-Forwarded-Encrypted: i=1; AJvYcCX8iDYBc+a8qZSyAD/Ph01NZU2tPKs1k5NOYpLbTlbQoxLVdKgF3lBWH6xWH5GLnExIp9sYY+yXYTgaEamlC+blkm1/Xj/1g88xV14= X-Gm-Message-State: AOJu0YyilUjBehL3WVNmoruxr6wQya6tEUDlnyMOrTe7qM5SrrQd610C srXJ9hKQzlMBgV+HzTnzAbh3V61MiOJDSQi/lvZkOqYCR4f9kHjC X-Google-Smtp-Source: AGHT+IErgJoqGZZOyiPlyr6fP443pbB4bYS3lKSH/Ix5z3YbKi2bSdPWbx3yesrbIs+1ELgQjYkvXQ== X-Received: by 2002:a05:6a21:6d94:b0:1c4:c007:51b7 with SMTP id adf61e73a8af0-1c6fcfac527mr1932361637.6.1723143026786; Thu, 08 Aug 2024 11:50:26 -0700 (PDT) Received: from fabio-Precision-3551.. ([2804:14c:485:4b61:d689:1e02:dd79:b72c]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-710cb2e4acesm1466354b3a.141.2024.08.08.11.50.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 11:50:26 -0700 (PDT) From: Fabio Estevam To: broonie@kernel.org Cc: shengjiu.wang@gmail.com, alsa-devel@alsa-project.org, Fabio Estevam Subject: [PATCH 1/7] ASoC: fsl_audmix: Switch to RUNTIME/SYSTEM_SLEEP_PM_OPS() Date: Thu, 8 Aug 2024 15:49:38 -0300 Message-Id: <20240808184944.267686-1-festevam@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Message-ID-Hash: YV7NJ7RWLK6RDL2IK62PUVDPS5J2XSUM X-Message-ID-Hash: YV7NJ7RWLK6RDL2IK62PUVDPS5J2XSUM X-MailFrom: festevam@gmail.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: From: Fabio Estevam Replace SET_RUNTIME_PM_OPS()/SET SYSTEM_SLEEP_PM_OPS() with their modern RUNTIME_PM_OPS() and SYSTEM_SLEEP_PM_OPS() alternatives. The combined usage of pm_ptr() and RUNTIME_PM_OPS/SYSTEM_SLEEP_PM_OPS() allows the compiler to evaluate if the runtime suspend/resume() functions are used at build time or are simply dead code. This allows removing the CONFIG_PM ifdefery from the runtime suspend/resume() functions. Signed-off-by: Fabio Estevam --- sound/soc/fsl/fsl_audmix.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/sound/soc/fsl/fsl_audmix.c b/sound/soc/fsl/fsl_audmix.c index 1671a3037c60..f3a24758aedb 100644 --- a/sound/soc/fsl/fsl_audmix.c +++ b/sound/soc/fsl/fsl_audmix.c @@ -512,7 +512,6 @@ static void fsl_audmix_remove(struct platform_device *pdev) platform_device_unregister(priv->pdev); } -#ifdef CONFIG_PM static int fsl_audmix_runtime_resume(struct device *dev) { struct fsl_audmix *priv = dev_get_drvdata(dev); @@ -540,14 +539,11 @@ static int fsl_audmix_runtime_suspend(struct device *dev) return 0; } -#endif /* CONFIG_PM */ static const struct dev_pm_ops fsl_audmix_pm = { - SET_RUNTIME_PM_OPS(fsl_audmix_runtime_suspend, - fsl_audmix_runtime_resume, - NULL) - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, - pm_runtime_force_resume) + RUNTIME_PM_OPS(fsl_audmix_runtime_suspend, fsl_audmix_runtime_resume, + NULL) + SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) }; static struct platform_driver fsl_audmix_driver = { @@ -556,7 +552,7 @@ static struct platform_driver fsl_audmix_driver = { .driver = { .name = "fsl-audmix", .of_match_table = fsl_audmix_ids, - .pm = &fsl_audmix_pm, + .pm = pm_ptr(&fsl_audmix_pm), }, }; module_platform_driver(fsl_audmix_driver); From patchwork Thu Aug 8 18:49:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 13758108 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 1F2D3C52D71 for ; Thu, 8 Aug 2024 18:52:43 +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 25FF382C; Thu, 8 Aug 2024 20:52:32 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 25FF382C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1723143162; bh=emYBtpRPqSizaSaPPZzaFaP1U6nTwkKV9NMyTaOPuoo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=f5Sw/3E5n0o3uabndC9nSlG9cNY/TB+WnsTsdZQMxNLx+m2xzw8cIc8jtqG6Cdyme +X6ciOxaQO7JTyvzw6vPSU/n4IVF/OJrhe9Q0MRicfKSYsYaMzNXliiVLDb7HAxjGE 3zAFjpC/vm+dkNArvnTd0sKUKPSsuo5eU5L6Wwxk= Received: by alsa1.perex.cz (Postfix, from userid 50401) id C3ED1F805D3; Thu, 8 Aug 2024 20:51:53 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id DE1E4F805C4; Thu, 8 Aug 2024 20:51:52 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5068FF800B0; Thu, 8 Aug 2024 20:50:39 +0200 (CEST) Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id D7284F800B0 for ; Thu, 8 Aug 2024 20:50:31 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D7284F800B0 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=YUpdU+Ae Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-2cdae2bc04dso234915a91.0 for ; Thu, 08 Aug 2024 11:50:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723143029; x=1723747829; darn=alsa-project.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JMVFN+cFz1HfM9dI+IPA2YENRLXpyhEGw4y8eCO6VUc=; b=YUpdU+Aeq/IU85Xp6ihXWSeCYE9rqd7tlwcO1FG3vRczEhASb8BsNPSNhLViaolWSW EHEzzjZWDyr8MgIctgUVYlEg0bKaiCZX332DTS4PLJfmW9wapvvcWNZhXIAydMY32My6 Ngv/YqwadrRaikvrkfOm9zwXN7z3luwUDyHBMyU1nbbY/JvXiV3WQ23Xz2N+zb/TnDRE ImeiKgXD+vZkLuZSSO6bciX3xrjwGKOW5feTtfk6yuykA/uXITPWiFvSxIUQLJ7VcmEo jZTkf+PeLR2z6eIHnuCOnxbu00YzVVs+Om9hAasx5np9j8vaQwJj2BJ3S1hazdr/Edf0 9hPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723143029; x=1723747829; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JMVFN+cFz1HfM9dI+IPA2YENRLXpyhEGw4y8eCO6VUc=; b=oOSmUQCj74AmkZsraJuqMTdSsiC0NjwwBYJA18tas7TGLtovCF2RyRZyDknerNLzmS L1IBwIgGzS7ztiAkN5MmgTTH+0yHz38TfbaSiJ2w29wnyrVxxs9zpo9oYNe1npdWM3JW /dNAqe3fc8Ep3vMAQ6GjYdwLXtgJAH9X6J2PrU7cRj8hdraGoga1xJedjxPAu8hue564 7SGhm3l8SaujWlctLnRpAlzwsa1e4Q+poaSet7TakmBQ+8rGxEmPnlLvHCdJ2dDW2/ek TwhpUzeGqXsspcfmQPUrq8L6Z6KSDRLkpS4jCulX1nNvBO7umqEOIX8PPM/9EWgvjWVU /ltQ== X-Forwarded-Encrypted: i=1; AJvYcCXEQ+jau/zvPKRzBjZTRPnJTrqkOgye8K0vOWjipBKodY6vQr9DIqaMztMOG2/s/aVHnR6Mb9SlbbHy24DHpRF6wmkRIfsHWlTDWAY= X-Gm-Message-State: AOJu0Ywb1rUlIvdZ6O/IYblW2HinvmA6/XfJN9M63XWQp/kxEIjm0FNI Js/zfbA6754/YADgNyMZMcsJWMyLAkPwLIfXy6MTSMDDPLemIWzz X-Google-Smtp-Source: AGHT+IECDrkhoSOjiwwNBZ3Axb5J+dVEog2bAzd5IqC6ESK0B4LrwPe/Rq1izyRDGBam/uVkoWZvHA== X-Received: by 2002:a05:6a21:99a0:b0:1c4:92fc:7c79 with SMTP id adf61e73a8af0-1c6fcf8565amr2124835637.5.1723143029150; Thu, 08 Aug 2024 11:50:29 -0700 (PDT) Received: from fabio-Precision-3551.. ([2804:14c:485:4b61:d689:1e02:dd79:b72c]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-710cb2e4acesm1466354b3a.141.2024.08.08.11.50.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 11:50:28 -0700 (PDT) From: Fabio Estevam To: broonie@kernel.org Cc: shengjiu.wang@gmail.com, alsa-devel@alsa-project.org, Fabio Estevam Subject: [PATCH 2/7] ASoC: fsl_mqs: Switch to RUNTIME/SYSTEM_SLEEP_PM_OPS() Date: Thu, 8 Aug 2024 15:49:39 -0300 Message-Id: <20240808184944.267686-2-festevam@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240808184944.267686-1-festevam@gmail.com> References: <20240808184944.267686-1-festevam@gmail.com> MIME-Version: 1.0 Message-ID-Hash: 7VYXZJBBWNIHCBT5WSHE4XIOIMUVGXRD X-Message-ID-Hash: 7VYXZJBBWNIHCBT5WSHE4XIOIMUVGXRD X-MailFrom: festevam@gmail.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: From: Fabio Estevam Replace SET_RUNTIME_PM_OPS()/SET SYSTEM_SLEEP_PM_OPS() with their modern RUNTIME_PM_OPS() and SYSTEM_SLEEP_PM_OPS() alternatives. The combined usage of pm_ptr() and RUNTIME_PM_OPS/SYSTEM_SLEEP_PM_OPS() allows the compiler to evaluate if the runtime suspend/resume() functions are used at build time or are simply dead code. This allows removing the CONFIG_PM ifdefery from the runtime suspend/resume() functions. Signed-off-by: Fabio Estevam --- sound/soc/fsl/fsl_mqs.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/sound/soc/fsl/fsl_mqs.c b/sound/soc/fsl/fsl_mqs.c index c95b84a54dc4..df160834c81b 100644 --- a/sound/soc/fsl/fsl_mqs.c +++ b/sound/soc/fsl/fsl_mqs.c @@ -265,7 +265,6 @@ static void fsl_mqs_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); } -#ifdef CONFIG_PM static int fsl_mqs_runtime_resume(struct device *dev) { struct fsl_mqs *mqs_priv = dev_get_drvdata(dev); @@ -299,14 +298,10 @@ static int fsl_mqs_runtime_suspend(struct device *dev) return 0; } -#endif static const struct dev_pm_ops fsl_mqs_pm_ops = { - SET_RUNTIME_PM_OPS(fsl_mqs_runtime_suspend, - fsl_mqs_runtime_resume, - NULL) - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, - pm_runtime_force_resume) + RUNTIME_PM_OPS(fsl_mqs_runtime_suspend, fsl_mqs_runtime_resume, NULL) + SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) }; static const struct fsl_mqs_soc_data fsl_mqs_imx8qm_data = { @@ -390,7 +385,7 @@ static struct platform_driver fsl_mqs_driver = { .driver = { .name = "fsl-mqs", .of_match_table = fsl_mqs_dt_ids, - .pm = &fsl_mqs_pm_ops, + .pm = pm_ptr(&fsl_mqs_pm_ops), }, }; From patchwork Thu Aug 8 18:49:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 13758110 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 68151C3DA4A for ; Thu, 8 Aug 2024 18:53:16 +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 57D48E66; Thu, 8 Aug 2024 20:53:04 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 57D48E66 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1723143194; bh=ae321LVliHmFa1rc8wI0yU3i6cZfo8RmSnDSmF2dykk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=fdJa0xliHyNc/hdQsYqFgW+ES2wx6A2XsIm2tL+iTMOvMZXtYa3il18dfFm8FcnvW /EBFVzcvAgoyUqzauSeVVJb4gGAjbJK+/c61HbRQYhRiKbmnhR+s5C5K7t9Zhs+0Zv YRlwq14QGncA0S9Afo8gHBuCmwTz7ocokV0zJBlo= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 48B9BF80630; Thu, 8 Aug 2024 20:51:59 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 9D631F8061D; Thu, 8 Aug 2024 20:51:58 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E516FF802DB; Thu, 8 Aug 2024 20:50:40 +0200 (CEST) Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 0EF5EF8023A for ; Thu, 8 Aug 2024 20:50:33 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0EF5EF8023A Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=ZoxCBn17 Received: by mail-pj1-x1034.google.com with SMTP id 98e67ed59e1d1-2cdae2bc04dso234916a91.0 for ; Thu, 08 Aug 2024 11:50:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723143031; x=1723747831; darn=alsa-project.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=iQf8+lxBRGqbcfv4HYra0T6yNXl6ceOKIYI4wys2BEk=; b=ZoxCBn172tQK2e/n6qpy8awG4++KX+cXdvqAbTzFs3GIjRQ2DYyPA0E4lch1u/xkmr G5KzBvx0xajkVYVfGJLlmRiE0BuMrpkCmwDe+k3PsA0Dn+jADA8vwayibpCMF5q9QEZL 4Z152MZUYzFMqc/XJe7QYxbeFlgkGUlmk+ymeaDafSShZMSDqJziE70dTijClcPyLbcX SPQJvHfDaiNA3gHWjoasNoumDyoE2DRVLY6/ROJ9Mxi8MzYc3upqasmS58aTL3Kayipm m0ZRypOCTXVakFzGeOFFeFsHqp9PQZLspI91OmyU++/jUd9VZsmqfB7PhqoWzllWhxLc jIMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723143031; x=1723747831; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iQf8+lxBRGqbcfv4HYra0T6yNXl6ceOKIYI4wys2BEk=; b=VTM2cXEBFMdIy4KhpddwebUEBhtPzhtjsukZebZEn3WVISYqrOYasXVjCEeg8OGrNU 8NKnX5U7MhVEYDxUPlkZzcD8lrAfRdeRoMyyZPZT0cznaN39w07iElP2sroo4ulp+Scx OFsEGflLGjfsZ7DNMK29mok4HjerEdjgbRDTbHAS1IQiIXcxBxPKrafww6/A2/5C/hjY 1HZM8vZbgiXxDMuukNsWoZO8tkITzhWfHd9qjZce/Fc3XxrSIOCwba+v278YLq0Ti9J/ BkAEMFbxGp0mGEhmdrPPbNtGMmGuDSuNMYJM4V9daZHJDhxxjJS7qh58xjiwGvuu+ncq ecSw== X-Forwarded-Encrypted: i=1; AJvYcCUvaBSjgo1ED+ghKLUx3lSO0dEDLQrPz31pcZlPI7WxaJl/cjeeUfOoID1hcmHnUZw14UgoJLzcM0OVbLt5x0kVdz9GGp4fPFtulTM= X-Gm-Message-State: AOJu0YxrsKrLTHyhASQfmO28P0gY7Rt8627ImPIf5o0B9W69sLZSxxSB blemrG6/yQcqwk6tb/N/l1NuY+BcPwYAIB89OWKfOwu3QxkTTtrgxl0Hzw== X-Google-Smtp-Source: AGHT+IHW5d95YR1OZ6QMEQsz+kRupys9NmA4P5IVjto+TNNsbAqmJQ0uN35VZ0RnFXrrfKa/SN78LQ== X-Received: by 2002:a05:6a21:99a0:b0:1c4:92fc:7c79 with SMTP id adf61e73a8af0-1c6fcf8565amr2124920637.5.1723143031420; Thu, 08 Aug 2024 11:50:31 -0700 (PDT) Received: from fabio-Precision-3551.. ([2804:14c:485:4b61:d689:1e02:dd79:b72c]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-710cb2e4acesm1466354b3a.141.2024.08.08.11.50.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 11:50:30 -0700 (PDT) From: Fabio Estevam To: broonie@kernel.org Cc: shengjiu.wang@gmail.com, alsa-devel@alsa-project.org, Fabio Estevam Subject: [PATCH 3/7] ASoC: fsl_rpmsg: Switch to RUNTIME_PM_OPS() Date: Thu, 8 Aug 2024 15:49:40 -0300 Message-Id: <20240808184944.267686-3-festevam@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240808184944.267686-1-festevam@gmail.com> References: <20240808184944.267686-1-festevam@gmail.com> MIME-Version: 1.0 Message-ID-Hash: 3BOQSDYARTPTADEGRRYJHT77SGBNSVWE X-Message-ID-Hash: 3BOQSDYARTPTADEGRRYJHT77SGBNSVWE X-MailFrom: festevam@gmail.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: From: Fabio Estevam Replace SET_RUNTIME_PM_OPS() with its modern RUNTIME_PM_OPS() alternative. The combined usage of pm_ptr() and RUNTIME_PM_OPS() allows the compiler to evaluate if the runtime suspend/resume() functions are used at build time or are simply dead code. This allows removing the CONFIG_PM ifdefery from the runtime suspend/resume() functions. Signed-off-by: Fabio Estevam --- sound/soc/fsl/fsl_rpmsg.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sound/soc/fsl/fsl_rpmsg.c b/sound/soc/fsl/fsl_rpmsg.c index 467d6bc9f956..be46fbfd487a 100644 --- a/sound/soc/fsl/fsl_rpmsg.c +++ b/sound/soc/fsl/fsl_rpmsg.c @@ -286,7 +286,6 @@ static void fsl_rpmsg_remove(struct platform_device *pdev) platform_device_unregister(rpmsg->card_pdev); } -#ifdef CONFIG_PM static int fsl_rpmsg_runtime_resume(struct device *dev) { struct fsl_rpmsg *rpmsg = dev_get_drvdata(dev); @@ -321,12 +320,10 @@ static int fsl_rpmsg_runtime_suspend(struct device *dev) return 0; } -#endif static const struct dev_pm_ops fsl_rpmsg_pm_ops = { - SET_RUNTIME_PM_OPS(fsl_rpmsg_runtime_suspend, - fsl_rpmsg_runtime_resume, - NULL) + RUNTIME_PM_OPS(fsl_rpmsg_runtime_suspend, fsl_rpmsg_runtime_resume, + NULL) }; static struct platform_driver fsl_rpmsg_driver = { @@ -334,7 +331,7 @@ static struct platform_driver fsl_rpmsg_driver = { .remove_new = fsl_rpmsg_remove, .driver = { .name = "fsl_rpmsg", - .pm = &fsl_rpmsg_pm_ops, + .pm = pm_ptr(&fsl_rpmsg_pm_ops), .of_match_table = fsl_rpmsg_ids, }, }; From patchwork Thu Aug 8 18:49:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 13758109 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 491F8C52D71 for ; Thu, 8 Aug 2024 18:53:02 +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 292E0BC0; Thu, 8 Aug 2024 20:52:45 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 292E0BC0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1723143175; bh=YT5DQ0+/e7yx74XohDZVPwTDptrdlTLnHK8ziXULtxc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=ju5bcdPoVAjCvVT3O+Jv2hxD8ISQOqpc1Byx+//m1IpPi2MBnuIO/YYyzaRo5xM0b K4BAF0qz3Y2UMwHMrmy6CmMLqPm1a66feE/AHmazwz1zE6l5GZupMAnvxHCm/6GsZw zWenW/jiIulNMxpkivxC1j9H7tvPEzeWV5mW6Lhc= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6FC40F805F8; Thu, 8 Aug 2024 20:51:56 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id AABEFF80605; Thu, 8 Aug 2024 20:51:55 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1FA94F8047C; Thu, 8 Aug 2024 20:50:40 +0200 (CEST) Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 00C16F802DB for ; Thu, 8 Aug 2024 20:50:35 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 00C16F802DB Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=DY7Dx+Ub Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-70d2cd07869so110863b3a.0 for ; Thu, 08 Aug 2024 11:50:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723143034; x=1723747834; darn=alsa-project.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IAYNl1QP07O60/hQ1fZUEjMYLs8NATGmFAsys6ANyRo=; b=DY7Dx+UbtV3NZL708ktJXSih94thySpIGFJUxDVW5CZgx2bbKn2acoP9zxz7IvPIr9 LsnSYPQ8g7NxRsNJYE1Umjt5Tmwh9A9ZHlCn0qCzTpYNqSrRjc+hG+PtgOG9zirPt9hc G26R3+YlodQJ3bAYGGu+YfcpY/JtzJrp4FTuxNFP76y7ImQLXguj8a4loNH0K2Nuen6l MPLjbsY7R3OoakXR+DNqRrCyK3vs4MPK+9vlWokmMg9mrHXSWHBIG9pxiJMdGWL5EEmP 9AGW+vIS8C5G32lHO5eO+avNho111MudHsYIfR0wfSPAcfWutugUheCUjlwu6QQQhPBM /INw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723143034; x=1723747834; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IAYNl1QP07O60/hQ1fZUEjMYLs8NATGmFAsys6ANyRo=; b=w1ZDJpPNPqUlIaRSILxRefh0gG++PCP5CTBU9ytOKjDn1+RmNqby8kyzrjZsN1R5IN jjX94U2mdPYGQpGu9g8opZIxV4I7RgVTOhu/6Z7vQW3kX+o/bia/E1hSGMxFKHZVkJcq zUtZVgDN7Dkp2mzBdDtBpc2Oxn73TVO55dt60fmPzHAwIbTmA9O0e+Zva1E8S8ae54TK us4YRtrgBBH7M5scoZaYvVOXQnR5QIGgk1uQqdxTjbm4oyE2gNjyEdmDBkH9s3kQtB0C sAWzWMb4JnqlK/qdZQSslAZkA9lZGGD9B3O4UpifoefRz73eymGEtahUoErz6nwpoHJt 4fdA== X-Forwarded-Encrypted: i=1; AJvYcCXrJd/C/zqhTUAtjKUk9ld1FsYtUXM/pcsIF7x6RrZgt/wrPLyxXgdy8hOp0RtT7zPvdQTKvVUfD1KU@alsa-project.org X-Gm-Message-State: AOJu0YzkL0iQ/zlpu12PG0yVymi+IZPF5j7nmrcEjXY/xKpmcfqyhofa 62fgEUawWiMvR2qPB0s3B9UbRBvLeygs4VScz9lpKcztHARuvh/j X-Google-Smtp-Source: AGHT+IHJIqEGKclHlOo1+rDoERCauD/j0paHC49vv/k4K6HAjTuLx6t0loSWmMiikFyjXXlwHIsUaQ== X-Received: by 2002:a05:6a00:1151:b0:710:5d11:ec2e with SMTP id d2e1a72fcca58-710cab62135mr2080404b3a.0.1723143033686; Thu, 08 Aug 2024 11:50:33 -0700 (PDT) Received: from fabio-Precision-3551.. ([2804:14c:485:4b61:d689:1e02:dd79:b72c]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-710cb2e4acesm1466354b3a.141.2024.08.08.11.50.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 11:50:33 -0700 (PDT) From: Fabio Estevam To: broonie@kernel.org Cc: shengjiu.wang@gmail.com, alsa-devel@alsa-project.org, Fabio Estevam Subject: [PATCH 4/7] ASoC: fsl_spdif: Switch to RUNTIME/SYSTEM_SLEEP_PM_OPS() Date: Thu, 8 Aug 2024 15:49:41 -0300 Message-Id: <20240808184944.267686-4-festevam@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240808184944.267686-1-festevam@gmail.com> References: <20240808184944.267686-1-festevam@gmail.com> MIME-Version: 1.0 Message-ID-Hash: COODNZQHHRIQHZ35YF35N4XJ7ZDI4KA7 X-Message-ID-Hash: COODNZQHHRIQHZ35YF35N4XJ7ZDI4KA7 X-MailFrom: festevam@gmail.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: From: Fabio Estevam Replace SET_RUNTIME_PM_OPS()/SET SYSTEM_SLEEP_PM_OPS() with their modern RUNTIME_PM_OPS() and SYSTEM_SLEEP_PM_OPS() alternatives. The combined usage of pm_ptr() and RUNTIME_PM_OPS/SYSTEM_SLEEP_PM_OPS() allows the compiler to evaluate if the runtime suspend/resume() functions are used at build time or are simply dead code. This allows removing the CONFIG_PM ifdefery from the runtime suspend/resume() functions. Signed-off-by: Fabio Estevam --- sound/soc/fsl/fsl_spdif.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c index a63121c888e0..eace399cb064 100644 --- a/sound/soc/fsl/fsl_spdif.c +++ b/sound/soc/fsl/fsl_spdif.c @@ -1667,7 +1667,6 @@ static void fsl_spdif_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); } -#ifdef CONFIG_PM static int fsl_spdif_runtime_suspend(struct device *dev) { struct fsl_spdif_priv *spdif_priv = dev_get_drvdata(dev); @@ -1739,13 +1738,11 @@ static int fsl_spdif_runtime_resume(struct device *dev) return ret; } -#endif /* CONFIG_PM */ static const struct dev_pm_ops fsl_spdif_pm = { - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, - pm_runtime_force_resume) - SET_RUNTIME_PM_OPS(fsl_spdif_runtime_suspend, fsl_spdif_runtime_resume, - NULL) + SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) + RUNTIME_PM_OPS(fsl_spdif_runtime_suspend, fsl_spdif_runtime_resume, + NULL) }; static const struct of_device_id fsl_spdif_dt_ids[] = { @@ -1763,7 +1760,7 @@ static struct platform_driver fsl_spdif_driver = { .driver = { .name = "fsl-spdif-dai", .of_match_table = fsl_spdif_dt_ids, - .pm = &fsl_spdif_pm, + .pm = pm_ptr(&fsl_spdif_pm), }, .probe = fsl_spdif_probe, .remove_new = fsl_spdif_remove, From patchwork Thu Aug 8 18:49:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 13758111 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 969FEC52D7E for ; Thu, 8 Aug 2024 18:53:32 +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 BDBA8852; Thu, 8 Aug 2024 20:53:19 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz BDBA8852 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1723143209; bh=MhEsQ1YhBS7ENCam3SZu+v3ER3kvrJKDxuJz+ioi4mg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=eRscUKmH5IP1gJ66gy/t3G8U+2AOi3kihbFNpFuKXQjS/RB1W/sPKH8oJL4LtCyop FF/Fj6lkqQd6GQGA1Akr7pbn8bdZ+yGS2x1Pa7c1VJVBfzz8Y+jj6bQ3V2miapzzIM IXS45FwJC6n4rnjUd5Z/WZpDzdmF7Y3ExOaHFgDs= Received: by alsa1.perex.cz (Postfix, from userid 50401) id D340DF80675; Thu, 8 Aug 2024 20:52:01 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 8834BF80671; Thu, 8 Aug 2024 20:52:00 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id AE73BF802DB; Thu, 8 Aug 2024 20:50:41 +0200 (CEST) Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 2B1DDF80448 for ; Thu, 8 Aug 2024 20:50:37 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2B1DDF80448 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=TM9S7SMV Received: by mail-pj1-x102d.google.com with SMTP id 98e67ed59e1d1-2cb67992a5cso233339a91.1 for ; Thu, 08 Aug 2024 11:50:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723143036; x=1723747836; darn=alsa-project.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=h4pHrt2xUkfCwAqwX3B5Nmo1NO5wRbMR//VAm7OLTR4=; b=TM9S7SMV548/pxvDfZpayeLfEB72qZRMi61w3fVUZB1j3RpLb0PXIVHJ7LvYhHh+Rk qSpiTEHT9/hWPkuO+r4DUN7yUHsAWvU7uGlPDxXANRHM0eSXVNhBU++Y8EiCvhWlI76c 7NWaEJ/nGODm9gzcS/cIR/8H6OUwWq4cynUre7GlSAQb78YA9g519PJHZUqqAdaaIGKg AHWUxxyHZbrroN38+2xWrkdODre09AP/qonAguOcaxWyVU3E4b+8mt3+tvgJyA4p33hx N3ejTSnV7yRGFs9MVpi917OclErLK8s5LPxgyXnA5AGKtzaWnSJ4icWy6VD+1lvibcUm 5+2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723143036; x=1723747836; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=h4pHrt2xUkfCwAqwX3B5Nmo1NO5wRbMR//VAm7OLTR4=; b=NG/X5mkC/ans/6zQpSd4oefdW+EIbz5aEZ/jZEkMrlQyDl4B+LglJOVywNqjjtdFeT FVg5sPsGEIvSu5DcsesHXYaI9Kn1gErQIc/9XCG8Y7zlUde7N4ACwcOBqbSQhHZtD5W9 A1z7uvBCOuZ07VmvgQgm++F4d0zPF+lliyTQlJto6UNb5OTKMytaxIGPxKEqh7nGU97y TYvxLWB8UbBWu1HScWvk/iDBkhCmyEBduzlhRjco189mls2VSmerRVnhCOzQYD23VE0b FDnOykvW3MvGF1WvJZRYdWBJ2OjOVTvfw0khQPZ1cFSSR8tQINhKl0xv/BXzidNudytd 2kOA== X-Forwarded-Encrypted: i=1; AJvYcCVB3v+k20lM9cM0qfZA3BuCqV+5D6XGbZmON8m2yC2B5/BZN3SGZtJZcATk80pjzAjHDVVl2qeyN+oHTeK2Duz5YFxSIqW+4n/3gkQ= X-Gm-Message-State: AOJu0Yxepn1IIwTZ2uDhYR//EvniujfSZNJSBJ0JDh1HXjseoiYnNK3r gceXhLu3C7u1ZGCSinXPCrLWgUI981cJid8KNZ5m1Retu0xt+gTg X-Google-Smtp-Source: AGHT+IHVBpJ7JLbHxySN4W4Pw59z+IlKERxq1z4tvfyZQyyHxOHfggs8RpFx3c9G+SzwYZjoyhgcEQ== X-Received: by 2002:a05:6a20:4325:b0:1c4:ccef:cd6e with SMTP id adf61e73a8af0-1c6fd040521mr2000385637.8.1723143035986; Thu, 08 Aug 2024 11:50:35 -0700 (PDT) Received: from fabio-Precision-3551.. ([2804:14c:485:4b61:d689:1e02:dd79:b72c]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-710cb2e4acesm1466354b3a.141.2024.08.08.11.50.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 11:50:35 -0700 (PDT) From: Fabio Estevam To: broonie@kernel.org Cc: shengjiu.wang@gmail.com, alsa-devel@alsa-project.org, Fabio Estevam Subject: [PATCH 5/7] ASoC: fsl_ssi: Switch to SYSTEM_SLEEP_PM_OPS Date: Thu, 8 Aug 2024 15:49:42 -0300 Message-Id: <20240808184944.267686-5-festevam@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240808184944.267686-1-festevam@gmail.com> References: <20240808184944.267686-1-festevam@gmail.com> MIME-Version: 1.0 Message-ID-Hash: V75ECC4P74CGLHMLBHLE4TANX3C7BYRP X-Message-ID-Hash: V75ECC4P74CGLHMLBHLE4TANX3C7BYRP X-MailFrom: festevam@gmail.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: From: Fabio Estevam Replace SET_SYSTEM_SLEEP_PM_OPS() with its modern SYSTEM_SLEEP_PM_OPS() alternative. The combined usage of pm_sleep_ptr() and SYSTEM_SLEEP_PM_OPS() allows the compiler to evaluate if the suspend/resume() functions are used at build time or are simply dead code. This allows removing the CONFIG_PM_SLEEP ifdefery from the suspend/resume() functions. Signed-off-by: Fabio Estevam --- sound/soc/fsl/fsl_ssi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index 4ca3a16f7ac0..c4c1d9c44056 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c @@ -1693,7 +1693,6 @@ static void fsl_ssi_remove(struct platform_device *pdev) } } -#ifdef CONFIG_PM_SLEEP static int fsl_ssi_suspend(struct device *dev) { struct fsl_ssi *ssi = dev_get_drvdata(dev); @@ -1723,17 +1722,16 @@ static int fsl_ssi_resume(struct device *dev) return regcache_sync(regs); } -#endif /* CONFIG_PM_SLEEP */ static const struct dev_pm_ops fsl_ssi_pm = { - SET_SYSTEM_SLEEP_PM_OPS(fsl_ssi_suspend, fsl_ssi_resume) + SYSTEM_SLEEP_PM_OPS(fsl_ssi_suspend, fsl_ssi_resume) }; static struct platform_driver fsl_ssi_driver = { .driver = { .name = "fsl-ssi-dai", .of_match_table = fsl_ssi_ids, - .pm = &fsl_ssi_pm, + .pm = pm_sleep_ptr(&fsl_ssi_pm), }, .probe = fsl_ssi_probe, .remove_new = fsl_ssi_remove, From patchwork Thu Aug 8 18:49:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 13758112 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 021ABC3DA4A for ; Thu, 8 Aug 2024 18:53:48 +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 97F02E9A; Thu, 8 Aug 2024 20:53:36 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 97F02E9A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1723143226; bh=IYIEF2tpGgWgsk3UCWqxe52vjVCoL1cfnQRYQZUX0wU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=UtzD3X9vOKoKhsVGzHzHXfMPnoPI+1zXt8gmLjD2IF1CfA3d+n8JJ5+y6yy8KVUDt Mg7pJB7kVIFOgQ3pRRF+SivxPo3za6UobvJPCdTTs9k97zWZhiZkXH4pU8VK930Xi7 iVxMWKSQFYiHF6qwcE/FeRk/DD0AcpxD/LfMzuis= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 94D96F80685; Thu, 8 Aug 2024 20:52:03 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id ACD9DF8067A; Thu, 8 Aug 2024 20:52:02 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id F18CCF802DB; Thu, 8 Aug 2024 20:50:42 +0200 (CEST) Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 7B0C1F800B0 for ; Thu, 8 Aug 2024 20:50:40 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 7B0C1F800B0 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=l+EKkqen Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-70d2879bfb0so130383b3a.0 for ; Thu, 08 Aug 2024 11:50:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723143038; x=1723747838; darn=alsa-project.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dN83GrAFp2sbzsWsThcrr6kqMedA31alRy4sc8FYM98=; b=l+EKkqenm1F3rZRnETewYts3rx2y52TwdiieuBFCkDopzjdSxnzBkTyr8jjia/kmK1 s/58btUGb0LO31YNvmgrYJi+Rk8Jw5qdbgyLvQKFFU9M7vwIclU/Oxsys1SPoN+FBv9B PZXG3I5djJ1sitnJMaYv4LxHH4OOW+7fRvHk0vehAc3yEI3UziFnW4ahLRj2FEtCmxNS ee8xZZb0j+4WfCeVKsZCSW76JlOqxhXwQOvWZG7s6rfRaZx9P22rQ/RRKu3bsPqMy3N1 fozcl7VWjdzXuqGh+cH4Px6CdtDjg/dcEM/q8IikjAXgO/vz93Mb92Nevq61udceXDdd Oe6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723143038; x=1723747838; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dN83GrAFp2sbzsWsThcrr6kqMedA31alRy4sc8FYM98=; b=Sx/YyI50YhF+cWqbuH6H59cJMyVgrY5F0WdP7Smm+lgd3EKJs+e8Sv+Twg/ADFSyrV vxLG6GZ5x4P8dBYkQMyvfVVI+k+yAX3HvsCW0g5mFrC4Fi+hwvZQag1Ay8bmmyhnZCGR w73sN62d+RLKHWJp3mCNOOxTRN7cZ5Dgl5gUeGyTgBdKCuQGTjnrRdDPgHSZLbQuhTrB 1kDbfndlqMBiSvi1QXh9YR/zlLhJyHt0bjJntde0nYYJMvmVa5YYlt40kFgi4fhl/Dfx H9XaZKXhHC5D+RjnpqvKgs0HvWHLMj+I6AFGu/+RhGwRPGVsdryOJjaVOrTaq/20eJIk 2Wug== X-Forwarded-Encrypted: i=1; AJvYcCU5RgWnAfQvu4lRSOR89ypUCp2llPxYetBduz8VGJbEmbqmJHumRToGr931BRU7JQdtAqk1vnBYS5qwmBMO1EuabheZgh6bVQtanbg= X-Gm-Message-State: AOJu0YwMVOtZQ67Stz0fz9s5w6smK0hjwcbAb7p7FDNKQKkRx1YaWi/c pIBznjEKXne88nE2GCe7W7xbeoPjXo+HJgeWhw1gk38I8uoNFeWIO9rQ1A== X-Google-Smtp-Source: AGHT+IFNv4lJ/2PUM0ae4lyqNexS0DCH4TI69skYGrTVrP7C3nl35aJfHts5bNDEcXHvD5zesFe0ww== X-Received: by 2002:a05:6a00:3a14:b0:70d:1048:d4eb with SMTP id d2e1a72fcca58-710cae6b355mr2038957b3a.3.1723143038367; Thu, 08 Aug 2024 11:50:38 -0700 (PDT) Received: from fabio-Precision-3551.. ([2804:14c:485:4b61:d689:1e02:dd79:b72c]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-710cb2e4acesm1466354b3a.141.2024.08.08.11.50.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 11:50:37 -0700 (PDT) From: Fabio Estevam To: broonie@kernel.org Cc: shengjiu.wang@gmail.com, alsa-devel@alsa-project.org, Fabio Estevam Subject: [PATCH 6/7] ASoC: imx-audmux: Switch to SYSTEM_SLEEP_PM_OPS Date: Thu, 8 Aug 2024 15:49:43 -0300 Message-Id: <20240808184944.267686-6-festevam@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240808184944.267686-1-festevam@gmail.com> References: <20240808184944.267686-1-festevam@gmail.com> MIME-Version: 1.0 Message-ID-Hash: JZEVBSDBMEZAHDY4BBELFLWT4EXXOGCS X-Message-ID-Hash: JZEVBSDBMEZAHDY4BBELFLWT4EXXOGCS X-MailFrom: festevam@gmail.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: From: Fabio Estevam Replace SET_SYSTEM_SLEEP_PM_OPS() with its modern SYSTEM_SLEEP_PM_OPS() alternative. The combined usage of pm_sleep_ptr() and SYSTEM_SLEEP_PM_OPS() allows the compiler to evaluate if the suspend/resume() functions are used at build time or are simply dead code. This allows removing the CONFIG_PM_SLEEP ifdefery from the suspend/resume() functions. Signed-off-by: Fabio Estevam --- sound/soc/fsl/imx-audmux.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sound/soc/fsl/imx-audmux.c b/sound/soc/fsl/imx-audmux.c index 747ab2f1aae3..f97ae14dc452 100644 --- a/sound/soc/fsl/imx-audmux.c +++ b/sound/soc/fsl/imx-audmux.c @@ -320,7 +320,6 @@ static void imx_audmux_remove(struct platform_device *pdev) audmux_debugfs_remove(); } -#ifdef CONFIG_PM_SLEEP static int imx_audmux_suspend(struct device *dev) { int i; @@ -348,10 +347,9 @@ static int imx_audmux_resume(struct device *dev) return 0; } -#endif /* CONFIG_PM_SLEEP */ static const struct dev_pm_ops imx_audmux_pm = { - SET_SYSTEM_SLEEP_PM_OPS(imx_audmux_suspend, imx_audmux_resume) + SYSTEM_SLEEP_PM_OPS(imx_audmux_suspend, imx_audmux_resume) }; static struct platform_driver imx_audmux_driver = { @@ -359,7 +357,7 @@ static struct platform_driver imx_audmux_driver = { .remove_new = imx_audmux_remove, .driver = { .name = DRIVER_NAME, - .pm = &imx_audmux_pm, + .pm = pm_sleep_ptr(&imx_audmux_pm), .of_match_table = imx_audmux_dt_ids, } }; From patchwork Thu Aug 8 18:49:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 13758113 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 0C909C3DA4A for ; Thu, 8 Aug 2024 18:54:09 +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 F1ED084C; Thu, 8 Aug 2024 20:53:56 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz F1ED084C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1723143247; bh=ddYKQIDL235r4+RKAIGr9PUoUGq/CeBqhl036jTf0z4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=GBeX2zHSg9LIweZ0Tb1LBY0Gu2LHW3NDtbPSwRvSewN8ZT3936D8J8cKNcc0ros3O nqVMkP2zQ82Zv8QjDRgadXLne031Mas9/+mNu/mL2DaOvNQV8axw/VTFHlrWCJ8tzx cPiDWuEbPoFlMRfn9NSUmZaO3857etrJ+ZkiUmpw= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6B866F806AB; Thu, 8 Aug 2024 20:52:06 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 3F7EFF806AC; Thu, 8 Aug 2024 20:52:05 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B6419F802DB; Thu, 8 Aug 2024 20:50:45 +0200 (CEST) Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 27C54F80236 for ; Thu, 8 Aug 2024 20:50:42 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 27C54F80236 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=SyBorBet Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-70d2cd07869so110877b3a.0 for ; Thu, 08 Aug 2024 11:50:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723143041; x=1723747841; darn=alsa-project.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zHFlSeM0x9wf/C8SejIAylQjDyad2lQr4Ad9tCBEoBs=; b=SyBorBet/uvWrWxQW8OzhKSLZ+PVIwfM+XyHtJiMhlksdoDARagFFgpc6mF1oqySM2 PRJpS4y5KtsgEmK/434RQWcw8R++XCjDQVC4PEDEiV2xZpzsDykPbBPHdkUHRT70UbLt lHpXgnK4Pko2TDu4+DXLPVm2z6LRvWJlFwXDe6iaj7IcntsHuiRJyLwJTfT9MMg2+Y2F nkgasipMmLlVOZkNZZ863V+Mezp60QUOf1RHdez1v9o7QFRA9kbxsyE7ix82ViZTlyKh GjZzwEj2IPjUB+vGAdws34CV9Sdcatl4Vz5J0QzBHtqPzT7MqDHhBDrH9TGrC9wpLV6V SFwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723143041; x=1723747841; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zHFlSeM0x9wf/C8SejIAylQjDyad2lQr4Ad9tCBEoBs=; b=oEm51C8zVGSJ0bnzhaGHOrZga336lWEl4knKCAgzZbFGNC5H8XU+RNFLFF4brdIZqC o/GnzhT0MAIgZhx/gqUeoXd6Bssz5AK32mqwNLRtN2AoouuT6hRKl8zS7Q6AVIGVeH3/ DXqlpYYyCy5oVaLSfyxaQkrLIV054C9tYcAEFZgLh+LJLazc4EKhEF9lqPUp+wfCz5/A LIK1hpA7ULYlo8d03Qke85r8TH9vMQIqHZNv3w/QPHXx4MDKqBf6EjLPx0gCvdM1St9K kQda0Uaht+jhcYrHr+W3lGsvczG5SHSgxzWWmRHnpINJkFN6OtEz274z7JerokGfYk+C VNPA== X-Forwarded-Encrypted: i=1; AJvYcCVYZRNRf+MZASY+DIBtKw15sxLmmhMqteh1IOS/hMFPSTNTtNFKHyBbEgoBwZhFBDMls2aGXwiT40Xw@alsa-project.org X-Gm-Message-State: AOJu0YyoupXtuNo1NA6mEdhMmPlTQvUIiEshiiwaGnF9iKGzXHe3j+62 dINr8dVVhAWWIhRpWhzJuXuZHFu7UHbv9VEzi5iNhVDNZ3htWit9F/Krww== X-Google-Smtp-Source: AGHT+IEJNzTRowR2scY7npjwzCxHF+PmEuPWdFSnIypgTkFivuBev917Fym2WHBPKdalssWtfBz3sA== X-Received: by 2002:a05:6a00:3928:b0:70d:148e:4bad with SMTP id d2e1a72fcca58-710cad593demr2064483b3a.2.1723143040643; Thu, 08 Aug 2024 11:50:40 -0700 (PDT) Received: from fabio-Precision-3551.. ([2804:14c:485:4b61:d689:1e02:dd79:b72c]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-710cb2e4acesm1466354b3a.141.2024.08.08.11.50.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 11:50:40 -0700 (PDT) From: Fabio Estevam To: broonie@kernel.org Cc: shengjiu.wang@gmail.com, alsa-devel@alsa-project.org, Fabio Estevam Subject: [PATCH 7/7] ASoC: imx-pcm-rpmsg: Switch to RUNTIME/SYSTEM_SLEEP_PM_OPS() Date: Thu, 8 Aug 2024 15:49:44 -0300 Message-Id: <20240808184944.267686-7-festevam@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240808184944.267686-1-festevam@gmail.com> References: <20240808184944.267686-1-festevam@gmail.com> MIME-Version: 1.0 Message-ID-Hash: FX5IGAQUDLTOHKNT2J235MLANA5FHAYI X-Message-ID-Hash: FX5IGAQUDLTOHKNT2J235MLANA5FHAYI X-MailFrom: festevam@gmail.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: From: Fabio Estevam Replace SET_RUNTIME_PM_OPS()/SET SYSTEM_SLEEP_PM_OPS() with their modern RUNTIME_PM_OPS() and SYSTEM_SLEEP_PM_OPS() alternatives. The combined usage of pm_ptr() and RUNTIME_PM_OPS/SYSTEM_SLEEP_PM_OPS() allows the compiler to evaluate if the runtime suspend/resume() functions are used at build time or are simply dead code. This allows removing the CONFIG_PM ifdefery from the runtime suspend/resume() functions. Signed-off-by: Fabio Estevam --- sound/soc/fsl/imx-pcm-rpmsg.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/sound/soc/fsl/imx-pcm-rpmsg.c b/sound/soc/fsl/imx-pcm-rpmsg.c index b0944a07ab47..22156f99dcee 100644 --- a/sound/soc/fsl/imx-pcm-rpmsg.c +++ b/sound/soc/fsl/imx-pcm-rpmsg.c @@ -753,7 +753,6 @@ static void imx_rpmsg_pcm_remove(struct platform_device *pdev) destroy_workqueue(info->rpmsg_wq); } -#ifdef CONFIG_PM static int imx_rpmsg_pcm_runtime_resume(struct device *dev) { struct rpmsg_info *info = dev_get_drvdata(dev); @@ -771,9 +770,7 @@ static int imx_rpmsg_pcm_runtime_suspend(struct device *dev) return 0; } -#endif -#ifdef CONFIG_PM_SLEEP static int imx_rpmsg_pcm_suspend(struct device *dev) { struct rpmsg_info *info = dev_get_drvdata(dev); @@ -809,14 +806,11 @@ static int imx_rpmsg_pcm_resume(struct device *dev) return 0; } -#endif /* CONFIG_PM_SLEEP */ static const struct dev_pm_ops imx_rpmsg_pcm_pm_ops = { - SET_RUNTIME_PM_OPS(imx_rpmsg_pcm_runtime_suspend, - imx_rpmsg_pcm_runtime_resume, - NULL) - SET_SYSTEM_SLEEP_PM_OPS(imx_rpmsg_pcm_suspend, - imx_rpmsg_pcm_resume) + RUNTIME_PM_OPS(imx_rpmsg_pcm_runtime_suspend, + imx_rpmsg_pcm_runtime_resume, NULL) + SYSTEM_SLEEP_PM_OPS(imx_rpmsg_pcm_suspend, imx_rpmsg_pcm_resume) }; static const struct platform_device_id imx_rpmsg_pcm_id_table[] = { @@ -832,7 +826,7 @@ static struct platform_driver imx_pcm_rpmsg_driver = { .id_table = imx_rpmsg_pcm_id_table, .driver = { .name = IMX_PCM_DRV_NAME, - .pm = &imx_rpmsg_pcm_pm_ops, + .pm = pm_ptr(&imx_rpmsg_pcm_pm_ops), }, }; module_platform_driver(imx_pcm_rpmsg_driver);