From patchwork Fri Mar 10 14:02:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 67429 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp941040wrd; Fri, 10 Mar 2023 07:38:23 -0800 (PST) X-Google-Smtp-Source: AK7set/1BmduULh20kYMoys5NPSB6ORkFRPbHcPxU/rBdxe10sMKwHoE5HdZHloY210USchwayDz X-Received: by 2002:a17:90b:1d8c:b0:229:649a:9a05 with SMTP id pf12-20020a17090b1d8c00b00229649a9a05mr27048735pjb.11.1678462703385; Fri, 10 Mar 2023 07:38:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678462703; cv=none; d=google.com; s=arc-20160816; b=djF7ihQlDw7HKr7nyI/DeYUuKSBMGXSAyBHLdOeJByZ94ISQpjk8XeSj3IbnJxvP02 CKJNj3utAyaLJ1S0d6c+OtM0lxWBmAT7i5fZMxxjQvTlR5hn2IkE/SX4Pc7wJ0KDnyZ/ zhm6JL9eO5AtOb+f91qP9gPPbjnOENDK7beQzQjJmFlVka6uLPRb4PBLTMac695EsYcU yP4BPYX3wvGjdl3zi2t06IpxnkYCF7BlgFtWpEMNOpDx6q5tfqJ5GpbA9xEIATJzuk+p a8iA/Iuhc/vldBGeQ4v99UihRwIrDbph7WcgcGHbRCw+H2vm24XIoTojAcnKFYe2rBP7 fDMg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=eljxJJzOe/64gZa+4wamTEZvqRdDDGENgCHOyy0nLg0=; b=fUhhPGjMmxgvdFAaUhdOr1ZqPD8VgBVnZ7qH+YpY0xiFPFiky7R3qpEUR1pqtB3zOE g4UaIPItzEd5+8Wo33Q3fTBsXm9XR/saRTfwrX2t5scorro5fgTtjXRiul73abCgSgCz XwVH55sjwAM1ncQQFSIijVYKzTOxKlYyb1Mv/KhP1J0h2VNUS3b6SI+1P1Wwns+f6k3a TaKRkSS2guQZ+VBrvEM8DE+F33RXp1tbvMRZ4I52oIXF2Zm+oV9M4XPhFeROtSdgs7QM lVynB+1pFvFa5E74rgsDtH8mv9vkrW0gBU8rW6TAXHAO6zR7R9/LCUbXemAsUWvLTbB7 BrfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YmAxEQiF; 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=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t10-20020a17090a4e4a00b002298cb34320si112079pjl.116.2023.03.10.07.38.07; Fri, 10 Mar 2023 07:38:23 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b=YmAxEQiF; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231571AbjCJODY (ORCPT + 99 others); Fri, 10 Mar 2023 09:03:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231611AbjCJODB (ORCPT ); Fri, 10 Mar 2023 09:03:01 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4AF2B11662; Fri, 10 Mar 2023 06:02:57 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 90F8560D29; Fri, 10 Mar 2023 14:02:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4AC3FC433D2; Fri, 10 Mar 2023 14:02:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1678456977; bh=WjooVdQedLpfOgQ4iFgnnbV+ow3gmPYiNVq5gRK7Yro=; h=From:To:Cc:Subject:Date:From; b=YmAxEQiF4Pg54qMNwsu3AdcvJDybkkhW/B1p8+EUuKUWaHLbDHDOUR8IZjTwetYaz ahvKpxeE0zBFYNwBRR0X3OeH+YREh5Bzn4foV6HI8GvyfKzW4gGyqMPiPMhdZaRcLG TMY1KNNHrl+y5etDnoroP8SfQJ6Eol0xFko91DIxR+K3ynW020TH8Bm8OdXhcoJNrs 6WhuXsenjtOCAjRwqi0HTFhSv/SMGqdwScaC0C8zYBdhLZUqRqnHc+ZG6rNl0yPmVq 4OLyQCPQHIg11mcHNNxyx5AOQAYGxLC1kqXmxtdUsyeNHH2dJctu20eSlFlEa12wrR pgt74f7fOQ3iA== From: Arnd Bergmann To: Chester Lin , Linus Walleij , Phu Luu An , Ghennadi Procopciuc , Stefan-Gabriel Mirea , Andrei Stefanescu Cc: Arnd Bergmann , NXP S32 Linux Team , Matthew Nunez , Radu Pirea , Larisa Grigore , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] pinctrl: s32cc: fix !CONFIG_PM_SLEEP build error Date: Fri, 10 Mar 2023 15:02:35 +0100 Message-Id: <20230310140250.359147-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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?1759995707788553460?= X-GMAIL-MSGID: =?utf-8?q?1759995707788553460?= From: Arnd Bergmann The declaration of s32_pinctrl_suspend/s32_pinctrl_resume is hidden in an #ifdef, causing a compilation failure when CONFIG_PM_SLEEP is disabled: drivers/pinctrl/nxp/pinctrl-s32g2.c:754:38: error: 's32_pinctrl_suspend' undeclared here (not in a function); did you mean 's32_pinctrl_probe'? drivers/pinctrl/nxp/pinctrl-s32g2.c:754:9: note: in expansion of macro 'SET_LATE_SYSTEM_SLEEP_PM_OPS' 754 | SET_LATE_SYSTEM_SLEEP_PM_OPS(s32_pinctrl_suspend, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ Remove the bogus #ifdef and __maybe_unused annation on the global functions, and instead use the proper LATE_SYSTEM_SLEEP_PM_OPS() macro to pick set the function pointer. As the function definition is still in the #ifdef block, this leads to the correct code in all configurations. Fixes: fd84aaa8173d ("pinctrl: add NXP S32 SoC family support") Signed-off-by: Arnd Bergmann --- drivers/pinctrl/nxp/pinctrl-s32.h | 6 ++---- drivers/pinctrl/nxp/pinctrl-s32cc.c | 4 ++-- drivers/pinctrl/nxp/pinctrl-s32g2.c | 3 +-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/pinctrl/nxp/pinctrl-s32.h b/drivers/pinctrl/nxp/pinctrl-s32.h index b6d530a62051..545bf16b988d 100644 --- a/drivers/pinctrl/nxp/pinctrl-s32.h +++ b/drivers/pinctrl/nxp/pinctrl-s32.h @@ -68,8 +68,6 @@ struct s32_pinctrl_soc_info { int s32_pinctrl_probe(struct platform_device *pdev, struct s32_pinctrl_soc_info *info); -#ifdef CONFIG_PM_SLEEP -int __maybe_unused s32_pinctrl_resume(struct device *dev); -int __maybe_unused s32_pinctrl_suspend(struct device *dev); -#endif +int s32_pinctrl_resume(struct device *dev); +int s32_pinctrl_suspend(struct device *dev); #endif /* __DRIVERS_PINCTRL_S32_H */ diff --git a/drivers/pinctrl/nxp/pinctrl-s32cc.c b/drivers/pinctrl/nxp/pinctrl-s32cc.c index 2c945523af80..e1da332433a3 100644 --- a/drivers/pinctrl/nxp/pinctrl-s32cc.c +++ b/drivers/pinctrl/nxp/pinctrl-s32cc.c @@ -658,7 +658,7 @@ static bool s32_pinctrl_should_save(struct s32_pinctrl *ipctl, return false; } -int __maybe_unused s32_pinctrl_suspend(struct device *dev) +int s32_pinctrl_suspend(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct s32_pinctrl *ipctl = platform_get_drvdata(pdev); @@ -685,7 +685,7 @@ int __maybe_unused s32_pinctrl_suspend(struct device *dev) return 0; } -int __maybe_unused s32_pinctrl_resume(struct device *dev) +int s32_pinctrl_resume(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct s32_pinctrl *ipctl = platform_get_drvdata(pdev); diff --git a/drivers/pinctrl/nxp/pinctrl-s32g2.c b/drivers/pinctrl/nxp/pinctrl-s32g2.c index 7dd0b4f8904d..5028f4adc389 100644 --- a/drivers/pinctrl/nxp/pinctrl-s32g2.c +++ b/drivers/pinctrl/nxp/pinctrl-s32g2.c @@ -751,8 +751,7 @@ static int s32g_pinctrl_probe(struct platform_device *pdev) } static const struct dev_pm_ops s32g_pinctrl_pm_ops = { - SET_LATE_SYSTEM_SLEEP_PM_OPS(s32_pinctrl_suspend, - s32_pinctrl_resume) + LATE_SYSTEM_SLEEP_PM_OPS(s32_pinctrl_suspend, s32_pinctrl_resume) }; static struct platform_driver s32g_pinctrl_driver = {