Explorar o código

spi: Add missing pm_runtime_put_noidle() after failed get

If pm_runtime_get_sync() fails we should call pm_runtime_put_noidle().
This is probably not a critical fix as we should only hit this when
things are broken elsewhere.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Tony Lindgren %!s(int64=7) %!d(string=hai) anos
pai
achega
7e48e23a1f
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      drivers/spi/spi.c

+ 1 - 0
drivers/spi/spi.c

@@ -1212,6 +1212,7 @@ static void __spi_pump_messages(struct spi_controller *ctlr, bool in_kthread)
 	if (!was_busy && ctlr->auto_runtime_pm) {
 	if (!was_busy && ctlr->auto_runtime_pm) {
 		ret = pm_runtime_get_sync(ctlr->dev.parent);
 		ret = pm_runtime_get_sync(ctlr->dev.parent);
 		if (ret < 0) {
 		if (ret < 0) {
+			pm_runtime_put_noidle(ctlr->dev.parent);
 			dev_err(&ctlr->dev, "Failed to power device: %d\n",
 			dev_err(&ctlr->dev, "Failed to power device: %d\n",
 				ret);
 				ret);
 			mutex_unlock(&ctlr->io_mutex);
 			mutex_unlock(&ctlr->io_mutex);