Skip to contentSkip to conversation

spi: Do not print a message if spi_controller_{suspend, resume}() fails

PATCH In review Geert Uytterhoeven 5 participants 5 messages Sep 5, 2018

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spi: Do not print a message if spi_controller_{suspend, resume}() fails

spi_controller_{suspend,resume}() already prints an error message on failure, so there is no need to repeat this in individual drivers.

Note: spi_master_{suspend,resume}() is an alias for
spi_controller_{suspend,resume}().

---
 drivers/spi/spi-atmel.c    | 10 ++--------
 drivers/spi/spi-dw.c       |  7 +------
 drivers/spi/spi-fsl-espi.c |  4 +---
 drivers/spi/spi-pl022.c    |  8 ++------
 drivers/spi/spi-pxa2xx.c   |  8 +-------
 5 files changed, 7 insertions(+), 30 deletions(-)
drivers/spi/spi-atmel.c +2 -8
index 3f890d16293411ba..74fddcd3282b4bea 100644
@@ -1767,10 +1767,8 @@ static int atmel_spi_suspend(struct device *dev)
 
 	/* Stop the queue running */
 	ret = spi_master_suspend(master);
-	if (ret) {
-		dev_warn(dev, "cannot suspend master\n");
+	if (ret)
 		return ret;
-	}
 
 	if (!pm_runtime_suspended(dev))
 		atmel_spi_runtime_suspend(dev);
@@ -1799,11 +1797,7 @@ static int atmel_spi_resume(struct device *dev)
 	}
 
 	/* Start the queue running */
-	ret = spi_master_resume(master);
-	if (ret)
-		dev_err(dev, "problem starting queue (%d)\n", ret);
-
-	return ret;
+	return spi_master_resume(master);
 }
 #endif
 
drivers/spi/spi-dw.c +1 -6
index ac2eb89ef7a5a061..1736612ee86be7dd 100644
@@ -572,13 +572,8 @@ EXPORT_SYMBOL_GPL(dw_spi_suspend_host);
 
 int dw_spi_resume_host(struct dw_spi *dws)
 {
-	int ret;
-
 	spi_hw_init(&dws->master->dev, dws);
-	ret = spi_controller_resume(dws->master);
-	if (ret)
-		dev_err(&dws->master->dev, "fail to start queue (%d)\n", ret);
-	return ret;
+	return spi_controller_resume(dws->master);
 }
 EXPORT_SYMBOL_GPL(dw_spi_resume_host);
 
drivers/spi/spi-fsl-espi.c +1 -3
index 1e8ff6256079f134..cf2118dc91f44548 100644
@@ -798,10 +798,8 @@ static int of_fsl_espi_suspend(struct device *dev)
 	int ret;
 
 	ret = spi_master_suspend(master);
-	if (ret) {
-		dev_warn(dev, "cannot suspend master\n");
+	if (ret)
 		return ret;
-	}
 
 	return pm_runtime_force_suspend(dev);
 }
drivers/spi/spi-pl022.c +2 -6
index 1af8c96b940e203d..5f5f197b153c3ec4 100644
@@ -2325,10 +2325,8 @@ static int pl022_suspend(struct device *dev)
 	int ret;
 
 	ret = spi_master_suspend(pl022->master);
-	if (ret) {
-		dev_warn(dev, "cannot suspend master\n");
+	if (ret)
 		return ret;
-	}
 
 	ret = pm_runtime_force_suspend(dev);
 	if (ret) {
@@ -2353,9 +2351,7 @@ static int pl022_resume(struct device *dev)
 
 	/* Start the queue running */
 	ret = spi_master_resume(pl022->master);
-	if (ret)
-		dev_err(dev, "problem starting queue (%d)\n", ret);
-	else
+	if (!ret)
 		dev_dbg(dev, "resumed\n");
 
 	return ret;
drivers/spi/spi-pxa2xx.c +1 -7
index 14f4ea59caff7a23..e3cbc66a7061b42f 100644
@@ -1808,13 +1808,7 @@ static int pxa2xx_spi_resume(struct device *dev)
 		lpss_ssp_setup(drv_data);
 
 	/* Start the queue running */
-	status = spi_controller_resume(drv_data->master);
-	if (status != 0) {
-		dev_err(dev, "problem starting queue (%d)\n", status);
-		return status;
-	}
-
-	return 0;
+	return spi_controller_resume(drv_data->master);
 }
 #endif
 
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 spi: Do not print a message if spi_controller_{suspend,resume}() fails

Quoted 7 lines · Geert Uytterhoeven

spi_controller_{suspend,resume}() already prints an error message on failure, so there is no need to repeat this in individual drivers.

Note: spi_master_{suspend,resume}() is an alias for
spi_controller_{suspend,resume}().

Quoted 121 lines
---
 drivers/spi/spi-atmel.c    | 10 ++--------
 drivers/spi/spi-dw.c       |  7 +------
 drivers/spi/spi-fsl-espi.c |  4 +---
 drivers/spi/spi-pl022.c    |  8 ++------
 drivers/spi/spi-pxa2xx.c   |  8 +-------
 5 files changed, 7 insertions(+), 30 deletions(-)
drivers/spi/spi-atmel.c +2 -8
index 3f890d16293411ba..74fddcd3282b4bea 100644
@@ -1767,10 +1767,8 @@ static int atmel_spi_suspend(struct device *dev)
 
 	/* Stop the queue running */
 	ret = spi_master_suspend(master);
-	if (ret) {
-		dev_warn(dev, "cannot suspend master\n");
+	if (ret)
 		return ret;
-	}
 
 	if (!pm_runtime_suspended(dev))
 		atmel_spi_runtime_suspend(dev);
@@ -1799,11 +1797,7 @@ static int atmel_spi_resume(struct device *dev)
 	}
 
 	/* Start the queue running */
-	ret = spi_master_resume(master);
-	if (ret)
-		dev_err(dev, "problem starting queue (%d)\n", ret);
-
-	return ret;
+	return spi_master_resume(master);
 }
 #endif
 
drivers/spi/spi-dw.c +1 -6
index ac2eb89ef7a5a061..1736612ee86be7dd 100644
@@ -572,13 +572,8 @@ EXPORT_SYMBOL_GPL(dw_spi_suspend_host);
 
 int dw_spi_resume_host(struct dw_spi *dws)
 {
-	int ret;
-
 	spi_hw_init(&dws->master->dev, dws);
-	ret = spi_controller_resume(dws->master);
-	if (ret)
-		dev_err(&dws->master->dev, "fail to start queue (%d)\n", ret);
-	return ret;
+	return spi_controller_resume(dws->master);
 }
 EXPORT_SYMBOL_GPL(dw_spi_resume_host);
 
drivers/spi/spi-fsl-espi.c +1 -3
index 1e8ff6256079f134..cf2118dc91f44548 100644
@@ -798,10 +798,8 @@ static int of_fsl_espi_suspend(struct device *dev)
 	int ret;
 
 	ret = spi_master_suspend(master);
-	if (ret) {
-		dev_warn(dev, "cannot suspend master\n");
+	if (ret)
 		return ret;
-	}
 
 	return pm_runtime_force_suspend(dev);
 }
drivers/spi/spi-pl022.c +2 -6
index 1af8c96b940e203d..5f5f197b153c3ec4 100644
@@ -2325,10 +2325,8 @@ static int pl022_suspend(struct device *dev)
 	int ret;
 
 	ret = spi_master_suspend(pl022->master);
-	if (ret) {
-		dev_warn(dev, "cannot suspend master\n");
+	if (ret)
 		return ret;
-	}
 
 	ret = pm_runtime_force_suspend(dev);
 	if (ret) {
@@ -2353,9 +2351,7 @@ static int pl022_resume(struct device *dev)
 
 	/* Start the queue running */
 	ret = spi_master_resume(pl022->master);
-	if (ret)
-		dev_err(dev, "problem starting queue (%d)\n", ret);
-	else
+	if (!ret)
 		dev_dbg(dev, "resumed\n");
 
 	return ret;
drivers/spi/spi-pxa2xx.c +1 -7
index 14f4ea59caff7a23..e3cbc66a7061b42f 100644
@@ -1808,13 +1808,7 @@ static int pxa2xx_spi_resume(struct device *dev)
 		lpss_ssp_setup(drv_data);
 
 	/* Start the queue running */
-	status = spi_controller_resume(drv_data->master);
-	if (status != 0) {
-		dev_err(dev, "problem starting queue (%d)\n", status);
-		return status;
-	}
-
-	return 0;
+	return spi_controller_resume(drv_data->master);
 }
 #endif
 
Signature · 1 line
2.17.1
Signature · 3 lines
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
maintainer
#2 lore raw

PATCH 1/1 spi: Do not print a message if spi_controller_{suspend,resume}() fails

Quoted 9 lines · Alexandre Belloni
Quoted 7 lines · Geert Uytterhoeven

spi_controller_{suspend,resume}() already prints an error message on failure, so there is no need to repeat this in individual drivers.

Note: spi_master_{suspend,resume}() is an alias for
spi_controller_{suspend,resume}().

Quoted 123 lines
Quoted 122 lines
---
  drivers/spi/spi-atmel.c    | 10 ++--------
  drivers/spi/spi-dw.c       |  7 +------
  drivers/spi/spi-fsl-espi.c |  4 +---
  drivers/spi/spi-pl022.c    |  8 ++------
  drivers/spi/spi-pxa2xx.c   |  8 +-------
  5 files changed, 7 insertions(+), 30 deletions(-)
drivers/spi/spi-atmel.c +2 -8
index 3f890d16293411ba..74fddcd3282b4bea 100644
@@ -1767,10 +1767,8 @@ static int atmel_spi_suspend(struct device *dev)
 
  	/* Stop the queue running */
  	ret = spi_master_suspend(master);
-	if (ret) {
-		dev_warn(dev, "cannot suspend master\n");
+	if (ret)
  		return ret;
-	}
 
  	if (!pm_runtime_suspended(dev))
  		atmel_spi_runtime_suspend(dev);
@@ -1799,11 +1797,7 @@ static int atmel_spi_resume(struct device *dev)
  	}
 
  	/* Start the queue running */
-	ret = spi_master_resume(master);
-	if (ret)
-		dev_err(dev, "problem starting queue (%d)\n", ret);
-
-	return ret;
+	return spi_master_resume(master);
  }
  #endif
 
drivers/spi/spi-dw.c +1 -6
index ac2eb89ef7a5a061..1736612ee86be7dd 100644
@@ -572,13 +572,8 @@ EXPORT_SYMBOL_GPL(dw_spi_suspend_host);
 
  int dw_spi_resume_host(struct dw_spi *dws)
  {
-	int ret;
-
  	spi_hw_init(&dws->master->dev, dws);
-	ret = spi_controller_resume(dws->master);
-	if (ret)
-		dev_err(&dws->master->dev, "fail to start queue (%d)\n", ret);
-	return ret;
+	return spi_controller_resume(dws->master);
  }
  EXPORT_SYMBOL_GPL(dw_spi_resume_host);
 
drivers/spi/spi-fsl-espi.c +1 -3
index 1e8ff6256079f134..cf2118dc91f44548 100644
@@ -798,10 +798,8 @@ static int of_fsl_espi_suspend(struct device *dev)
  	int ret;
 
  	ret = spi_master_suspend(master);
-	if (ret) {
-		dev_warn(dev, "cannot suspend master\n");
+	if (ret)
  		return ret;
-	}
 
  	return pm_runtime_force_suspend(dev);
  }
drivers/spi/spi-pl022.c +2 -6
index 1af8c96b940e203d..5f5f197b153c3ec4 100644
@@ -2325,10 +2325,8 @@ static int pl022_suspend(struct device *dev)
  	int ret;
 
  	ret = spi_master_suspend(pl022->master);
-	if (ret) {
-		dev_warn(dev, "cannot suspend master\n");
+	if (ret)
  		return ret;
-	}
 
  	ret = pm_runtime_force_suspend(dev);
  	if (ret) {
@@ -2353,9 +2351,7 @@ static int pl022_resume(struct device *dev)
 
  	/* Start the queue running */
  	ret = spi_master_resume(pl022->master);
-	if (ret)
-		dev_err(dev, "problem starting queue (%d)\n", ret);
-	else
+	if (!ret)
  		dev_dbg(dev, "resumed\n");
 
  	return ret;
drivers/spi/spi-pxa2xx.c +1 -7
index 14f4ea59caff7a23..e3cbc66a7061b42f 100644
@@ -1808,13 +1808,7 @@ static int pxa2xx_spi_resume(struct device *dev)
  		lpss_ssp_setup(drv_data);
 
  	/* Start the queue running */
-	status = spi_controller_resume(drv_data->master);
-	if (status != 0) {
-		dev_err(dev, "problem starting queue (%d)\n", status);
-		return status;
-	}
-
-	return 0;
+	return spi_controller_resume(drv_data->master);
  }
  #endif
 
Signature · 1 line
2.17.1
Signature · 1 line
Nicolas Ferre
maintainer
#3 lore raw

PATCH 1/1 spi: Do not print a message if spi_controller_{suspend,resume}() fails

In reply to Geert Uytterhoeven
Quoted 7 lines · Geert Uytterhoeven

spi_controller_{suspend,resume}() already prints an error message on failure, so there is no need to repeat this in individual drivers.

Note: spi_master_{suspend,resume}() is an alias for
spi_controller_{suspend,resume}().

For PXA:

Quoted 119 lines
---
  drivers/spi/spi-atmel.c    | 10 ++--------
  drivers/spi/spi-dw.c       |  7 +------
  drivers/spi/spi-fsl-espi.c |  4 +---
  drivers/spi/spi-pl022.c    |  8 ++------
  drivers/spi/spi-pxa2xx.c   |  8 +-------
  5 files changed, 7 insertions(+), 30 deletions(-)
drivers/spi/spi-atmel.c +2 -8
index 3f890d16293411ba..74fddcd3282b4bea 100644
@@ -1767,10 +1767,8 @@ static int atmel_spi_suspend(struct device *dev)
 
  	/* Stop the queue running */
  	ret = spi_master_suspend(master);
-	if (ret) {
-		dev_warn(dev, "cannot suspend master\n");
+	if (ret)
  		return ret;
-	}
 
  	if (!pm_runtime_suspended(dev))
  		atmel_spi_runtime_suspend(dev);
@@ -1799,11 +1797,7 @@ static int atmel_spi_resume(struct device *dev)
  	}
 
  	/* Start the queue running */
-	ret = spi_master_resume(master);
-	if (ret)
-		dev_err(dev, "problem starting queue (%d)\n", ret);
-
-	return ret;
+	return spi_master_resume(master);
  }
  #endif
 
drivers/spi/spi-dw.c +1 -6
index ac2eb89ef7a5a061..1736612ee86be7dd 100644
@@ -572,13 +572,8 @@ EXPORT_SYMBOL_GPL(dw_spi_suspend_host);
 
  int dw_spi_resume_host(struct dw_spi *dws)
  {
-	int ret;
-
  	spi_hw_init(&dws->master->dev, dws);
-	ret = spi_controller_resume(dws->master);
-	if (ret)
-		dev_err(&dws->master->dev, "fail to start queue (%d)\n", ret);
-	return ret;
+	return spi_controller_resume(dws->master);
  }
  EXPORT_SYMBOL_GPL(dw_spi_resume_host);
 
drivers/spi/spi-fsl-espi.c +1 -3
index 1e8ff6256079f134..cf2118dc91f44548 100644
@@ -798,10 +798,8 @@ static int of_fsl_espi_suspend(struct device *dev)
  	int ret;
 
  	ret = spi_master_suspend(master);
-	if (ret) {
-		dev_warn(dev, "cannot suspend master\n");
+	if (ret)
  		return ret;
-	}
 
  	return pm_runtime_force_suspend(dev);
  }
drivers/spi/spi-pl022.c +2 -6
index 1af8c96b940e203d..5f5f197b153c3ec4 100644
@@ -2325,10 +2325,8 @@ static int pl022_suspend(struct device *dev)
  	int ret;
 
  	ret = spi_master_suspend(pl022->master);
-	if (ret) {
-		dev_warn(dev, "cannot suspend master\n");
+	if (ret)
  		return ret;
-	}
 
  	ret = pm_runtime_force_suspend(dev);
  	if (ret) {
@@ -2353,9 +2351,7 @@ static int pl022_resume(struct device *dev)
 
  	/* Start the queue running */
  	ret = spi_master_resume(pl022->master);
-	if (ret)
-		dev_err(dev, "problem starting queue (%d)\n", ret);
-	else
+	if (!ret)
  		dev_dbg(dev, "resumed\n");
 
  	return ret;
drivers/spi/spi-pxa2xx.c +1 -7
index 14f4ea59caff7a23..e3cbc66a7061b42f 100644
@@ -1808,13 +1808,7 @@ static int pxa2xx_spi_resume(struct device *dev)
  		lpss_ssp_setup(drv_data);
 
  	/* Start the queue running */
-	status = spi_controller_resume(drv_data->master);
-	if (status != 0) {
-		dev_err(dev, "problem starting queue (%d)\n", status);
-		return status;
-	}
-
-	return 0;
+	return spi_controller_resume(drv_data->master);
  }
  #endif
 
maintainer
#4 lore raw

Applied "spi: Do not print a message if spi_controller_{suspend, resume}() fails" to the spi tree

In reply to Geert Uytterhoeven

The patch

spi: Do not print a message if spi_controller_{suspend,resume}() fails

has been applied to the spi tree at

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

Quoted 1 line

From 7c5d8a249acadc3e9d5af643c0fe24b608a98269 Mon Sep 17 00:00:00 2001

From: Geert Uytterhoeven <[email protected]>
Date: Wed, 5 Sep 2018 10:51:57 +0200
Subject: [PATCH] spi: Do not print a message if
spi_controller_{suspend,resume}() fails

spi_controller_{suspend,resume}() already prints an error message on failure, so there is no need to repeat this in individual drivers.

Note: spi_master_{suspend,resume}() is an alias for
spi_controller_{suspend,resume}().

---
 drivers/spi/spi-atmel.c    | 10 ++--------
 drivers/spi/spi-dw.c       |  7 +------
 drivers/spi/spi-fsl-espi.c |  4 +---
 drivers/spi/spi-pl022.c    |  8 ++------
 drivers/spi/spi-pxa2xx.c   |  8 +-------
 5 files changed, 7 insertions(+), 30 deletions(-)
drivers/spi/spi-atmel.c +2 -8
index 3f890d162934..74fddcd3282b 100644
@@ -1767,10 +1767,8 @@ static int atmel_spi_suspend(struct device *dev)
 
 	/* Stop the queue running */
 	ret = spi_master_suspend(master);
-	if (ret) {
-		dev_warn(dev, "cannot suspend master\n");
+	if (ret)
 		return ret;
-	}
 
 	if (!pm_runtime_suspended(dev))
 		atmel_spi_runtime_suspend(dev);
@@ -1799,11 +1797,7 @@ static int atmel_spi_resume(struct device *dev)
 	}
 
 	/* Start the queue running */
-	ret = spi_master_resume(master);
-	if (ret)
-		dev_err(dev, "problem starting queue (%d)\n", ret);
-
-	return ret;
+	return spi_master_resume(master);
 }
 #endif
 
drivers/spi/spi-dw.c +1 -6
index ac2eb89ef7a5..1736612ee86b 100644
@@ -572,13 +572,8 @@ EXPORT_SYMBOL_GPL(dw_spi_suspend_host);
 
 int dw_spi_resume_host(struct dw_spi *dws)
 {
-	int ret;
-
 	spi_hw_init(&dws->master->dev, dws);
-	ret = spi_controller_resume(dws->master);
-	if (ret)
-		dev_err(&dws->master->dev, "fail to start queue (%d)\n", ret);
-	return ret;
+	return spi_controller_resume(dws->master);
 }
 EXPORT_SYMBOL_GPL(dw_spi_resume_host);
 
drivers/spi/spi-fsl-espi.c +1 -3
index 1e8ff6256079..cf2118dc91f4 100644
@@ -798,10 +798,8 @@ static int of_fsl_espi_suspend(struct device *dev)
 	int ret;
 
 	ret = spi_master_suspend(master);
-	if (ret) {
-		dev_warn(dev, "cannot suspend master\n");
+	if (ret)
 		return ret;
-	}
 
 	return pm_runtime_force_suspend(dev);
 }
drivers/spi/spi-pl022.c +2 -6
index 1af8c96b940e..5f5f197b153c 100644
@@ -2325,10 +2325,8 @@ static int pl022_suspend(struct device *dev)
 	int ret;
 
 	ret = spi_master_suspend(pl022->master);
-	if (ret) {
-		dev_warn(dev, "cannot suspend master\n");
+	if (ret)
 		return ret;
-	}
 
 	ret = pm_runtime_force_suspend(dev);
 	if (ret) {
@@ -2353,9 +2351,7 @@ static int pl022_resume(struct device *dev)
 
 	/* Start the queue running */
 	ret = spi_master_resume(pl022->master);
-	if (ret)
-		dev_err(dev, "problem starting queue (%d)\n", ret);
-	else
+	if (!ret)
 		dev_dbg(dev, "resumed\n");
 
 	return ret;
drivers/spi/spi-pxa2xx.c +1 -7
index 14f4ea59caff..e3cbc66a7061 100644
@@ -1808,13 +1808,7 @@ static int pxa2xx_spi_resume(struct device *dev)
 		lpss_ssp_setup(drv_data);
 
 	/* Start the queue running */
-	status = spi_controller_resume(drv_data->master);
-	if (status != 0) {
-		dev_err(dev, "problem starting queue (%d)\n", status);
-		return status;
-	}
-
-	return 0;
+	return spi_controller_resume(drv_data->master);
 }
 #endif
 
Signature · 1 line
2.19.0.rc1