Skip to content

Commit 0463269

Browse files
dbalutaShawn Guo
authored andcommitted
firmware: imx: Save channel name for further use
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 <daniel.baluta@nxp.com> Reviewed-by: Paul Olaru <paul.olaru@nxp.com> Signed-off-by: Shawn Guo <shawnguo@kernel.org>
1 parent 4d3f4f0 commit 0463269

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/firmware/imx/imx-dsp.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ static int imx_dsp_setup_channels(struct imx_dsp_ipc *dsp_ipc)
7979
return -ENOMEM;
8080

8181
dsp_chan = &dsp_ipc->chans[i];
82+
dsp_chan->name = chan_name;
8283
cl = &dsp_chan->cl;
8384
cl->dev = dev;
8485
cl->tx_block = false;
@@ -97,16 +98,14 @@ static int imx_dsp_setup_channels(struct imx_dsp_ipc *dsp_ipc)
9798
}
9899

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

104103
return 0;
105104
out:
106-
kfree(chan_name);
107105
for (j = 0; j < i; j++) {
108106
dsp_chan = &dsp_ipc->chans[j];
109107
mbox_free_channel(dsp_chan->ch);
108+
kfree(dsp_chan->name);
110109
}
111110

112111
return ret;
@@ -147,6 +146,7 @@ static int imx_dsp_remove(struct platform_device *pdev)
147146
for (i = 0; i < DSP_MU_CHAN_NUM; i++) {
148147
dsp_chan = &dsp_ipc->chans[i];
149148
mbox_free_channel(dsp_chan->ch);
149+
kfree(dsp_chan->name);
150150
}
151151

152152
return 0;

0 commit comments

Comments
 (0)