Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit be6beaa8 authored by Olof Johansson's avatar Olof Johansson
Browse files

Merge tag 'scpi-update-4.12' of...

Merge tag 'scpi-update-4.12' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into next/drivers

SCPI update for v4.12

Single patch to optimise the completion initialisation using reinit_*
API instead of full initialisation on each and every transfer.

* tag 'scpi-update-4.12' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux

:
  firmware: arm_scpi: reinit completion instead of full init_completion()

Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
parents 3ed0b8a7 c511fa3f
Loading
Loading
Loading
Loading
+5 −2
Original line number Original line Diff line number Diff line
@@ -538,7 +538,7 @@ static int scpi_send_message(u8 idx, void *tx_buf, unsigned int tx_len,
	msg->tx_len = tx_len;
	msg->tx_len = tx_len;
	msg->rx_buf = rx_buf;
	msg->rx_buf = rx_buf;
	msg->rx_len = rx_len;
	msg->rx_len = rx_len;
	init_completion(&msg->done);
	reinit_completion(&msg->done);


	ret = mbox_send_message(scpi_chan->chan, msg);
	ret = mbox_send_message(scpi_chan->chan, msg);
	if (ret < 0 || !rx_buf)
	if (ret < 0 || !rx_buf)
@@ -872,8 +872,11 @@ static int scpi_alloc_xfer_list(struct device *dev, struct scpi_chan *ch)
		return -ENOMEM;
		return -ENOMEM;


	ch->xfers = xfers;
	ch->xfers = xfers;
	for (i = 0; i < MAX_SCPI_XFERS; i++, xfers++)
	for (i = 0; i < MAX_SCPI_XFERS; i++, xfers++) {
		init_completion(&xfers->done);
		list_add_tail(&xfers->node, &ch->xfers_list);
		list_add_tail(&xfers->node, &ch->xfers_list);
	}

	return 0;
	return 0;
}
}