Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp5304495rwi; Sun, 23 Oct 2022 03:54:48 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6d+g4dkMD669T7yka8I9Oosm9ZrVZBEAjxX+51S7W63qp57fHM/n7ky2yDaTDF4vEUhERC X-Received: by 2002:a17:902:ecd2:b0:183:7b19:eb8c with SMTP id a18-20020a170902ecd200b001837b19eb8cmr28320878plh.11.1666522488239; Sun, 23 Oct 2022 03:54:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666522488; cv=none; d=google.com; s=arc-20160816; b=sk6W16a8jzCNZnqoyYfNHfZdYUTCIvbiAP/62RwhmdYPXNUxnjDmsGIOyeypObJOSU Nf7ruUdYY9AgxmYvPZLPGALdYN6t0aWvobEMk0j4IVMsB121rA9U8I+Bg9knvjE+cj8Z D9INq2ct6dUNEDlyJ9Za2zzCdS9Yea5QjpGqG74GDFXCUiFsuYTgdPPQtxJ+6MqZ2xc6 syUhOkH4myHevQruu5VW6ad14hMfJxthu9u5ieb6sxiFqKTRFiX45oZ5X3TEfFwimQDF GaHxDuQVZ9j7Of6iT3cT79E7kmuVru4ajq42UCTU0GyzDp2vk8Swf6iD5UZ3T8OHUtfH 4gsQ== 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=p6dlhZlwLIf/lPMpMtYZKWAT+azhK3anbKwIEZa9zE8=; b=e+1xdyK4VPDD7sasKGXTlrjIWJttilD0HheIYTP1j3ug8WO/ePEWzEYtRjYHid6Bje RfJonE4qUaJdcoZw7uFkxn1XAOHOMTLGffoJp8wEVWQ4GCR8awabiL8idd5mnBeA5BF5 Eb8ZZlgmCLHxO9qu26FjHFqu8kjIFDXhMNTqkhTSq5KFo28lv3uwuYLply8UieKFa7Xw /80DeeflaagjMtoXtAFD5y+zh0IzNdNCEw13awqmlix42YZJVYlyPznL3KDuHjC4/QKQ volxpqNikHtX1QiSM5hNcFF0Kk1a1rPmoSEjt+BMvYo0h1+BZIURxPHasngeXa+j3Nuk BtJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=X3Izna6i; 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 u8-20020a654c08000000b0043c64130f17si31717494pgq.107.2022.10.23.03.54.36; Sun, 23 Oct 2022 03:54:48 -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=X3Izna6i; 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 S230181AbiJWJw7 (ORCPT + 99 others); Sun, 23 Oct 2022 05:52:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230219AbiJWJw5 (ORCPT ); Sun, 23 Oct 2022 05:52:57 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B1175A835 for ; Sun, 23 Oct 2022 02:52:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1666518553; 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=p6dlhZlwLIf/lPMpMtYZKWAT+azhK3anbKwIEZa9zE8=; b=X3Izna6i+PuzhYrjVCdVd4B0BGYCC43zVSGK6WANLlnoavKLLK9b3BvNJVJAr3vHfzYuwt ow2x6ZKsfMqVZrApb7L/6HgRdsraAoKc2vKRQmXCUUXEb7Vmoj1ZwiH7/ZKPsqEucaKn9l OfAvR3dnb3ksURXBgeP+aWhaRJ9c1O4= From: Paul Cercueil To: Lee Jones Cc: linux-kernel@vger.kernel.org, Paul Cercueil Subject: [PATCH v3 17/28] mfd: max77620: Remove #ifdef guards for PM related functions Date: Sun, 23 Oct 2022 10:48:41 +0100 Message-Id: <20221023094852.8035-18-paul@crapouillou.net> In-Reply-To: <20221023094852.8035-1-paul@crapouillou.net> References: <20221023094852.8035-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 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 --- drivers/mfd/max77620.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/mfd/max77620.c b/drivers/mfd/max77620.c index a6661e07035b..42fa9c4b97aa 100644 --- a/drivers/mfd/max77620.c +++ b/drivers/mfd/max77620.c @@ -576,7 +576,6 @@ static int max77620_probe(struct i2c_client *client, return 0; } -#ifdef CONFIG_PM_SLEEP static int max77620_set_fps_period(struct max77620_chip *chip, int fps_id, int time_period) { @@ -683,7 +682,6 @@ static int max77620_i2c_resume(struct device *dev) return 0; } -#endif static const struct i2c_device_id max77620_id[] = { {"max77620", MAX77620}, @@ -692,14 +690,13 @@ static const struct i2c_device_id max77620_id[] = { {}, }; -static const struct dev_pm_ops max77620_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(max77620_i2c_suspend, max77620_i2c_resume) -}; +static DEFINE_SIMPLE_DEV_PM_OPS(max77620_pm_ops, + max77620_i2c_suspend, max77620_i2c_resume); static struct i2c_driver max77620_driver = { .driver = { .name = "max77620", - .pm = &max77620_pm_ops, + .pm = pm_sleep_ptr(&max77620_pm_ops), }, .probe = max77620_probe, .id_table = max77620_id, -- 2.35.1