Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp3850234rwb; Sun, 7 Aug 2022 08:40:32 -0700 (PDT) X-Google-Smtp-Source: AA6agR5p44Kd7t+6bX1l0wUP4C7rlHkog5yg3fQl1g7E31QPt1uCI+s+wvdrH8E1ASI7EUYJX3sY X-Received: by 2002:a50:fc89:0:b0:43c:bf1e:165d with SMTP id f9-20020a50fc89000000b0043cbf1e165dmr14319642edq.161.1659886831732; Sun, 07 Aug 2022 08:40:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659886831; cv=none; d=google.com; s=arc-20160816; b=QImzCQH4AAO6ggVrLGu467AzrDYXhP/1FKwJMdgzQsmILxAeuyXLCzLPs4/n3R6Ayf Gcw9yAviSmJBC/CptqVYp23RqKjX+NErpDsGvrsXthlRGWctw0CjI2Bgs8on7asBfhKe HFuQbMZdRR1ILVG0Cd6KV/AKhHfBydzHLOCnfQ2UZhNiszxyR76hVt3tweHp1jz77765 uKJPnTle6SvbRwP/gBFSu0GZ8Fgg0/0PwRDBS2LpOOocU39gO6fNchEBagJxyC75M4T4 qMAQ5U+HENe741aSi5huHaPdaJ3qYp1lUAA0rP5LWnHw65C9zCT8oHxyF8E6bgSN7cGK LRcA== 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=Kpn39KorDFOqH9PIAfsq4TNql93fwh4pKumyo2NZK3k=; b=Tefpb0SPjPr3lMWrOZKG5KQjXXXZ4kkvQQkZeXbaqG+tEwK431elnLcMYX6bdFystX 3nGFsZFBLcGImQK9Ltvb1BXf252lO60mm4ASUOWbiSFiVtqR872y12vmOiyzViJIkCI/ EJWOjKsQiKpNf49ooqDHUSryDKTFdOr9OWTLlCPNYE4IjQKJAeaHz0N7ISm6yLTr+OXv L577MSLPzKhUaHt0ts+S01wglAo397crm5lDHVgfgK6aFvKA6dnNsHtx6OEVz+jf0lbz LEoHYclb/HhtJLqNjTJFeqE7viDjOKjL6eBrAYdSmtZa6e+8MfHprbq/5Ryju5+8NB9Q jaQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=bQa3hvVg; 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 t1-20020a50ab41000000b0043a9ba73187si4237340edc.289.2022.08.07.08.40.06; Sun, 07 Aug 2022 08:40:31 -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=bQa3hvVg; 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 S234491AbiHGOxr (ORCPT + 99 others); Sun, 7 Aug 2022 10:53:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234414AbiHGOxm (ORCPT ); Sun, 7 Aug 2022 10:53:42 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB205A461 for ; Sun, 7 Aug 2022 07:53:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1659883981; 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=Kpn39KorDFOqH9PIAfsq4TNql93fwh4pKumyo2NZK3k=; b=bQa3hvVg2oiDma8ImHf+Rl0gUDoBzKonkQtuZDhzsawMMZDwWchTyglysi6ZzqLodaoiUU hae1zID3mHBIeX2YXhOycUcIPHSPsJEAFslAHEnoYxlc7XzNGe5B562ggPF75kjOmmoOBI 0iHUf7TvE91ucKOirUI2p7f3iNTjzDQ= From: Paul Cercueil To: Lee Jones Cc: linux-kernel@vger.kernel.org, Paul Cercueil Subject: [PATCH 04/28] mfd: max8925-i2c: Remove #ifdef guards for PM related functions Date: Sun, 7 Aug 2022 16:52:23 +0200 Message-Id: <20220807145247.46107-5-paul@crapouillou.net> In-Reply-To: <20220807145247.46107-1-paul@crapouillou.net> References: <20220807145247.46107-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. The advantage is then that these functions are now always compiled independently of any Kconfig option, and thanks to that bugs and regressions are easier to catch. Signed-off-by: Paul Cercueil --- drivers/mfd/max8925-i2c.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/mfd/max8925-i2c.c b/drivers/mfd/max8925-i2c.c index 114e905bef25..649310b5bb3e 100644 --- a/drivers/mfd/max8925-i2c.c +++ b/drivers/mfd/max8925-i2c.c @@ -208,7 +208,6 @@ static int max8925_remove(struct i2c_client *client) return 0; } -#ifdef CONFIG_PM_SLEEP static int max8925_suspend(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); @@ -228,9 +227,9 @@ static int max8925_resume(struct device *dev) disable_irq_wake(chip->core_irq); return 0; } -#endif -static SIMPLE_DEV_PM_OPS(max8925_pm_ops, max8925_suspend, max8925_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(max8925_pm_ops, + max8925_suspend, max8925_resume); static const struct of_device_id max8925_dt_ids[] = { { .compatible = "maxim,max8925", }, @@ -240,7 +239,7 @@ static const struct of_device_id max8925_dt_ids[] = { static struct i2c_driver max8925_driver = { .driver = { .name = "max8925", - .pm = &max8925_pm_ops, + .pm = pm_sleep_ptr(&max8925_pm_ops), .of_match_table = max8925_dt_ids, }, .probe = max8925_probe, -- 2.35.1