Skip to content

Commit

Permalink
firmware: imx: Save channel name for further use
Browse files Browse the repository at this point in the history
We want to request / free channels on demand later in order
to save power.

For this for each channel we save the name and use it to
reference the channel later.

Signed-off-by: Daniel Baluta <[email protected]>
Reviewed-by: Paul Olaru <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
  • Loading branch information
dbaluta authored and Shawn Guo committed Nov 16, 2020
1 parent 4d3f4f0 commit 0463269
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/firmware/imx/imx-dsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ static int imx_dsp_setup_channels(struct imx_dsp_ipc *dsp_ipc)
return -ENOMEM;

dsp_chan = &dsp_ipc->chans[i];
dsp_chan->name = chan_name;
cl = &dsp_chan->cl;
cl->dev = dev;
cl->tx_block = false;
Expand All @@ -97,16 +98,14 @@ static int imx_dsp_setup_channels(struct imx_dsp_ipc *dsp_ipc)
}

dev_dbg(dev, "request mbox chan %s\n", chan_name);
/* chan_name is not used anymore by framework */
kfree(chan_name);
}

return 0;
out:
kfree(chan_name);
for (j = 0; j < i; j++) {
dsp_chan = &dsp_ipc->chans[j];
mbox_free_channel(dsp_chan->ch);
kfree(dsp_chan->name);
}

return ret;
Expand Down Expand Up @@ -147,6 +146,7 @@ static int imx_dsp_remove(struct platform_device *pdev)
for (i = 0; i < DSP_MU_CHAN_NUM; i++) {
dsp_chan = &dsp_ipc->chans[i];
mbox_free_channel(dsp_chan->ch);
kfree(dsp_chan->name);
}

return 0;
Expand Down

0 comments on commit 0463269

Please sign in to comment.