Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp1036150rwo; Sat, 22 Jul 2023 05:29:09 -0700 (PDT) X-Google-Smtp-Source: APBJJlHmF3J9Ecv8KbyDDHNnRbDOKPDXN8+x6tPndJKsC5zFFydbRtfTys5HIOe9fySGUHc8pDGx X-Received: by 2002:a17:906:7793:b0:99b:4881:2e53 with SMTP id s19-20020a170906779300b0099b48812e53mr3807480ejm.31.1690028948827; Sat, 22 Jul 2023 05:29:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690028948; cv=none; d=google.com; s=arc-20160816; b=QSZ9tJSaiqMOJrNqqOZf6obeiD9afPloGtoN4JBi0Q8B9uQXh8y+3EXlJZ4jjSpJlQ V4f+MaliGDOUmYaCxwYU5OOblNynXbodtVeY+otUDAetLgvc0EyU1psFnZgtclZGEeTD 6vehkBpz2HqaDxdl8lCeahzvJNhxj1XTKDef/8f/0dkmjEoLTqSXl67HAxqlTshE69K6 SP2DFzUWhGmVLjFGjP1dT3yiPPPGNpduSQk5G3frYvU1bexHvidMIGKuX0mkTKKVN4HL 6dH2wIvNvMkYt0TD/RoVUOCOHT0fA3I2BSsERRYBggKnpceNmbgHB6Ps9trv62KPv69l zxFg== 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=0+PMcQ1JQi88PmWz758Zjy2jsHKFsLNpkh61EVZhzLM=; fh=v+C2F6RTDIzrS9Ux8Pl2bn5O909fj/y+5SCz+NEBsC8=; b=wAPSf3NI7PNRViXp6xlKw3NVJoCJIYkHucqba+qQZijkb6SiHQ9PW+nOsFO/At+f6W E15iIjD6kszLUrHeFARg0TJAaf5sQu57xaOtal20Ddd5BOhQTacEQRL6e2ndHroasJRG sppl+7gJlRHR5nxGvUyR9KwbAKolQPdg/g+9tdxamqGjkv7LL0C8VK8hCSy8Al0RjPnC ufN94mPcO50RlExtCZ89nkPCxWzLGSUc6zphZscKleJmqnx3+/Ss54s+R+eGpPBLXwBb +fBkGLeKnb7FC1gPKnJ6l6EKTtXAEKlkYyczaNwkBR8qq/w8OKVM91/7MnOl0lBocac/ cmkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b="OEGd/g37"; 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 b27-20020a170906195b00b00988d0cd5273si3772332eje.112.2023.07.22.05.28.44; Sat, 22 Jul 2023 05:29:08 -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="OEGd/g37"; 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 S229752AbjGVLyG (ORCPT + 99 others); Sat, 22 Jul 2023 07:54:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229579AbjGVLyF (ORCPT ); Sat, 22 Jul 2023 07:54:05 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BB332708; Sat, 22 Jul 2023 04:53:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1690026671; 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=0+PMcQ1JQi88PmWz758Zjy2jsHKFsLNpkh61EVZhzLM=; b=OEGd/g37kzB68UIkWUPZ3NsiW3jm+b6h83KP6H18iEL/uT8A4JOeA49WYS21ekBzkKV27H IifcaajxhSaOoH9nJOoARPZS7PGmqY1KZkGqpVvCAG8p8cwGvm/SOnQaKZymd8+t7X5aHr 5TusUeZHYznllR5OjktFjPXUXcJIg2I= From: Paul Cercueil To: Wolfram Sang Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Paul Cercueil Subject: [PATCH v2 09/22] i2c: img-scb: Remove #ifdef guards for PM related functions Date: Sat, 22 Jul 2023 13:50:33 +0200 Message-Id: <20230722115046.27323-10-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 --- v2: Unfold _DEFINE_DEV_PM_OPS() macro --- drivers/i2c/busses/i2c-img-scb.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/i2c/busses/i2c-img-scb.c b/drivers/i2c/busses/i2c-img-scb.c index 66ba36949ab5..f9d4bfef511c 100644 --- a/drivers/i2c/busses/i2c-img-scb.c +++ b/drivers/i2c/busses/i2c-img-scb.c @@ -1454,7 +1454,6 @@ static int img_i2c_runtime_resume(struct device *dev) return 0; } -#ifdef CONFIG_PM_SLEEP static int img_i2c_suspend(struct device *dev) { struct img_i2c *i2c = dev_get_drvdata(dev); @@ -1482,13 +1481,10 @@ static int img_i2c_resume(struct device *dev) return 0; } -#endif /* CONFIG_PM_SLEEP */ static const struct dev_pm_ops img_i2c_pm = { - SET_RUNTIME_PM_OPS(img_i2c_runtime_suspend, - img_i2c_runtime_resume, - NULL) - SET_SYSTEM_SLEEP_PM_OPS(img_i2c_suspend, img_i2c_resume) + RUNTIME_PM_OPS(img_i2c_runtime_suspend, img_i2c_runtime_resume, NULL) + SYSTEM_SLEEP_PM_OPS(img_i2c_suspend, img_i2c_resume) }; static const struct of_device_id img_scb_i2c_match[] = { @@ -1501,7 +1497,7 @@ static struct platform_driver img_scb_i2c_driver = { .driver = { .name = "img-i2c-scb", .of_match_table = img_scb_i2c_match, - .pm = &img_i2c_pm, + .pm = pm_ptr(&img_i2c_pm), }, .probe = img_i2c_probe, .remove_new = img_i2c_remove, -- 2.40.1