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 DD6163438A2; Mon, 3 Aug 2026 14:41:45 +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=1785768107; cv=none; b=a7oNpRkM/v/kp5yqnG68keV5lM7LdAkbWkVMLukVbLjHqljWquvyLqTPejghKM4COBH7l0kG8s5Sdbwka/yZ6UAOE4qsZJrIYCMMWjUHEZsLDnzcd3M4umdo9Insi1z1+zZF0pAzSDAdYHDKUPan8t74FEGX1pjXa7ZqIbUZJbw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785768107; c=relaxed/simple; bh=gz3szEOCrC9R8SjBVtMeP8ZWLxODaFtFa8nAVXagjkg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NfBrfPgDIJv0NZBdFCliQwhljSrg/DCaxXIM7lolWtvyG+a/D+R7IrYeNfoZAlor7OsU9ToUB9ypZPKt1en2I64bujX1kTjCAsS2V2FYMYMSah4eUbaEbA34YkFF48A3Bw382xSYkEJ6djl3+bXtYFTOzMqhtpnX8XBCCgp0iJs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=likeEqfA; 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="likeEqfA" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 436FA1F00A3E; Mon, 3 Aug 2026 14:41:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1785768105; bh=ky+A7/Ksh+2lxFezuifq/rx0NQiQ9BbBRodbWBfFtU4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=likeEqfAZs3IraEH3/HWcIP6S2RCdbSJVDku0V5SrfxRGNeKXB3eD8XmagMR2MmM5 JTY35EDCby1ZnwxxwFG4UHNH/LAJa9P8ldTvgBuSJfvV98Qj+XKqjmg25E3QfgdbqQ eSXbuJsBSQanQve0jsz2eVkMu7PcLdy6qe/xomb9LkFj05YR9oJrDhkBV9Fx4/WVd6 WI62WAZYL0h2gAG11XtLizthA0YOZ+a6WzvNUQhTn+VM+4WBV7pnZ/xRXaHmdQQZeY DhYCv1bHPJmVLcvh4H+6cobBOcPSJa9aY22ybzYvABN5JsHShyjzV0Po/8PQazKinb 2+8eBr3Y0d0hQ== 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 09/39] spi: coldfire-qspi: use modern PM macros Date: Mon, 3 Aug 2026 22:19:33 +0800 Message-ID: <20260803142003.12857-10-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-coldfire-qspi.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/spi/spi-coldfire-qspi.c b/drivers/spi/spi-coldfire-qspi.c index 3b175c1da36b..3c8290e08b6d 100644 --- a/drivers/spi/spi-coldfire-qspi.c +++ b/drivers/spi/spi-coldfire-qspi.c @@ -437,7 +437,6 @@ static void mcfqspi_remove(struct platform_device *pdev) mcfqspi_cs_teardown(mcfqspi); } -#ifdef CONFIG_PM_SLEEP static int mcfqspi_suspend(struct device *dev) { struct spi_controller *host = dev_get_drvdata(dev); @@ -462,9 +461,7 @@ static int mcfqspi_resume(struct device *dev) return spi_controller_resume(host); } -#endif -#ifdef CONFIG_PM static int mcfqspi_runtime_suspend(struct device *dev) { struct spi_controller *host = dev_get_drvdata(dev); @@ -484,17 +481,16 @@ static int mcfqspi_runtime_resume(struct device *dev) return 0; } -#endif static const struct dev_pm_ops mcfqspi_pm = { - SET_SYSTEM_SLEEP_PM_OPS(mcfqspi_suspend, mcfqspi_resume) - SET_RUNTIME_PM_OPS(mcfqspi_runtime_suspend, mcfqspi_runtime_resume, - NULL) + SYSTEM_SLEEP_PM_OPS(mcfqspi_suspend, mcfqspi_resume) + RUNTIME_PM_OPS(mcfqspi_runtime_suspend, mcfqspi_runtime_resume, + NULL) }; static struct platform_driver mcfqspi_driver = { .driver.name = DRIVER_NAME, - .driver.pm = &mcfqspi_pm, + .driver.pm = pm_ptr(&mcfqspi_pm), .probe = mcfqspi_probe, .remove = mcfqspi_remove, }; -- 2.53.0