Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp5053716rwb; Mon, 8 Aug 2022 11:17:04 -0700 (PDT) X-Google-Smtp-Source: AA6agR7ybm+poFIgKkT2o8xtpDX3Z+8QaJ9Iii7+6Q8PejYieRQDjQOpOLmfvih02kOCvVq7D/+J X-Received: by 2002:a05:6402:1e8f:b0:440:eb20:7a05 with SMTP id f15-20020a0564021e8f00b00440eb207a05mr1913491edf.169.1659982623996; Mon, 08 Aug 2022 11:17:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659982623; cv=none; d=google.com; s=arc-20160816; b=rZM8bYhD6HMWTjgdChZvO+5dXyMfiNkdAV0cdJTEzi50ZHnlODSf4Zgxv04eUujSen PKlwSWOQTEA3J4rZ5zCAzhxAY+6PmYTrOOaTLbSg0ckL6HZvZ3Kd5+yNw+gioAmYt0Zs jrmAZdkxKpHSuZWGiiAvOw8Nit+kG0aEusA4OA4NJFvd1E4U/jM6GowBr5Z2WsuKCOnL nPV8Y3QEW6btHpK+dSGZSMP1ZDeS5UY6ufSuLCuOJ9k5gSNszJOqd+8GTM0Om6zx9+Jb KeqsFLPKYpSQYxbAKMsiZ3Vj3esv+Q38FIO1w8/ZPVMaAMzbeo+6CnwpfzdPNLSC6whj /F+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=I/b5mnnm0Rrk2tWrdMsk7U9nz3befFnxCSquAwgZEHQ=; b=Zycrc6ut7iVUTKtWhuLKnOUmzpemoPTWKD2RMDgyWHm8XL96ssSqHpQoUta/C9DPkp Z46n/ED5zOUATRw+4cuGqbB5uRO8Y04ayaVnLF3UztQ+kJYFA7UhX1VJhmF/PDdDAoMK m7AZTJSUOhIXUWS2yK+GVNb0VIgtOLgkRBUPoHCTR0Rgi2V29GWvSedQag4M1Y6aN4rf zSXNDGMOsTdWBSQWnWttc9hxnkrDGDvvo3yY4mjS4y3enZ3GGHnqtCjDAjz87Gryw+BP WwQsumwTGQEfF4mvrq7YmcKnAFCNP2KJYoMxVhm3tWpygHv67YvBUczCoQ9H7D15H4Mp 4LXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=1+vRiiKD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dm15-20020a05640222cf00b0043f2402c310si5997087edb.121.2022.08.08.11.16.36; Mon, 08 Aug 2022 11:17:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=1+vRiiKD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244314AbiHHRov (ORCPT + 99 others); Mon, 8 Aug 2022 13:44:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244212AbiHHRoI (ORCPT ); Mon, 8 Aug 2022 13:44:08 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 997E8B7D0 for ; Mon, 8 Aug 2022 10:43:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1659980504; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=I/b5mnnm0Rrk2tWrdMsk7U9nz3befFnxCSquAwgZEHQ=; b=1+vRiiKDKVDx3qSemL/wdCxkvhMxUvBM+FzgzwYncJXoNAcGKp8l8sQ0sgQkBu6D55By6N KMaE8atGItwWOyyiGJR8K7p2ZelBIUJ9JfcrRwRWnqMtjadetwBvcg47P5E0rBrfhgY9eQ C+/hyoao3dxTeduG8Vd7LVobgIB5/rQ= From: Paul Cercueil To: Lee Jones Cc: linux-kernel@vger.kernel.org, Paul Cercueil Subject: [PATCH v2 15/30] mfd: sm501: Remove #ifdef guards for PM related functions Date: Mon, 8 Aug 2022 19:40:52 +0200 Message-Id: <20220808174107.38676-16-paul@crapouillou.net> In-Reply-To: <20220808174107.38676-1-paul@crapouillou.net> References: <20220808174107.38676-1-paul@crapouillou.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the new pm_sleep_ptr() macro to handle the .suspend/.resume callbacks. This macro allow the suspend and resume functions to be automatically dropped by the compiler when CONFIG_SUSPEND is disabled, without having to use #ifdef guards. This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch. Signed-off-by: Paul Cercueil --- drivers/mfd/sm501.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/mfd/sm501.c b/drivers/mfd/sm501.c index bc0a2c38653e..81e15e646e77 100644 --- a/drivers/mfd/sm501.c +++ b/drivers/mfd/sm501.c @@ -1432,8 +1432,6 @@ static int sm501_plat_probe(struct platform_device *dev) } -#ifdef CONFIG_PM - /* power management support */ static void sm501_set_power(struct sm501_devdata *sm, int on) @@ -1509,10 +1507,6 @@ static int sm501_plat_resume(struct platform_device *pdev) return 0; } -#else -#define sm501_plat_suspend NULL -#define sm501_plat_resume NULL -#endif /* Initialisation data for PCI devices */ @@ -1714,8 +1708,8 @@ static struct platform_driver sm501_plat_driver = { }, .probe = sm501_plat_probe, .remove = sm501_plat_remove, - .suspend = sm501_plat_suspend, - .resume = sm501_plat_resume, + .suspend = pm_sleep_ptr(sm501_plat_suspend), + .resume = pm_sleep_ptr(sm501_plat_resume), }; static int __init sm501_base_init(void) -- 2.35.1