From patchwork Tue May 7 17:37:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 795547 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 DAB30C10F1A for ; Tue, 7 May 2024 17:44:37 +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 E8ED87F8; Tue, 7 May 2024 19:44:24 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E8ED87F8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1715103874; bh=jqJugf1QsieZWieybWIQUFBlhWNpq6ZRLj4ld7NcAmk=; h=From:To:Cc:Subject:Date:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=nfCNQhvEPV0pU/EIzf7ZbxEnG7jYk4PWdPyqxB2+cyyR26CbV3/STVpEBzYKwnZIG IGdu7IE0CAGlas63LNNtLxMaX110X46PGnY7IDq7II2ejd8GZn5GUDN3owsI7zAVG1 CfMgOacus1pykUVvwWsiuff2uAmmeU2dYEaZ2YiU= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 72B17F805B4; Tue, 7 May 2024 19:44:12 +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 199A4F805A8; Tue, 7 May 2024 19:44:11 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E0C0BF804F2; Tue, 7 May 2024 19:38:09 +0200 (CEST) Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) (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 39C93F80152 for ; Tue, 7 May 2024 19:37:56 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 39C93F80152 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=G5VBF140 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1ed72194f0aso1550035ad.1 for ; Tue, 07 May 2024 10:37:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715103475; x=1715708275; 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=25lgoJ/O2oeQ/Qg9WTJfZXYcxMBwYTkCOOxVainY88U=; b=G5VBF140iQ4nHJ2fa7YUiHIoSu5D0HJpv+tGJAtpRDo8pKXoBnih/yQx7rEPXA8HaA it+lx4XFKVcV4zRnDXh2f5dafUbxIpWdkmYXYXVjjAVyoPwfYDulvxmKZg70oLlPVjiG dkUGEF4YjiFVpU9bsSwVGB6rlVeXtItvJ7yG8OumKlPWs6Jmu7zKcEaDz+CIJPZFV/bV jF1lsLiHUi9s051KQ+Zr0O62uMy0q/vkwsVVRaOc1n453RdfJupk2DRy/XH4Q/kok+an orPKfoY0oXBYVR7TgVNKvpkV48AInANU1vwRe98s/h3kNOEGMGApNYN2w69T3SMAgrnS cXpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715103475; x=1715708275; 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=25lgoJ/O2oeQ/Qg9WTJfZXYcxMBwYTkCOOxVainY88U=; b=iWH3Oyvu9wsdTtnlPNJXiAi3KbBwcFm4H1a+Zy9xpBvdrth4dC+7aUXPUeYeXXUCk/ DeSn5Yp9ileLlru6pWwHwXbeeRoPLbP6HEp/nFlmXzMrRvHrXoPwDvQRoPMRbgEvYb6d q+0QURYxF5VgzWeaj1is1tjihX/ZDKzYm4ZLMj72CFY+StQl56PpAOgdWAlJW0qRY7Yt ld/yZWp7PzUqTPKH/4ZfQYgKLGAIlYbrbTvO0ASFZWqZFTTqSny70BOewA90+lIfb/O+ Chvm8Vju5cKcOMqRAqnF26JiBeP/NKwzx61NBjAsIeDVEi8FzCNJaY2UN7coq58creON weMQ== X-Forwarded-Encrypted: i=1; AJvYcCVJE782fV6fi25gGpysnRD5JGM+ZPebbbQpn3IeChjGqI6WSIWopn1M/d61prGeWfgDarzZLcztBKiH28lrkNTtFzCpldFrmHtyzDY= X-Gm-Message-State: AOJu0YzG31sYTXPlNyDEV50QQu9SijXqsPljGPq8DfJhhancg8OZhx9k o4nlJAlYCGYozLdgvJV8RhVnKBs8FfUycAMFeo6lraDeKT3waPmr X-Google-Smtp-Source: AGHT+IGVOSEuKKgQeqszyPBH9mYH14DpW3ziSHEItln7XJrLIIc2BJ6cwkd8HPP1K4ZrAhjO9K8Igg== X-Received: by 2002:a05:6a00:929a:b0:6ec:f5d2:f641 with SMTP id d2e1a72fcca58-6f49c1efa12mr385059b3a.1.1715103474701; Tue, 07 May 2024 10:37:54 -0700 (PDT) Received: from fabio-Precision-3551.. ([2804:14c:485:4b61:1054:2c2f:fb76:3191]) by smtp.gmail.com with ESMTPSA id bm6-20020a056a00320600b006ed0c9751d0sm9997970pfb.98.2024.05.07.10.37.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 10:37:54 -0700 (PDT) From: Fabio Estevam To: broonie@kernel.org Cc: shengjiu.wang@gmail.com, alsa-devel@alsa-project.org, Fabio Estevam Subject: [PATCH 1/3] ASoC: fsl: fsl_aud2htx: Switch to RUNTIME_PM_OPS() Date: Tue, 7 May 2024 14:37:33 -0300 Message-Id: <20240507173735.3456334-1-festevam@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Message-ID-Hash: DX5WZ23EEOXAIACGRBSYQF2TJCMQYAIB X-Message-ID-Hash: DX5WZ23EEOXAIACGRBSYQF2TJCMQYAIB 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 alternative RUNTIME_PM_OPS(). 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 __maybe_unused notation from the runtime suspend/resume() functions. Signed-off-by: Fabio Estevam Acked-by: Shengjiu Wang --- sound/soc/fsl/fsl_aud2htx.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/sound/soc/fsl/fsl_aud2htx.c b/sound/soc/fsl/fsl_aud2htx.c index ee2f6ad1f800..a6cbaa6364c7 100644 --- a/sound/soc/fsl/fsl_aud2htx.c +++ b/sound/soc/fsl/fsl_aud2htx.c @@ -261,7 +261,7 @@ static void fsl_aud2htx_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); } -static int __maybe_unused fsl_aud2htx_runtime_suspend(struct device *dev) +static int fsl_aud2htx_runtime_suspend(struct device *dev) { struct fsl_aud2htx *aud2htx = dev_get_drvdata(dev); @@ -271,7 +271,7 @@ static int __maybe_unused fsl_aud2htx_runtime_suspend(struct device *dev) return 0; } -static int __maybe_unused fsl_aud2htx_runtime_resume(struct device *dev) +static int fsl_aud2htx_runtime_resume(struct device *dev) { struct fsl_aud2htx *aud2htx = dev_get_drvdata(dev); int ret; @@ -288,9 +288,8 @@ static int __maybe_unused fsl_aud2htx_runtime_resume(struct device *dev) } static const struct dev_pm_ops fsl_aud2htx_pm_ops = { - SET_RUNTIME_PM_OPS(fsl_aud2htx_runtime_suspend, - fsl_aud2htx_runtime_resume, - NULL) + RUNTIME_PM_OPS(fsl_aud2htx_runtime_suspend, fsl_aud2htx_runtime_resume, + NULL) SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) }; @@ -300,7 +299,7 @@ static struct platform_driver fsl_aud2htx_driver = { .remove_new = fsl_aud2htx_remove, .driver = { .name = "fsl-aud2htx", - .pm = &fsl_aud2htx_pm_ops, + .pm = pm_ptr(&fsl_aud2htx_pm_ops), .of_match_table = fsl_aud2htx_dt_ids, }, }; From patchwork Tue May 7 17:37:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 795546 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 D6931C10F1A for ; Tue, 7 May 2024 17:45:20 +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 D895CB65; Tue, 7 May 2024 19:45:08 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D895CB65 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1715103918; bh=gM77PrnIE+tWgxK77qHUPHGZKhSXRMQdDd0Y9OD2sQE=; 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=LHaBlUVHz3s37zUmDl3/c3sKCmHbHwbkZEjJL7dvYqK38GRgYVCj6w7DvIUu7SliT KQaYUwIjrEbtyXqIrd4zAxfxwYqYyCXv1teJFkUp/Co654TrVOZe3kKA0+ChJlsBEz WzMqoHbUvoMIcSfMw/Dyx0By6dDM5TmMGBO7Lr6w= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 76C09F805EF; Tue, 7 May 2024 19:44:20 +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 C9E3DF805F8; Tue, 7 May 2024 19:44:18 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id F21ABF8024C; Tue, 7 May 2024 19:40:16 +0200 (CEST) Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) (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 5C7B8F8024C for ; Tue, 7 May 2024 19:37:59 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 5C7B8F8024C 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=DCa4lxYn Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-1ed72194f0aso1550115ad.1 for ; Tue, 07 May 2024 10:37:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715103477; x=1715708277; 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=lJ6PYhE4RdXOr8XQe8+MBCrlkpMDO7uc3LEU5QHaRzU=; b=DCa4lxYnV+UgL91cFDumXFRzzeoS/Ps36+oKB3C9X2+SeZP76pw5m2NzfvaxDJBUE5 BhnjUE5vFf/g+7RkCiirzseYJmEEJCVe/p1iACvpGq7bnHNzS7N8lTGYAeI8dMLuQLrg 6oJh+PfDNBG+CilLauCLKDIgayS8b1VNs6v03A5qyoDDiPt7qpCHgkVpJdnWBa8Ugk11 uCZDJ1xtN5MPOuuCj24ezjmNTwHbC9+oZuOQ1ISSZ6DloatPyWVSOldC1KKfGFvn18/C CZ2g2S53+zPW75ablVNru8Jw02pfjj6Map8UN4cXRs2Srp1YXKZJQEiKYIthC1a/2A0g Ntgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715103477; x=1715708277; 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=lJ6PYhE4RdXOr8XQe8+MBCrlkpMDO7uc3LEU5QHaRzU=; b=VPuFBWXLHjpxe5tzo1HjQCguKM7q5AecEnRAMbTUKoBCXSxwJ81AHYls+ZTlk186JI NrJug5NCuMJgLvklj2upUmrEf3Vr2AZEbb4nQhLVMktfvkXF5sMAC/6eyr+zLPka0k7t ik2s2kdpNI/r/PM8qt6oUA8BHn2KTwRPLWkLsrfUcXA1ChKJQya9BHfACOBQvjZdAEEv jQEdKwJ+lJtIA/JTRA4PbqEQtqHrN8nKIAebecqceUQA+YW+MZYyuHLOm/v2z0CPn+bQ BrmGO1jR4+C/LiQ1Hx8Yx5jPvGgBHzheA66Lk6sc6KoIzXMgMiTOQiGUsOjdzZuNoERz aNsw== X-Forwarded-Encrypted: i=1; AJvYcCVY4+JvOkv/KZT6AN4WWm5HhSFswwWnsAFMzGboK9U4B35tFMdVvA/N9djQxiXJ/fR3f/IS3/Bmak++Ghodej4ZnYGbb2SQN7MUtqg= X-Gm-Message-State: AOJu0Yxi8qZAidWiCGGHMy88qYYhesFCdFrhsxgkwUKyaWnZyYixs2M6 2xEjWOHGeWDH6cKuLySK4HmDX7NTOKZ/xVi9JzuweQdKlEb2UmHv X-Google-Smtp-Source: AGHT+IFoH6HoK8dhhATNs9QMChQweq3A0Vm8hOb9PSzRAZKagiOHCPybsvfc9nA2GjB8eIRUtTNU7w== X-Received: by 2002:a05:6a21:7882:b0:1af:96e7:2be6 with SMTP id adf61e73a8af0-1afc8b14766mr563817637.0.1715103477119; Tue, 07 May 2024 10:37:57 -0700 (PDT) Received: from fabio-Precision-3551.. ([2804:14c:485:4b61:1054:2c2f:fb76:3191]) by smtp.gmail.com with ESMTPSA id bm6-20020a056a00320600b006ed0c9751d0sm9997970pfb.98.2024.05.07.10.37.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 10:37:56 -0700 (PDT) From: Fabio Estevam To: broonie@kernel.org Cc: shengjiu.wang@gmail.com, alsa-devel@alsa-project.org, Fabio Estevam Subject: [PATCH 2/3] ASoC: fsl: fsl_easrc: Switch to RUNTIME_PM_OPS() Date: Tue, 7 May 2024 14:37:34 -0300 Message-Id: <20240507173735.3456334-2-festevam@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240507173735.3456334-1-festevam@gmail.com> References: <20240507173735.3456334-1-festevam@gmail.com> MIME-Version: 1.0 Message-ID-Hash: 7KJNELUGKQIHI46TF4VLNF4VD2RPC5SS X-Message-ID-Hash: 7KJNELUGKQIHI46TF4VLNF4VD2RPC5SS 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 alternative RUNTIME_PM_OPS(). 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 __maybe_unused notation from the runtime suspend/resume() functions. Signed-off-by: Fabio Estevam Acked-by: Shengjiu Wang --- sound/soc/fsl/fsl_easrc.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sound/soc/fsl/fsl_easrc.c b/sound/soc/fsl/fsl_easrc.c index ec53bda46a46..962f30912091 100644 --- a/sound/soc/fsl/fsl_easrc.c +++ b/sound/soc/fsl/fsl_easrc.c @@ -1988,7 +1988,7 @@ static void fsl_easrc_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); } -static __maybe_unused int fsl_easrc_runtime_suspend(struct device *dev) +static int fsl_easrc_runtime_suspend(struct device *dev) { struct fsl_asrc *easrc = dev_get_drvdata(dev); struct fsl_easrc_priv *easrc_priv = easrc->private; @@ -2005,7 +2005,7 @@ static __maybe_unused int fsl_easrc_runtime_suspend(struct device *dev) return 0; } -static __maybe_unused int fsl_easrc_runtime_resume(struct device *dev) +static int fsl_easrc_runtime_resume(struct device *dev) { struct fsl_asrc *easrc = dev_get_drvdata(dev); struct fsl_easrc_priv *easrc_priv = easrc->private; @@ -2086,9 +2086,7 @@ static __maybe_unused int fsl_easrc_runtime_resume(struct device *dev) } static const struct dev_pm_ops fsl_easrc_pm_ops = { - SET_RUNTIME_PM_OPS(fsl_easrc_runtime_suspend, - fsl_easrc_runtime_resume, - NULL) + RUNTIME_PM_OPS(fsl_easrc_runtime_suspend, fsl_easrc_runtime_resume, NULL) SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) }; @@ -2098,7 +2096,7 @@ static struct platform_driver fsl_easrc_driver = { .remove_new = fsl_easrc_remove, .driver = { .name = "fsl-easrc", - .pm = &fsl_easrc_pm_ops, + .pm = pm_ptr(&fsl_easrc_pm_ops), .of_match_table = fsl_easrc_dt_ids, }, }; From patchwork Tue May 7 17:37:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 795245 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 92DDCC25B4F for ; Tue, 7 May 2024 17:44:58 +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 A5BFDB76; Tue, 7 May 2024 19:44:46 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A5BFDB76 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1715103896; bh=zjGSH+EcpOfb/UAdWWJ47Gqrwy8RbEezn3WyNtlI72s=; 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=kgwjIB11vJA6m2EiIg2BK6lZ+v1U6dBe4viqNfSmgu7fqWjAo//OabelBm0dPFSqt tFV4IHs5I9uKP7Bwnhp9PdS/lOzCT5oQ5Yeli46cL2E81BHvnnt8kH1n9vZ7kgaxQA 6xqtzaYmvt1GoxE9bDMzYSUDRpSqO8ZAxmYPL8Fk= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 550F5F805C9; Tue, 7 May 2024 19:44:18 +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 390BCF805CB; Tue, 7 May 2024 19:44:17 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9F057F804E7; Tue, 7 May 2024 19:38:12 +0200 (CEST) Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) (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 DD6EAF8049C for ; Tue, 7 May 2024 19:38:01 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz DD6EAF8049C 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=coucd9ir Received: by mail-pg1-x52c.google.com with SMTP id 41be03b00d2f7-5cdbc42f5efso113258a12.0 for ; Tue, 07 May 2024 10:38:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715103479; x=1715708279; 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=FY7R4n6Kr6UZBpvxXkdAK0SRBI4lJ/NUXcFNrRCnHj8=; b=coucd9irkDT55bRcW1mpOuXNEo+l8FFvwhGj78ar46LsnPDjmq2zcghG2LB18Qcs1s U+7a7z7/9ZNb54K38RNVhFkMG6JkT2xMLHMN3blgQxaK0kco4wlIB2Djy5kNGJFehewW u9DXPKwqfdhpue2A5TObQV+EWl0QXXQ5P6KxxZIGqG2lUkgty7WuKjOlqUWeS7Nq0heE si7x+Bs+EFdN7Jxl1rqsJidwr+64Wq8r9ak4C/kwU3ocpOyWX653Po7yNyVOEJ71jPm7 V8AOW/m8VJtMOxK15acjekpwog9/Zk5mlHslHOyDDvi9sJt73OYgvjFrJ4g/jAK2oGV0 bnsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715103479; x=1715708279; 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=FY7R4n6Kr6UZBpvxXkdAK0SRBI4lJ/NUXcFNrRCnHj8=; b=JEnGV15moYYNg1DrRpLvE38q0syYa5NLX5yFjBSyg7Ub6i9S13I1384yE20JAKqPgB 5vD7EReOemlbso60/ipzznyDLNLuZa0ecL5gch37kexVEDHMRPQ8TeNuwWrJ/HdslhgI ndsKyABXScEeQnxNqjhsJJNcS0wu2ana3NdBGBjTUpUsZl4++aSWJqDFMmPegD8Mny4l nnl2ojBsKtyBsHIDrCalI2sQE/Ll0sK6ACx1q0fW2+tMWNkqTyPbuAi3JCHf1PPiTP0d F8T7QPU+jJh2zuyLqEIDHptHueKHsU9J3T0T+vE6v/XRLS/9ypSsi9vgh/SUgfjjbKT0 YJwg== X-Forwarded-Encrypted: i=1; AJvYcCXNED3CbagXJs2bKhtFhAAkl+oMM4bcaliaQKGKrOZzV64MjO5oiO8YYQZRuxAsor4vDLBCHMRgcSywpbMVITuWuZCMuZ8EIsDIVLg= X-Gm-Message-State: AOJu0YwAHF8Fsk6knlqJ0HlH8vrVSN0duwJZ+I6kpXoiKs2sIlDnTHBh iHHojBI+KvmFcSbkJps+qPn8BFsO0uuCQPFYFayYxn/Y0jlk9oUbKGkBqQ== X-Google-Smtp-Source: AGHT+IGI1JQO9cCOl/1bPf0gLXu+7lXHPbKxQofk9L7lq0V+J9URWGPHBNyszaeW4jWYUMvuROx5hw== X-Received: by 2002:a05:6a00:62c4:b0:6ea:6f18:887a with SMTP id d2e1a72fcca58-6f49c1fd780mr364685b3a.1.1715103479252; Tue, 07 May 2024 10:37:59 -0700 (PDT) Received: from fabio-Precision-3551.. ([2804:14c:485:4b61:1054:2c2f:fb76:3191]) by smtp.gmail.com with ESMTPSA id bm6-20020a056a00320600b006ed0c9751d0sm9997970pfb.98.2024.05.07.10.37.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 10:37:58 -0700 (PDT) From: Fabio Estevam To: broonie@kernel.org Cc: shengjiu.wang@gmail.com, alsa-devel@alsa-project.org, Fabio Estevam Subject: [PATCH 3/3] ASoC: fsl: fsl_xcvr: Switch to RUNTIME_PM_OPS() Date: Tue, 7 May 2024 14:37:35 -0300 Message-Id: <20240507173735.3456334-3-festevam@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240507173735.3456334-1-festevam@gmail.com> References: <20240507173735.3456334-1-festevam@gmail.com> MIME-Version: 1.0 Message-ID-Hash: 4Z2SAAZLWRXLEVNHQAGCQSYI5ZSVABBJ X-Message-ID-Hash: 4Z2SAAZLWRXLEVNHQAGCQSYI5ZSVABBJ 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 alternative RUNTIME_PM_OPS(). 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 __maybe_unused notation from the runtime suspend/resume() functions. Signed-off-by: Fabio Estevam Acked-by: Shengjiu Wang --- sound/soc/fsl/fsl_xcvr.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sound/soc/fsl/fsl_xcvr.c b/sound/soc/fsl/fsl_xcvr.c index c46f64557a7f..5472ace23d82 100644 --- a/sound/soc/fsl/fsl_xcvr.c +++ b/sound/soc/fsl/fsl_xcvr.c @@ -1364,7 +1364,7 @@ static void fsl_xcvr_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); } -static __maybe_unused int fsl_xcvr_runtime_suspend(struct device *dev) +static int fsl_xcvr_runtime_suspend(struct device *dev) { struct fsl_xcvr *xcvr = dev_get_drvdata(dev); int ret; @@ -1398,7 +1398,7 @@ static __maybe_unused int fsl_xcvr_runtime_suspend(struct device *dev) return 0; } -static __maybe_unused int fsl_xcvr_runtime_resume(struct device *dev) +static int fsl_xcvr_runtime_resume(struct device *dev) { struct fsl_xcvr *xcvr = dev_get_drvdata(dev); int ret; @@ -1483,9 +1483,7 @@ static __maybe_unused int fsl_xcvr_runtime_resume(struct device *dev) } static const struct dev_pm_ops fsl_xcvr_pm_ops = { - SET_RUNTIME_PM_OPS(fsl_xcvr_runtime_suspend, - fsl_xcvr_runtime_resume, - NULL) + RUNTIME_PM_OPS(fsl_xcvr_runtime_suspend, fsl_xcvr_runtime_resume, NULL) SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) }; @@ -1494,7 +1492,7 @@ static struct platform_driver fsl_xcvr_driver = { .probe = fsl_xcvr_probe, .driver = { .name = "fsl,imx8mp-audio-xcvr", - .pm = &fsl_xcvr_pm_ops, + .pm = pm_ptr(&fsl_xcvr_pm_ops), .of_match_table = fsl_xcvr_dt_ids, }, .remove_new = fsl_xcvr_remove,