Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp5055037rwb; Mon, 8 Aug 2022 11:18:39 -0700 (PDT) X-Google-Smtp-Source: AA6agR5UfY3GRGcHtS4FWpd54P7ddbtgk8B40NrIoUr80m77Oegf5hiUCjKIPJ3HSHhLzSw804dz X-Received: by 2002:a17:907:7ea2:b0:731:3bb6:d45a with SMTP id qb34-20020a1709077ea200b007313bb6d45amr6925682ejc.524.1659982718871; Mon, 08 Aug 2022 11:18:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659982718; cv=none; d=google.com; s=arc-20160816; b=YueChdkwsZBeRFUdG4lDUYDffVft00jYm8T0TVLOVuAJarNvfUZUsLeXlH5L9tHCdS OlKJ9pCEgAGyXIEkO4caK9JrXPJIyPAKLgIjZQixYXzkTH+Ih+CqdG1GkWrDu+drtba4 BI649VOqItxgfnsPB72F31HdLeOaUJcoPsAm6X6oXuxX6Vikjwrbv3QutS4a5oX68LlX n+mxyur/Mjy5u3LzH3r/1o2anyHK58ZuwfGZ7hALsvBbVpCpCpkKeGTdy5ZAUH2a5Q1j 59ZCVCHYRkATGBe+sRkkwwJDrnlA2cfSGR0JovbOVS/iHl4/OjpsCAMcNOcI5Cqnnioe U5Bw== 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=p2MPm/2Uv2Duo3Mf9+3rBZbS97l/02M7wHI7G738Dso=; b=Ortgz1M7upbBjyAxVd/k0TNtyx9nvBTA2/sCWcWk/Jlqe4TOoX2i+MAyksmO6Ag/Lb Yy47w7RKljfTcnZMj3TJPX0HbQZjcwIB8RKzaMgoSqW7FRQnRPoojlZ+wCfwdBhajNxk 7MMmd3QcaJKVBOAMOMjwZzUhGtlWhVePGiwinXzDErti2XDCsrRYuIhtyNzKqzPv4yRw 5+Fn1rAq7fXDETYU4/2u6EfZ92R8h7YhAtRtTE5TMZG1yYcnaIEpV+x+Gdt2GLCevNib N1WkYDtImcC8C+xuqFyEAR+eHZFi3+ngXaUGlGKfW5v5jlaYI9PsgIaeq3k73Zse8UvP Ajog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=Qbs2Fz06; 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 ci21-20020a170906c35500b0073046f33772si178135ejb.459.2022.08.08.11.18.13; Mon, 08 Aug 2022 11:18:38 -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=Qbs2Fz06; 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 S244180AbiHHRoU (ORCPT + 99 others); Mon, 8 Aug 2022 13:44:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244132AbiHHRns (ORCPT ); Mon, 8 Aug 2022 13:43:48 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD385DEC5; Mon, 8 Aug 2022 10:43:43 -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=p2MPm/2Uv2Duo3Mf9+3rBZbS97l/02M7wHI7G738Dso=; b=Qbs2Fz06wYR4x7XYiDHc2TWJEHBaGWoUPlDPuFkZjdCO+p9oQiXpmuZmxBmU9EJY2GsrZe AoxuWj3VWEyX9k/vmT2z0G4FzCppuhlRfafLBL7pQ0qr/hUXqFq43GSXfN74GTxDzexxzc jWjsW1QF3aySaiWrJhZ/rN/hZTgRDOs= From: Paul Cercueil To: Lee Jones Cc: linux-kernel@vger.kernel.org, Paul Cercueil , Krzysztof Kozlowski , linux-samsung-soc@vger.kernel.org Subject: [PATCH v2 14/30] mfd: sec: Remove #ifdef guards for PM related functions Date: Mon, 8 Aug 2022 19:40:51 +0200 Message-Id: <20220808174107.38676-15-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 DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros to handle the .suspend/.resume callbacks. These macros 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 Reviewed-by: Krzysztof Kozlowski --- Cc: Krzysztof Kozlowski Cc: linux-samsung-soc@vger.kernel.org drivers/mfd/sec-core.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c index 1fb29c45f5cf..a467de2b2fea 100644 --- a/drivers/mfd/sec-core.c +++ b/drivers/mfd/sec-core.c @@ -455,7 +455,6 @@ static void sec_pmic_shutdown(struct i2c_client *i2c) regmap_update_bits(sec_pmic->regmap_pmic, reg, mask, 0); } -#ifdef CONFIG_PM_SLEEP static int sec_pmic_suspend(struct device *dev) { struct i2c_client *i2c = to_i2c_client(dev); @@ -488,14 +487,14 @@ static int sec_pmic_resume(struct device *dev) return 0; } -#endif /* CONFIG_PM_SLEEP */ -static SIMPLE_DEV_PM_OPS(sec_pmic_pm_ops, sec_pmic_suspend, sec_pmic_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(sec_pmic_pm_ops, + sec_pmic_suspend, sec_pmic_resume); static struct i2c_driver sec_pmic_driver = { .driver = { .name = "sec_pmic", - .pm = &sec_pmic_pm_ops, + .pm = pm_sleep_ptr(&sec_pmic_pm_ops), .of_match_table = sec_dt_match, }, .probe = sec_pmic_probe, -- 2.35.1