summaryrefslogtreecommitdiff
path: root/drivers/spi/spi.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2019-05-23 16:47:04 +0300
committerMark Brown <broonie@kernel.org>2019-05-23 16:47:04 +0300
commitd9424d6d48c8b6c4e8d9c38e2565bcaf90f4d184 (patch)
treeed32b926f555a59d7633f63a69e890ba190b760e /drivers/spi/spi.c
parent0e896f380b845d3fb889f27eb6026cd494bb3cd8 (diff)
parentf3440d9a0da292dc4998d9393162fcfb996fd671 (diff)
downloadlinux-d9424d6d48c8b6c4e8d9c38e2565bcaf90f4d184.tar.xz
Merge branch 'spi-5.2' into spi-5.3
Diffstat (limited to 'drivers/spi/spi.c')
-rw-r--r--drivers/spi/spi.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index e9bf0c23da50..232ed4bb8fca 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -1229,10 +1229,10 @@ out:
if (msg->status && ctlr->handle_err)
ctlr->handle_err(ctlr, msg);
- spi_finalize_current_message(ctlr);
-
spi_res_release(ctlr, msg);
+ spi_finalize_current_message(ctlr);
+
return ret;
}
@@ -1355,10 +1355,15 @@ static void __spi_pump_messages(struct spi_controller *ctlr, bool in_kthread)
ret = ctlr->prepare_transfer_hardware(ctlr);
if (ret) {
dev_err(&ctlr->dev,
- "failed to prepare transfer hardware\n");
+ "failed to prepare transfer hardware: %d\n",
+ ret);
if (ctlr->auto_runtime_pm)
pm_runtime_put(ctlr->dev.parent);
+
+ ctlr->cur_msg->status = ret;
+ spi_finalize_current_message(ctlr);
+
mutex_unlock(&ctlr->io_mutex);
return;
}