From patchwork Sat Jul 22 11:50:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 124292 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9010:0:b0:3e4:2afc:c1 with SMTP id l16csp775176vqg; Sat, 22 Jul 2023 05:26:58 -0700 (PDT) X-Google-Smtp-Source: APBJJlH0G5yBYPr3d5oyM87n08UPKxeKUzHx1lNDOn8ryj22B/Hnsr+aFegEmoieVBHHdo71XOuC X-Received: by 2002:a05:6a00:1352:b0:667:85e6:4e9 with SMTP id k18-20020a056a00135200b0066785e604e9mr1977994pfu.24.1690028817708; Sat, 22 Jul 2023 05:26:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690028817; cv=none; d=google.com; s=arc-20160816; b=vvKCcZUEEseEHVzROpbboTyrvLhukRYy5zs3gtXLpJpuwTEcFmC/igQu8j80fV8Rvk zZJfEtSSQLbJCjGo4u8EhH2NUVbwaVrzNHByLyQGweU2DXVeqr8Tp3IWXeDv1fi8w9CL NBG6doq1afHp1hWGsDxsIxQEtVifhr+j9FIXU9PTDDZHQgpp5T6XDObZ8m1SgB5j3jnp 5Z54LyhysDEtRlS839n0CWuPZC4s2rrJN1HsaPVFsx2EO2Tb7JYfKZYsTO1GR/LfsiJT IJZJSX/tr5e+X1WlJfS40LOCvmsZZQRPNYH0uucOspNfxuv56NXcXbnSpD/DF3YIHqlS mhYg== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ei35-20020a056a0080e300b0067e5edde6eesi4691508pfb.302.2023.07.22.05.26.45; Sat, 22 Jul 2023 05:26:57 -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 S229509AbjGVLv1 (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 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: INBOX X-GMAIL-THRID: 1772123657605675634 X-GMAIL-MSGID: 1772123657605675634 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 Reviewed-by: Florian Fainelli --- 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,