Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp1049112rwo; Sat, 22 Jul 2023 05:43:22 -0700 (PDT) X-Google-Smtp-Source: APBJJlEOK233X75WZb8OQXSe51fJ4893tfR7raFYA24xHTM47zF0I4Ln4RACn8v3EQSegsJQ71Pa X-Received: by 2002:a05:6a20:1593:b0:133:dc0a:37e7 with SMTP id h19-20020a056a20159300b00133dc0a37e7mr3118113pzj.13.1690029802128; Sat, 22 Jul 2023 05:43:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690029802; cv=none; d=google.com; s=arc-20160816; b=iMXB4zICthYwzafZyNzoFNK7AVq3tsZNKc382ymxjtFQ0/nvVQRCEvBOAdoRmgBW+m RLYkdxsir0PHkdSnv78KjvTvLcVavQNs8AZWS/JluwzngUc+Ka821LCxOkMpOSv+urpw pnOjNucmzT7DUI+DG4blpWkjUVj3gtChuc5EFfLlAZK/IXc/WOhbsEeBEyTjVwd+GEVD PnGYJAbqOVznC85M62ig8HA51qjCiL2mihoRBX0AWLypawe0nl4Q6X5n19YOBh/EtkBe jozQXhzmdMDxSm9njNAEdbs7ApLzo+fAPFKBTo+V6rg3YKZih9bWDEsxF5JNAQ+6B+gE LLOQ== 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=F1GaE+2/EobGnXaZrbvRPqDqY+YQjb0KaQg4mOcftS0=; fh=Tjb9iw9QVK7xARe4ICwmt18krJBFG354RpvJaBcaYAs=; b=GOEqBDi4+cwIbzEAVBfD/stbPXcsEiO1FSs6SuTh0yMsqePYlrk8sHDN0IZD/JTkSt evsn58P/s7Gb3ffvIk2zZaQHkStK/x28AyeBh0X9U9AzRzT6AaPPytYz8odaU6gGhDj5 cNA4/QYJQA2HYTmz04H+Hr7e+m7sMBzSNd3QVvK8uGaTPixd+Ubc8GKDYOCAELi3HRC1 9aegNAp/syXyKBPF+qXcecJZQda4wCOkBXPRJOIPc2UtWnUiEdqkvOJoOv5F41KnzUkV 8FEtynEdRjdBE6khh+ff8nvDHHisvyoOJl+mZ0g16Tyxhwvyu+7tpS8V6h6WtFcc6jVn WmiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=Nxx985BT; 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 s76-20020a63774f000000b00553b9b18882si4945248pgc.574.2023.07.22.05.43.10; Sat, 22 Jul 2023 05:43:22 -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=Nxx985BT; 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 S230107AbjGVMAK (ORCPT + 99 others); Sat, 22 Jul 2023 08:00:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230330AbjGVMAI (ORCPT ); Sat, 22 Jul 2023 08:00:08 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6794730E3; Sat, 22 Jul 2023 05:00:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1690026805; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=F1GaE+2/EobGnXaZrbvRPqDqY+YQjb0KaQg4mOcftS0=; b=Nxx985BTR1MUipNpPbGPhgeZ0+xVITtFXC6aNIc9OCPYwE45hc8r/mHsJIObHmz74FLnkA jZCf6OXVwU4FpeJ5DyZHbywvWstyZ9PtrLcfZsT74fYEiS53rVOjoj16Icy5GOFEOvX34J p8+cyKkBYYNQbUenTlujAxurASol9XM= From: Paul Cercueil To: Wolfram Sang Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Paul Cercueil , Jonathan Cameron , Peter Rosin Subject: [PATCH v2 22/22] i2c: mux: pca954x: Remove #ifdef guards for PM related functions Date: Sat, 22 Jul 2023 13:53:10 +0200 Message-Id: <20230722115310.27681-6-paul@crapouillou.net> In-Reply-To: <20230722115046.27323-1-paul@crapouillou.net> References: <20230722115046.27323-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,URIBL_BLOCKED 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 macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are 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: Jonathan Cameron Acked-by: Peter Rosin --- drivers/i2c/muxes/i2c-mux-pca954x.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/i2c/muxes/i2c-mux-pca954x.c b/drivers/i2c/muxes/i2c-mux-pca954x.c index 0ccee2ae5720..6965bf4c2348 100644 --- a/drivers/i2c/muxes/i2c-mux-pca954x.c +++ b/drivers/i2c/muxes/i2c-mux-pca954x.c @@ -530,7 +530,6 @@ static void pca954x_remove(struct i2c_client *client) pca954x_cleanup(muxc); } -#ifdef CONFIG_PM_SLEEP static int pca954x_resume(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); @@ -544,14 +543,13 @@ static int pca954x_resume(struct device *dev) return ret; } -#endif -static SIMPLE_DEV_PM_OPS(pca954x_pm, NULL, pca954x_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(pca954x_pm, NULL, pca954x_resume); static struct i2c_driver pca954x_driver = { .driver = { .name = "pca954x", - .pm = &pca954x_pm, + .pm = pm_sleep_ptr(&pca954x_pm), .of_match_table = pca954x_of_match, }, .probe = pca954x_probe, -- 2.40.1