diff mbox series

[1/5,next] net: vertexcom: mse102x: Use DEFINE_SIMPLE_DEV_PM_OPS

Message ID 20240827191000.3244-2-wahrenst@gmx.net (mailing list archive)
State Accepted
Delegated to: Netdev Maintainers
Headers show
Series net: vertexcom: mse102x: Minor clean-ups | expand

Checks

Context Check Description
netdev/series_format warning Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 16 this patch: 16
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers warning 3 maintainers not CCed: broonie@kernel.org horms@kernel.org u.kleine-koenig@pengutronix.de
netdev/build_clang success Errors and warnings before: 16 this patch: 16
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 16 this patch: 16
netdev/checkpatch warning WARNING: line length of 81 exceeds 80 columns
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-08-29--15-00 (tests: 711)

Commit Message

Stefan Wahren Aug. 27, 2024, 7:09 p.m. UTC
This macro has the advantage over SET_SYSTEM_SLEEP_PM_OPS that we don't
have to care about when the functions are actually used.

Also make use of pm_sleep_ptr() to discard all PM_SLEEP related
stuff if CONFIG_PM_SLEEP isn't enabled.

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
---
 drivers/net/ethernet/vertexcom/mse102x.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

--
2.34.1

Comments

Simon Horman Aug. 28, 2024, 2:39 p.m. UTC | #1
On Tue, Aug 27, 2024 at 09:09:56PM +0200, Stefan Wahren wrote:
> This macro has the advantage over SET_SYSTEM_SLEEP_PM_OPS that we don't
> have to care about when the functions are actually used.
> 
> Also make use of pm_sleep_ptr() to discard all PM_SLEEP related
> stuff if CONFIG_PM_SLEEP isn't enabled.
> 
> Signed-off-by: Stefan Wahren <wahrenst@gmx.net>

Reviewed-by: Simon Horman <horms@kernel.org>

One note, no need to respin because of this.
This series should be targeted at net-next.

	Subject: [PATCH m/n net-next] ...
diff mbox series

Patch

diff --git a/drivers/net/ethernet/vertexcom/mse102x.c b/drivers/net/ethernet/vertexcom/mse102x.c
index edd8b59680e5..0711641fc3c9 100644
--- a/drivers/net/ethernet/vertexcom/mse102x.c
+++ b/drivers/net/ethernet/vertexcom/mse102x.c
@@ -622,8 +622,6 @@  static const struct ethtool_ops mse102x_ethtool_ops = {

 /* driver bus management functions */

-#ifdef CONFIG_PM_SLEEP
-
 static int mse102x_suspend(struct device *dev)
 {
 	struct mse102x_net *mse = dev_get_drvdata(dev);
@@ -649,9 +647,8 @@  static int mse102x_resume(struct device *dev)

 	return 0;
 }
-#endif

-static SIMPLE_DEV_PM_OPS(mse102x_pm_ops, mse102x_suspend, mse102x_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(mse102x_pm_ops, mse102x_suspend, mse102x_resume);

 static int mse102x_probe_spi(struct spi_device *spi)
 {
@@ -761,7 +758,7 @@  static struct spi_driver mse102x_driver = {
 	.driver = {
 		.name = DRV_NAME,
 		.of_match_table = mse102x_match_table,
-		.pm = &mse102x_pm_ops,
+		.pm = pm_sleep_ptr(&mse102x_pm_ops),
 	},
 	.probe = mse102x_probe_spi,
 	.remove = mse102x_remove_spi,