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 797283932F9; Mon, 3 Aug 2026 14:46:48 +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=1785768409; cv=none; b=WF3aAy3fTqejwiAag+euaSrx+PEoEqKVb2DI7RpbsA4FM7AheOr/k4sCQGzE5bw0kvbSCldsB6gCxkO2UG2plVa0eHX2MfMlB6m6EUuFvrXg9xpk5mCBNPiNGN4xD68b9W2/6JbP0paZt44QS68uj7KnckAw5Jqn5HsjN2xGqco= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785768409; c=relaxed/simple; bh=qGulrWSdVKRo+oGA8tzD/K6Jrdx7b00h11uK3yAic60=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fYdNa9airxugWTRPj8P6vHjDzTOsf7gFeMa7xoHx9DRBWKiRw/jCkUTkgmiY2viKbYi8r+nuqLM8YfM1KHH/gndpVX3/a8N8jbjLvToxWKucfskbGZlGG24uY6qlHttuJY+5iHunLh0n8jYZbD3x2uALD6KvAS37ncLv4MReqrQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=laqBd3N5; 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="laqBd3N5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 458711F000E9; Mon, 3 Aug 2026 14:46:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1785768407; bh=n6B911MUpU04sAyipsQMTPqrOspQmhlLZqXEs7dHirA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=laqBd3N5vPetI7kroNFcmZRkGkyjUH01GQfE37Im3g8KMDPVkaci1lbpTw05KwFFb IJBoqxW0I7dsmR9Dp+Z+2C8X2/R08zCMRLoGgatpxJWRRUce735BzGvPQt2DEYCwaA 0UrfZYGldzZrjeNRxlrgyXmtz2n9/3jbbyMLY8K0e2SLjPnMhqa3E8BVAjsptEFJIF G8gBqLzaNGQ+yzlspE+mYoQbB9KwxGkr17A9lZJ39xT7/vkHdTnH9CCMr2LGvPOoEz noZanYgGGJlaYvSuLR3wFOH54odVjiDpmwy/PK1S2N1wqzCBFzFkkiwe4AMzhCYJl5 i4q3+IF0KjhtQ== 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 34/39] spi: tegra114: use modern PM macros Date: Mon, 3 Aug 2026 22:19:58 +0800 Message-ID: <20260803142003.12857-35-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-tegra114.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/spi/spi-tegra114.c b/drivers/spi/spi-tegra114.c index aa44ffd09e61..333fb549214e 100644 --- a/drivers/spi/spi-tegra114.c +++ b/drivers/spi/spi-tegra114.c @@ -1450,7 +1450,6 @@ static void tegra_spi_remove(struct platform_device *pdev) tegra_spi_runtime_suspend(&pdev->dev); } -#ifdef CONFIG_PM_SLEEP static int tegra_spi_suspend(struct device *dev) { struct spi_controller *host = dev_get_drvdata(dev); @@ -1476,7 +1475,6 @@ static int tegra_spi_resume(struct device *dev) return spi_controller_resume(host); } -#endif static int tegra_spi_runtime_suspend(struct device *dev) { @@ -1505,14 +1503,14 @@ static int tegra_spi_runtime_resume(struct device *dev) } static const struct dev_pm_ops tegra_spi_pm_ops = { - SET_RUNTIME_PM_OPS(tegra_spi_runtime_suspend, - tegra_spi_runtime_resume, NULL) - SET_SYSTEM_SLEEP_PM_OPS(tegra_spi_suspend, tegra_spi_resume) + RUNTIME_PM_OPS(tegra_spi_runtime_suspend, + tegra_spi_runtime_resume, NULL) + SYSTEM_SLEEP_PM_OPS(tegra_spi_suspend, tegra_spi_resume) }; static struct platform_driver tegra_spi_driver = { .driver = { .name = "spi-tegra114", - .pm = &tegra_spi_pm_ops, + .pm = pm_ptr(&tegra_spi_pm_ops), .of_match_table = tegra_spi_of_match, }, .probe = tegra_spi_probe, -- 2.53.0