未验证 提交 8d699ff9 编写于 作者: V Vincent Whitchurch 提交者: Mark Brown

spi: Split transfers larger than max size

A couple of drivers call spi_split_transfers_maxsize() from their
->prepare_message() callbacks to split transfers which are too big for
them to handle.  Add support in the core to do this based on
->max_transfer_size() to avoid code duplication.
Signed-off-by: NVincent Whitchurch <vincent.whitchurch@axis.com>
Link: https://lore.kernel.org/r/20220927112117.77599-4-vincent.whitchurch@axis.comSigned-off-by: NMark Brown <broonie@kernel.org>
上级 0c17ba73
...@@ -1649,6 +1649,15 @@ static int __spi_pump_transfer_message(struct spi_controller *ctlr, ...@@ -1649,6 +1649,15 @@ static int __spi_pump_transfer_message(struct spi_controller *ctlr,
trace_spi_message_start(msg); trace_spi_message_start(msg);
ret = spi_split_transfers_maxsize(ctlr, msg,
spi_max_transfer_size(msg->spi),
GFP_KERNEL | GFP_DMA);
if (ret) {
msg->status = ret;
spi_finalize_current_message(ctlr);
return ret;
}
if (ctlr->prepare_message) { if (ctlr->prepare_message) {
ret = ctlr->prepare_message(ctlr, msg); ret = ctlr->prepare_message(ctlr, msg);
if (ret) { if (ret) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册