Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp1025494rwo; Sat, 22 Jul 2023 05:17:40 -0700 (PDT) X-Google-Smtp-Source: APBJJlFUt90ZQn/LJR0IoQ4gOspNJ6xXFl/K4lK+V5l7QJ7qVgbpkYTXBQI94Z9k0eeIaCMXC4d7 X-Received: by 2002:a17:90a:e213:b0:263:1213:df3b with SMTP id a19-20020a17090ae21300b002631213df3bmr2636569pjz.11.1690028260593; Sat, 22 Jul 2023 05:17:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690028260; cv=none; d=google.com; s=arc-20160816; b=uIo8ScfBkuKulktLHjexSF7BWSYzAc+47dwjwk/f7owmllSohdbpXNh1JwjqP2Hdw5 JR4gIdGkGsWY59rrItMHPUOQVKlRSK81CjS2LUucpMLP8SibwjVR0GxjRtzMX+OTfmFd HZDcTBcDX+oNUHa+QWcC0sah6g1TN4FqC1MewVQQeqRlxRdjn+QnweZt5dtChhaIr4ml motocm5l4W5cAB/1eBR7rqKe2e2pwxu1GBO/8cHXlKfU110EpHvoC2sokQlQfmdDs4Fi HW8u6ZcbGsVcnwK9AVUvbRjS7+vLbh1rFKXvySm+5KpV14AN9dQjc6Mi3aqhWq/aGWaZ tG8w== 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=WOFHNKsK7sTI8VewWj5Rz28bPQ4enj8OUgwSMc6/wig=; fh=EEMFpGTB7fUxI8IrXkP0gWltnfhXnGooviELgZh9yeU=; b=GPD1vyhUYHrPuxQ+O/Qyb9550UEeTlqsoGbJkzOhHSUZL+3ZpJgL54dXPdsovgsvuS VuoncvwQkolT+bZ8ZtUVY+ZAQ8lCWqp40xjgJlnyJfduAaD9Ackr5nZAYvB6VOS7wBQj et2LkS/KPbhrqq6LVjju8nOxGSrBCH86pUSmFP9gZvWJo1pG9YCtMH9EY7h68wJkoq32 9ADR06HqQNojeRo9vPANYl8qaBg6YbUUSPZjE4C1EXYOyu+9FcP8Dhe95LAplUGjc9kn cCFznRPkOCtwrafgFSZqgBGNbDUUZsBZ1208IVcZgIoJ4KOfVKxHOls1RczJlFPlA5hz Ea6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=ulHCEv5l; 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 x11-20020a17090ab00b00b002635100d850si7388672pjq.178.2023.07.22.05.17.27; Sat, 22 Jul 2023 05:17:40 -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=ulHCEv5l; 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 S229865AbjGVLv1 (ORCPT + 99 others); Sat, 22 Jul 2023 07:51:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229566AbjGVLvY (ORCPT ); Sat, 22 Jul 2023 07:51:24 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08B1735AC; Sat, 22 Jul 2023 04:51:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1690026660; 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=WOFHNKsK7sTI8VewWj5Rz28bPQ4enj8OUgwSMc6/wig=; b=ulHCEv5lhHhyUR1dKodWn4Hv2vDkmxP3tl9Pn0xBuxUQ+8utZ4gwARsFqRKalziDeJ6nk4 c2YeO3rWRqOhrGrZQKzdEOpY7pQ/3Trw5t00p3UmeuO4HUwf7FnScaduaFIISQffsFDSll PyWXfUYqEMTTnNN2pYY2kwLiCqYb3yU= From: Paul Cercueil To: Wolfram Sang Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Paul Cercueil , Jonathan Cameron , Ray Jui , Ray Jui , Scott Branden , Broadcom internal kernel review list , linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 02/22] i2c: iproc: Remove #ifdef guards for PM related functions Date: Sat, 22 Jul 2023 13:50:26 +0200 Message-Id: <20230722115046.27323-3-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: Ray Jui --- Cc: Ray Jui Cc: Scott Branden Cc: Broadcom internal kernel review list Cc: linux-arm-kernel@lists.infradead.org --- drivers/i2c/busses/i2c-bcm-iproc.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/i2c/busses/i2c-bcm-iproc.c b/drivers/i2c/busses/i2c-bcm-iproc.c index 2d8342fdc25d..8a3e2208475c 100644 --- a/drivers/i2c/busses/i2c-bcm-iproc.c +++ b/drivers/i2c/busses/i2c-bcm-iproc.c @@ -1125,8 +1125,6 @@ static void bcm_iproc_i2c_remove(struct platform_device *pdev) bcm_iproc_i2c_enable_disable(iproc_i2c, false); } -#ifdef CONFIG_PM_SLEEP - static int bcm_iproc_i2c_suspend(struct device *dev) { struct bcm_iproc_i2c_dev *iproc_i2c = dev_get_drvdata(dev); @@ -1177,12 +1175,6 @@ static const struct dev_pm_ops bcm_iproc_i2c_pm_ops = { .resume_early = &bcm_iproc_i2c_resume }; -#define BCM_IPROC_I2C_PM_OPS (&bcm_iproc_i2c_pm_ops) -#else -#define BCM_IPROC_I2C_PM_OPS NULL -#endif /* CONFIG_PM_SLEEP */ - - static int bcm_iproc_i2c_reg_slave(struct i2c_client *slave) { struct bcm_iproc_i2c_dev *iproc_i2c = i2c_get_adapdata(slave->adapter); @@ -1255,7 +1247,7 @@ static struct platform_driver bcm_iproc_i2c_driver = { .driver = { .name = "bcm-iproc-i2c", .of_match_table = bcm_iproc_i2c_of_match, - .pm = BCM_IPROC_I2C_PM_OPS, + .pm = pm_sleep_ptr(&bcm_iproc_i2c_pm_ops), }, .probe = bcm_iproc_i2c_probe, .remove_new = bcm_iproc_i2c_remove, -- 2.40.1