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: 13657503 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, }, };