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 2401934F497; Mon, 3 Aug 2026 14:47:00 +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=1785768421; cv=none; b=EO5l25qe+iC41lLReDf2Pp7MTg5v9DIke0+cjwfhWiGreHnUXLTkZsBRKeWE8CrjPlobrmIZPKiMRd+e14oxhsWHuq0t60qCm8HsseBrDBj+bsk3yb8eW/YroSQ18x22aVFUstKnO7aDKJQ4tWlZbqW4copd8UNZDslUmLnNot8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785768421; c=relaxed/simple; bh=aLet85za+RPwFLDE05XugohfAb4HItJodCGBtANfrEo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LrzHuU5xI+Xff1Tn2C7Usi6XKAo+gGuNhMY09D5vVayS8lZxO87zekIZkKVvnGuyxA+u5Zx259tp94eJKbTPA5TRiXW2aiNRD4JXVv5XrVUtIaDgVrW3MH6VDHr77DjA6wvFscpj2gbOgz2SVjAmfCGmCl8w2algLcSFKLFyb08= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KEI4LUtc; 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="KEI4LUtc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5F8BD1F00A3A; Mon, 3 Aug 2026 14:46:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1785768420; bh=o0L9qc4oumavG1tn+aaIT7DAKheim9V6n6gw3jfXeek=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=KEI4LUtc2sVv6whezpjlSywMZf6MDYdhXqbAUFjjZqKtN1xw5GuseXpUB9XMR+Yro FI/6bwADIRxxY1lgVn/DtyUbL+I8Y/khgEUkRvXKbmqcYEISkxnnKsZslqyjXvOiSJ vfCsyJJFJPgMWQTw1dogL/KwCFadwaUbxCvxeSgkP+dxKpEuGBUyPsQH8KeNHLBpxH dWO1NdsXuUiIGllTEY0k1Lu4dyL0cLAActOzs9kl7CWj3XbqTFMRk2rpm0w/eWg5LA xA6CMQWC019MYAh3GYxLYsyFzGlpF8seKEG99Uyg6VQiry826yZA38rk3vZdBiRbLM QjkJy05h4HsIw== 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 35/39] spi: tegra20-sflash: use modern PM macros Date: Mon, 3 Aug 2026 22:19:59 +0800 Message-ID: <20260803142003.12857-36-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-kernel@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-tegra20-sflash.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/spi/spi-tegra20-sflash.c b/drivers/spi/spi-tegra20-sflash.c index 2caa33f0a52c..2a5e3acea06b 100644 --- a/drivers/spi/spi-tegra20-sflash.c +++ b/drivers/spi/spi-tegra20-sflash.c @@ -533,7 +533,6 @@ static void tegra_sflash_remove(struct platform_device *pdev) tegra_sflash_runtime_suspend(&pdev->dev); } -#ifdef CONFIG_PM_SLEEP static int tegra_sflash_suspend(struct device *dev) { struct spi_controller *host = dev_get_drvdata(dev); @@ -557,7 +556,6 @@ static int tegra_sflash_resume(struct device *dev) return spi_controller_resume(host); } -#endif static int tegra_sflash_runtime_suspend(struct device *dev) { @@ -586,14 +584,14 @@ static int tegra_sflash_runtime_resume(struct device *dev) } static const struct dev_pm_ops slink_pm_ops = { - SET_RUNTIME_PM_OPS(tegra_sflash_runtime_suspend, - tegra_sflash_runtime_resume, NULL) - SET_SYSTEM_SLEEP_PM_OPS(tegra_sflash_suspend, tegra_sflash_resume) + RUNTIME_PM_OPS(tegra_sflash_runtime_suspend, + tegra_sflash_runtime_resume, NULL) + SYSTEM_SLEEP_PM_OPS(tegra_sflash_suspend, tegra_sflash_resume) }; static struct platform_driver tegra_sflash_driver = { .driver = { .name = "spi-tegra-sflash", - .pm = &slink_pm_ops, + .pm = pm_ptr(&slink_pm_ops), .of_match_table = tegra_sflash_of_match, }, .probe = tegra_sflash_probe, -- 2.53.0