Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp1047265rwo; Sat, 22 Jul 2023 05:41:05 -0700 (PDT) X-Google-Smtp-Source: APBJJlEWwwzYe6/wfSkuxgMNqh0kRIM8nsECSPPj1z9iNZAZWmX3/NyZ83LUhepenl6cg8nh1O0b X-Received: by 2002:a05:6a00:1914:b0:668:842b:be60 with SMTP id y20-20020a056a00191400b00668842bbe60mr1719530pfi.29.1690029665129; Sat, 22 Jul 2023 05:41:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690029665; cv=none; d=google.com; s=arc-20160816; b=rHfQSIB5cABGXJ7vclOXafcq6rK0Mu+JhqMjdC8QKp8Yp0UWfsLd6CuXif1Zj7d6La fjOzCzxYDsZSMWR/+WZhSp8ByXU6moBpN6mAFp4k4wRWfzvAU40O8oZaI+xqFcXyEC95 GCMHxKmm6m0wZauRJLr9KX+mEN/bT4CL4lD2thQSY9IHkWP2sw1hcgdZpRCZN/sWn4+N PV0qJr/tT83nTE+t1rFRLEzvLpl64gDsPN5qkRghk97fgCuZ/zIOfj/Q/TvyV9SIZ13a jhYTPgQYmQkz2qvhiYeGUsEPJoh2Mv2YPDEpDvv0LtEHZnfbbNSm8VvK9JyksBH2ixjN 9GOA== 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=INhMr4ZnPfM7KPu4B+DulB6N21MJlD7AD/5uWSd1oOE=; fh=Yg0M6l1jTtyc7gFY81XnkeMuPdtSVwmCb/u/p0Uufno=; b=a92XZqE+8V8l63p4e4JuaTaocj6QXCYQPfrbQWh45FnbrhADZ9WBYTTYzaBmwc/Y3j 57qgIEDLNkHNFQxVFop1aDJFqa294kw5ZUd2rlw8wZsDcqy6uQ+tGM1lnvCXGCofp9rm UMqp/DR1/FTkskuWUBfXAQRJO0elpsoYiQuRTK8FBBvMIKETkFYkfXlmzuwylUp/2Ot3 FN+xfGzRPjUfM8aju2FI/uj4+M9L8yowhu560p/4cVMXY5W9UxiLKPH+EWO7oMu5r/yF S8wnTKwjW3oafxx9rFqh6WJJRnoKP5N7T1XI0TG3R78RH7SzmkhnSUKJOsqrXGt7mozp p6QA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=dhyXVRKP; 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.40.52; Sat, 22 Jul 2023 05:41:05 -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=dhyXVRKP; 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 S230211AbjGVLzy (ORCPT + 99 others); Sat, 22 Jul 2023 07:55:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230208AbjGVLzl (ORCPT ); Sat, 22 Jul 2023 07:55:41 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F6F93ABD; Sat, 22 Jul 2023 04:55:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1690026684; 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=INhMr4ZnPfM7KPu4B+DulB6N21MJlD7AD/5uWSd1oOE=; b=dhyXVRKPuMycbtf07n5qKw8WqCRNjk/2dYzu9+MuY+dIWQKdfW/nrrgIf71i/eyLYSaPZ4 onLN52UTHVsnFBR5ng4UnS8Us6b5fwPoxkyLSgIYIoGfwTseKToKj1xl0YzlYC8vTRCinh O+fmk6fGpXabzAj40H6V9xOMYQ+nVLE= From: Paul Cercueil To: Wolfram Sang Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Paul Cercueil , Jonathan Cameron , Linus Walleij , linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 13/22] i2c: nomadik: Remove #ifdef guards for PM related functions Date: Sat, 22 Jul 2023 13:50:37 +0200 Message-Id: <20230722115046.27323-14-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 Reviewed-by: Linus Walleij --- v2: Rewrapped runtime PM line --- Cc: linux-arm-kernel@lists.infradead.org --- drivers/i2c/busses/i2c-nomadik.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/i2c/busses/i2c-nomadik.c b/drivers/i2c/busses/i2c-nomadik.c index 212f412f1c74..b10574d42b7a 100644 --- a/drivers/i2c/busses/i2c-nomadik.c +++ b/drivers/i2c/busses/i2c-nomadik.c @@ -873,7 +873,6 @@ static irqreturn_t i2c_irq_handler(int irq, void *arg) return IRQ_HANDLED; } -#ifdef CONFIG_PM_SLEEP static int nmk_i2c_suspend_late(struct device *dev) { int ret; @@ -890,9 +889,7 @@ static int nmk_i2c_resume_early(struct device *dev) { return pm_runtime_force_resume(dev); } -#endif -#ifdef CONFIG_PM static int nmk_i2c_runtime_suspend(struct device *dev) { struct amba_device *adev = to_amba_device(dev); @@ -925,13 +922,10 @@ static int nmk_i2c_runtime_resume(struct device *dev) return ret; } -#endif static const struct dev_pm_ops nmk_i2c_pm = { - SET_LATE_SYSTEM_SLEEP_PM_OPS(nmk_i2c_suspend_late, nmk_i2c_resume_early) - SET_RUNTIME_PM_OPS(nmk_i2c_runtime_suspend, - nmk_i2c_runtime_resume, - NULL) + LATE_SYSTEM_SLEEP_PM_OPS(nmk_i2c_suspend_late, nmk_i2c_resume_early) + RUNTIME_PM_OPS(nmk_i2c_runtime_suspend, nmk_i2c_runtime_resume, NULL) }; static unsigned int nmk_i2c_functionality(struct i2c_adapter *adap) @@ -1078,7 +1072,7 @@ static struct amba_driver nmk_i2c_driver = { .drv = { .owner = THIS_MODULE, .name = DRIVER_NAME, - .pm = &nmk_i2c_pm, + .pm = pm_ptr(&nmk_i2c_pm), }, .id_table = nmk_i2c_ids, .probe = nmk_i2c_probe, -- 2.40.1