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

Commit 6dffe5a9 authored by Siva Kumar Akkireddi's avatar Siva Kumar Akkireddi
Browse files

msm: mhi_dev: Initialize UCI client channel numbers early



Move the channel number initialization for UCI clients to
uci_init_client_attributes function to ensure the correct channel
number is used for registering callback with the MHI driver.
Correct the index used to retrieve the client handle.

Change-Id: I5987366aed582ac47895a1310e0e0ee0de07c470
Signed-off-by: default avatarSiva Kumar Akkireddi <sivaa@codeaurora.org>
parent d77ce925
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1140,8 +1140,6 @@ static int mhi_register_client(struct uci_client *mhi_client, int index)
{
	init_waitqueue_head(&mhi_client->read_wq);
	init_waitqueue_head(&mhi_client->write_wq);
	mhi_client->out_chan = index * 2 + 1;
	mhi_client->in_chan = index * 2;
	mhi_client->client_index = index;

	mutex_init(&mhi_client->in_chan_lock);
@@ -1301,10 +1299,12 @@ static int uci_init_client_attributes(struct mhi_uci_ctxt_t *uci_ctxt)

	for (i = 0; i < ARRAY_SIZE(uci_chan_attr_table); i += 2) {
		chan_attrib = &uci_chan_attr_table[i];
		index = CHAN_TO_CLIENT(i);
		index = CHAN_TO_CLIENT(chan_attrib->chan_id);
		client = &uci_ctxt->client_handles[index];
		client->out_chan_attr = chan_attrib;
		client->in_chan_attr = ++chan_attrib;
		client->in_chan = index * 2;
		client->out_chan = index * 2 + 1;
		client->in_buf_list =
			kcalloc(chan_attrib->nr_trbs,
			sizeof(struct mhi_dev_iov),