From nobody Sun Nov 10 14:03:34 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1759EB64DC for ; Sat, 22 Jul 2023 11:51:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229682AbjGVLvx (ORCPT ); Sat, 22 Jul 2023 07:51:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229713AbjGVLvu (ORCPT ); Sat, 22 Jul 2023 07:51:50 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F7F53C23; Sat, 22 Jul 2023 04:51:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1690026663; 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=3KIt+a22Ffe/m+Ih0lyp0HmaKGBLRsOsK70rxD3459M=; b=m4H4fG9RL5/SCfWfqeBRF8QkrSRJkXlzqvQ/aPfIm7oNzx38s//YBsCnregYXEUbZ+tRB9 4a7gLfe+9rXbLwxT9oSnOzJDQpEUZHNpUZjRrJs1e7TDG14ElY8aL8yW1lwIVArx3V/ufL AHwEdUlong/255edBxgct+da+Uo9HH8= From: Paul Cercueil To: Wolfram Sang Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Paul Cercueil , Jonathan Cameron , Kamal Dasu , Broadcom internal kernel review list , Florian Fainelli , linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 03/22] i2c: brcmstb: Remove #ifdef guards for PM related functions Date: Sat, 22 Jul 2023 13:50:27 +0200 Message-Id: <20230722115046.27323-4-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: quoted-printable X-Spam: Yes Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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: Florian Fainelli --- Cc: Kamal Dasu Cc: Broadcom internal kernel review list Cc: Florian Fainelli Cc: linux-arm-kernel@lists.infradead.org --- drivers/i2c/busses/i2c-brcmstb.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/i2c/busses/i2c-brcmstb.c b/drivers/i2c/busses/i2c-brcm= stb.c index cf92cbcb8c86..c778bcca95fe 100644 --- a/drivers/i2c/busses/i2c-brcmstb.c +++ b/drivers/i2c/busses/i2c-brcmstb.c @@ -697,7 +697,6 @@ static void brcmstb_i2c_remove(struct platform_device *= pdev) i2c_del_adapter(&dev->adapter); } =20 -#ifdef CONFIG_PM_SLEEP static int brcmstb_i2c_suspend(struct device *dev) { struct brcmstb_i2c_dev *i2c_dev =3D dev_get_drvdata(dev); @@ -715,10 +714,9 @@ static int brcmstb_i2c_resume(struct device *dev) =20 return 0; } -#endif =20 -static SIMPLE_DEV_PM_OPS(brcmstb_i2c_pm, brcmstb_i2c_suspend, - brcmstb_i2c_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(brcmstb_i2c_pm, brcmstb_i2c_suspend, + brcmstb_i2c_resume); =20 static const struct of_device_id brcmstb_i2c_of_match[] =3D { {.compatible =3D "brcm,brcmstb-i2c"}, @@ -732,7 +730,7 @@ static struct platform_driver brcmstb_i2c_driver =3D { .driver =3D { .name =3D "brcmstb-i2c", .of_match_table =3D brcmstb_i2c_of_match, - .pm =3D &brcmstb_i2c_pm, + .pm =3D pm_sleep_ptr(&brcmstb_i2c_pm), }, .probe =3D brcmstb_i2c_probe, .remove_new =3D brcmstb_i2c_remove, --=20 2.40.1