From patchwork Wed Jul 5 20:42:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 116446 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2144118vqx; Wed, 5 Jul 2023 14:22:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5r9V1XIQm7odeSXE52p4wVi25VMmaA9BpbdLL0Z5Kjv6vCc0Y5ZVMGEXd14YUzNHTniqXS X-Received: by 2002:a05:6808:1a:b0:39a:531b:db6c with SMTP id u26-20020a056808001a00b0039a531bdb6cmr16722299oic.47.1688592121717; Wed, 05 Jul 2023 14:22:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688592121; cv=none; d=google.com; s=arc-20160816; b=KBEA/PvjZb1UUR3cmr6GAisQ+jhnoBnJoR8Jc1laOf/9F8jvtZ0oz72Zt7W2VMqW6J JAh4QYfB8VLLuKH5EelguDm6xbJyIQZ+hT36BqDDlVXsIGI8CPEDUUdT7ajD/R8dYAKX medxawvyzQje5bLhrhw/6pQ6mdMbbozMKMy+2oMW2nT30zyPYbwYhJQ45S4hLHxv9YCh LME8xVh4fD220AWwlYB85jdyhuBGiAptbl8PY/vGteraDMjJYjUp2N2IsGZG1F5gmvR3 6uPAlVDWlQSmrvYpXw3rC8T63MEJKbbiEp2myluzkNJSaWBzn9xR0i0pPBLiuqOMrZm0 KdTw== 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=j8kCrjyEghOrc+VVo7DyBJPzL4FspWSOICZBVmt5T64=; fh=RUCzP+KlDM4mmhndu418UH1V+GweW7jNeftOTMrU/S0=; b=WtZg9GW0FnyjMGQ7v/7hKPcjFLOjcJ8XcM8pa9lvE1xx4mZpsNDm5VFYfa6k/+JAn2 KRvLAAAyXXZllyv8UdOXXUuwrDjmH+R/RhnE5TKfDZIdVMj8WCscNiOO8oqx12unV9nj WIeBCDokUbBt4z1cxgf/0ghqvF22secORwLzcmFvkA8gx7Y/4TKRzAS+SKdmHV6WgmsV cy6Bmjj0/iJbUiJYnIHitgrllN3NM8Jk6Qp4q2uAaMwY9A/Ww5284WRA41FbYxBLHqTv 8/Kxu83DZY1V4+c/T9RcjRqFMWz/aibO05gkDaLcRr7A1uhxDXqkpYk2XStlQq7KuKj4 sGBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=vGW4YzOS; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y64-20020a638a43000000b00553823e936fsi37139pgd.135.2023.07.05.14.21.46; Wed, 05 Jul 2023 14:22:01 -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=vGW4YzOS; 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 S233724AbjGEUo2 (ORCPT + 99 others); Wed, 5 Jul 2023 16:44:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231537AbjGEUo1 (ORCPT ); Wed, 5 Jul 2023 16:44:27 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 960F61FDD; Wed, 5 Jul 2023 13:43:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1688589814; 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=j8kCrjyEghOrc+VVo7DyBJPzL4FspWSOICZBVmt5T64=; b=vGW4YzOSKt8Vlu4Lg1AqnlNqf+8ZkOcgjGgK3BeW1QBjQR+PItiv9OqHgOWhNAx6CeFPDS hFXeXJsWBXvXN/CTMMZ8/MnHUhs4fdiioan8RLv25IxyWZF/h4H/0v13gUx0WjHmHM+PHh EiltbvwYOd55Rqmn0Fy0y2nQPZQac+k= From: Paul Cercueil To: Wolfram Sang Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Paul Cercueil , Ray Jui , Scott Branden , Broadcom internal kernel review list , linux-arm-kernel@lists.infradead.org Subject: [PATCH 03/23] i2c: iproc: Remove #ifdef guards for PM related functions Date: Wed, 5 Jul 2023 22:42:54 +0200 Message-Id: <20230705204314.89800-4-paul@crapouillou.net> In-Reply-To: <20230705204314.89800-1-paul@crapouillou.net> References: <20230705204314.89800-1-paul@crapouillou.net> MIME-Version: 1.0 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770617172328470512?= X-GMAIL-MSGID: =?utf-8?q?1770617172328470512?= 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,