From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 774DC411FA9; Mon, 3 Aug 2026 14:43:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785768213; cv=none; b=JgntCkVFcsovyddVxWjNhNwJxQjjNcIK4cst6IFuLTw7OsWRJZXqWnsFrE10GOM3spU+8eqOoiEoVYN/3bqxPF6LoTMTalEL6fjVqSbrU+rOW/uRQPIqXeATqMwwg+wkyDDap/82QMAJ1HacZKFUIvyeHNs/6Gr2i2FfcseCXSQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785768213; c=relaxed/simple; bh=47hBFYwv1QdhUP4ows3APuspFj39h+bkn8E16rn4EEs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ed46SP6DYOKiti5UBCB8it9nW+6ZVvjrkKXoA23Ky0E6dFmDiOhLRFO4gVQkmwzDMUQz0pRia1LJ+UCDLA2aq49KRcR3h8RuN6Ychi/XpxVn/giGhu3dBPgNPwNY5bpxS5+nfthtLSN+54gmM2xC5hJPGTFVlVCwgIzXrb11Mt8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Q2WPZiZQ; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Q2WPZiZQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1D6771F00A3A; Mon, 3 Aug 2026 14:43:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1785768212; bh=qlIUiMjQYU3CDsVD7Nq654m9H5XXKXU9Fx2wGOali6M=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Q2WPZiZQm+TAUHy80rzSrKMgpSEkbdagezOFxnshMyTOfln15G1ptgLJTN4RoGiAU fS8j9n9fgEVK5x87v+O3HTxsNS7Vo2RaUqBLrvMjvSVIZH0JByv6XSs0dIFM+Nlksj jSNao/hBQDc/sBETw11b5p7tyScC4+TEK8+xI07pnjOaL1ArOgzppdkEEvx0xvjh6T e+O1U1EnMOjFSkEYt99NItGIY+RTcSqHHsW3uqQBqmweHUrvsGWNwOCnXbIVMxxdmL LCP7JN/lNfDWnN9lctSWJHQVdh8lockkPjQ1/c3hXc9GNgDX1BeX7wnrzJkucPTs2W 8dbV0G4jIhF2g== From: Jisheng Zhang To: Mark Brown , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Radu Pirea , Vladimir Moravcevic , Tzu-Hao Wei , Swark Yang , Prasad Bolisetty , Kamal Dasu , William Zhang , Kursad Oney , Jonas Gorski , Anand Gore , Florian Fainelli , =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= , Vladimir Oltean , Frank Li , Ray Jui , Scott Branden , Yinbo Zhu , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Matthias Brugger , AngeloGioacchino Del Regno , Linus Walleij , Heiko Stuebner , Andi Shyti , Tudor Ambarus , Krzysztof Kozlowski , Alim Akhtar , Orson Zhai , Baolin Wang , Chunyan Zhang , Li-hao Kuo , Masahisa Kojima , Jassi Brar , Laxman Dewangan , Thierry Reding , Jonathan Hunter , Sowjanya Komatineni , Michal Simek Cc: bcm-kernel-feedback-list@broadcom.com, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 18/39] spi: meson-spifc: use modern PM macros Date: Mon, 3 Aug 2026 22:19:42 +0800 Message-ID: <20260803142003.12857-19-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260803142003.12857-1-jszhang@kernel.org> References: <20260803142003.12857-1-jszhang@kernel.org> Precedence: bulk X-Mailing-List: linux-spi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Use the modern 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: Jisheng Zhang --- drivers/spi/spi-meson-spifc.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/spi/spi-meson-spifc.c b/drivers/spi/spi-meson-spifc.c index e36aa94bbdae..2ef090dec7ba 100644 --- a/drivers/spi/spi-meson-spifc.c +++ b/drivers/spi/spi-meson-spifc.c @@ -348,7 +348,6 @@ static void meson_spifc_remove(struct platform_device *pdev) pm_runtime_put_noidle(&pdev->dev); } -#ifdef CONFIG_PM_SLEEP static int meson_spifc_suspend(struct device *dev) { struct spi_controller *host = dev_get_drvdata(dev); @@ -385,9 +384,7 @@ static int meson_spifc_resume(struct device *dev) return ret; } -#endif /* CONFIG_PM_SLEEP */ -#ifdef CONFIG_PM static int meson_spifc_runtime_suspend(struct device *dev) { struct spi_controller *host = dev_get_drvdata(dev); @@ -405,13 +402,12 @@ static int meson_spifc_runtime_resume(struct device *dev) return clk_prepare_enable(spifc->clk); } -#endif /* CONFIG_PM */ static const struct dev_pm_ops meson_spifc_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(meson_spifc_suspend, meson_spifc_resume) - SET_RUNTIME_PM_OPS(meson_spifc_runtime_suspend, - meson_spifc_runtime_resume, - NULL) + SYSTEM_SLEEP_PM_OPS(meson_spifc_suspend, meson_spifc_resume) + RUNTIME_PM_OPS(meson_spifc_runtime_suspend, + meson_spifc_runtime_resume, + NULL) }; static const struct of_device_id meson_spifc_dt_match[] = { @@ -427,7 +423,7 @@ static struct platform_driver meson_spifc_driver = { .driver = { .name = "meson-spifc", .of_match_table = of_match_ptr(meson_spifc_dt_match), - .pm = &meson_spifc_pm_ops, + .pm = pm_ptr(&meson_spifc_pm_ops), }, }; -- 2.53.0