From patchwork Sun May 15 06:41:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Moon X-Patchwork-Id: 12850003 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 ACBA5C433EF for ; Sun, 15 May 2022 06:43:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hE1f2diqp5DRy8YvORsWq9L+6LYteHa1xshlYv5bRwI=; b=Qwugs7Ovf0vTYZ vdIR3ntnGH8+ABzlFdHbt1QgLwZ+Nj2BwniVhBUW4vOuBpm6NmbMbnCAQAAfL6ZBbB/JRWf2G5eku 4K/pKIJdWjyM8abVrlIxGW5iy0ZEV2FNLE6UOXKLKfwpg67hGSQQqqpurN1piTCLnA2WDBh6rqHyO 64nVb169YrzFnshRAN2thbaA2TBbA0CzyrX4iczMJAAVrP2TUWROvZzCZTjHxzfAvj/dnGXwze/uR wHQcljpt6ayweTgiyU07WLY5AcTvFYoqWVrv8bd68FpM/wEad0mGeN99BD0PiGNmnrILjOq/uG+Ew SXSFM90/ibZnyo11QJqg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nq7xx-003K4l-6d; Sun, 15 May 2022 06:42:57 +0000 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nq7xd-003JvB-Nd for linux-arm-kernel@lists.infradead.org; Sun, 15 May 2022 06:42:39 +0000 Received: by mail-pg1-x530.google.com with SMTP id h186so8645259pgc.3 for ; Sat, 14 May 2022 23:42:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jHoiiJnHaNxKGmdGlLTGyX4TUtGSyjY88OutPdITYRg=; b=TXw+i+bQKAdvXrV/lWICdHZCsWSVMpk+d2HPACKk2B6zaN09RH3YvbXXGnyLPeUnAh UwecqpTwVTVeFg0LcSwMIM9hMwYT9mY+90XbciLa/O8d1gHIltBYIXQ4fqzPtP+Tgg/R rwtbAAb6E+Cs+M7ZyGKRz2EYNpE5uwu/vNxoWoFOgm6V2a2AC9Pv3fIIik1tCJt/SLhb 75J58Ohml89s8iHDQ2nkCCjfYhsKiHMei+VN0JZi2dL/U89NeG+9yeT21k3yAiQHQMqd eKouDFbwHvEes25IR2t0xgSUQ77zeAFygXUWxVNvwKuyOnYmxP28jbFBdsFjofxn4tiL xW5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jHoiiJnHaNxKGmdGlLTGyX4TUtGSyjY88OutPdITYRg=; b=Tnjqb20tC/ltYUGf2wZPQpkYWORdrQn8s2KaK1rFHhlX18DBKFMRyyqlVccqPazuPu KVn/C72OjlcO1QSCzPUSEtpilibWBNWPW5sNcKOSkssce8eNmohIY8Lqehxtufu6GKbM 2lk6kDYET5Po7bfyOjwXHOZjNDenua7l9IsxyBPXfRAU/4RVoYGmREc304jv1D4AuPwr cSO7bJtSDqRRv2JwVmfKVnyIpJpzzT7k2Zg+iIENDqKqUz6dyRP5wMasvyd/jbEAjKNe /zJUjYaIv5Lony4pnKWUnb5KAHCx8TtAFArjZXgDYlHV8qWfdHHxfUyCSAHA8GYQvSua ye5g== X-Gm-Message-State: AOAM533hR9c9OsiCrhOPKOU9GnjSh98b2LaAbWsM3LaKeHjMBUGu+ye7 WxMTpbspPr/UyvgpmxDD9eQ= X-Google-Smtp-Source: ABdhPJyVg2kGbF7B3nhQRG6rI1vby0IkE4VgLt98KUxzOmJrd5yLL/6h83HAjfdjuWTewrm7Tsj0vQ== X-Received: by 2002:a05:6a00:98c:b0:50d:f856:53d8 with SMTP id u12-20020a056a00098c00b0050df85653d8mr12020989pfg.49.1652596956582; Sat, 14 May 2022 23:42:36 -0700 (PDT) Received: from alarm.. ([103.51.72.28]) by smtp.gmail.com with ESMTPSA id g24-20020a170902d5d800b0015e8d4eb2e3sm4568687plh.301.2022.05.14.23.42.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 May 2022 23:42:36 -0700 (PDT) From: Anand Moon To: Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski , "Rafael J. Wysocki" , Daniel Lezcano , Amit Kucheria , Zhang Rui , Alim Akhtar , linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Anand Moon Subject: [PATCHv2 5/6] thermal: exynos: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() Date: Sun, 15 May 2022 06:41:22 +0000 Message-Id: <20220515064126.1424-6-linux.amoon@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220515064126.1424-1-linux.amoon@gmail.com> References: <20220515064126.1424-1-linux.amoon@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220514_234237_823002_61FBFA92 X-CRM114-Status: GOOD ( 16.35 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use the newlly introduced pm_sleep_ptr() macro, and mark the functions __maybe_unused. These functions can then be moved outside the CONFIG_PM_SUSPEND block, and the compiler can then process them and detect build failures independently of the config. If unused, they will simply be discarded by the compiler. Cc: Bartlomiej Zolnierkiewicz Signed-off-by: Anand Moon Reviewed-by: Krzysztof Kozlowski --- v1: new patch in this series. --- drivers/thermal/samsung/exynos_tmu.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 0faec0f16db6..f8a527f19383 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -1149,15 +1149,14 @@ static int exynos_tmu_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM_SLEEP -static int exynos_tmu_suspend(struct device *dev) +static int __maybe_unused exynos_tmu_suspend(struct device *dev) { exynos_tmu_control(to_platform_device(dev), false); return 0; } -static int exynos_tmu_resume(struct device *dev) +static int __maybe_unused exynos_tmu_resume(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); @@ -1169,15 +1168,11 @@ static int exynos_tmu_resume(struct device *dev) static SIMPLE_DEV_PM_OPS(exynos_tmu_pm, exynos_tmu_suspend, exynos_tmu_resume); -#define EXYNOS_TMU_PM (&exynos_tmu_pm) -#else -#define EXYNOS_TMU_PM NULL -#endif static struct platform_driver exynos_tmu_driver = { .driver = { .name = "exynos-tmu", - .pm = EXYNOS_TMU_PM, + .pm = pm_sleep_ptr(&exynos_tmu_pm), .of_match_table = exynos_tmu_match, }, .probe = exynos_tmu_probe,