mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-18 15:51:20 -04:00
ASoC: qcom: Fix confusing cleanup.h
Merge series from Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>: Please, please stop ending cleanup.h patches for very simple code like: foo = kzalloc(); kfree(foo); return; ... *if you do not intend to read cleanup.h*. These changes are making simple code not necessarily simpler. But worse, if you do not read cleanup.h then you introduce actually undesired, error-prone and wrong style of having constructors with redundant values (= NULL). This is actually worse code. If you do not agree in declaration-in-place-of-use (fair!), then do not use cleanup.h. If you want to use cleanup.h, then please read cleanup.h before. This is second mixup I see recently around Qualcomm files.
This commit is contained in:
@@ -617,6 +617,7 @@ static int audioreach_display_port_set_media_format(struct q6apm_graph *graph,
|
||||
int fs_sz = APM_FS_CFG_PSIZE;
|
||||
int size = ic_sz + ep_sz + fs_sz;
|
||||
void *p;
|
||||
|
||||
struct gpr_pkt *pkt __free(kfree) = audioreach_alloc_apm_cmd_pkt(size, APM_CMD_SET_CFG, 0);
|
||||
if (IS_ERR(pkt))
|
||||
return PTR_ERR(pkt);
|
||||
@@ -675,6 +676,7 @@ static int audioreach_codec_dma_set_media_format(struct q6apm_graph *graph,
|
||||
int pm_sz = APM_HW_EP_PMODE_CFG_PSIZE;
|
||||
int size = ic_sz + ep_sz + fs_sz + pm_sz;
|
||||
void *p;
|
||||
|
||||
struct gpr_pkt *pkt __free(kfree) = audioreach_alloc_apm_cmd_pkt(size, APM_CMD_SET_CFG, 0);
|
||||
if (IS_ERR(pkt))
|
||||
return PTR_ERR(pkt);
|
||||
@@ -730,15 +732,15 @@ int audioreach_send_u32_param(struct q6apm_graph *graph, struct audioreach_modul
|
||||
uint32_t param_id, uint32_t param_val)
|
||||
{
|
||||
struct apm_module_param_data *param_data;
|
||||
struct gpr_pkt *pkt __free(kfree) = NULL;
|
||||
uint32_t *param;
|
||||
int payload_size = sizeof(uint32_t) + APM_MODULE_PARAM_DATA_SIZE;
|
||||
void *p = audioreach_alloc_apm_cmd_pkt(payload_size, APM_CMD_SET_CFG, 0);
|
||||
if (IS_ERR(p))
|
||||
void *p;
|
||||
|
||||
struct gpr_pkt *pkt __free(kfree) = audioreach_alloc_apm_cmd_pkt(payload_size, APM_CMD_SET_CFG, 0);
|
||||
if (IS_ERR(pkt))
|
||||
return -ENOMEM;
|
||||
|
||||
pkt = p;
|
||||
p = p + GPR_HDR_SIZE + APM_CMD_HDR_SIZE;
|
||||
p = (void *)pkt + GPR_HDR_SIZE + APM_CMD_HDR_SIZE;
|
||||
|
||||
param_data = p;
|
||||
param_data->module_instance_id = module->instance_id;
|
||||
@@ -788,6 +790,7 @@ static int audioreach_set_module_config(struct q6apm_graph *graph,
|
||||
{
|
||||
int size = le32_to_cpu(module->data->size);
|
||||
void *p;
|
||||
|
||||
struct gpr_pkt *pkt __free(kfree) = audioreach_alloc_apm_cmd_pkt(size, APM_CMD_SET_CFG, 0);
|
||||
if (IS_ERR(pkt))
|
||||
return PTR_ERR(pkt);
|
||||
@@ -810,6 +813,7 @@ static int audioreach_mfc_set_media_format(struct q6apm_graph *graph,
|
||||
APM_MODULE_PARAM_DATA_SIZE;
|
||||
int i;
|
||||
void *p;
|
||||
|
||||
struct gpr_pkt *pkt __free(kfree) = audioreach_alloc_apm_cmd_pkt(payload_size, APM_CMD_SET_CFG, 0);
|
||||
if (IS_ERR(pkt))
|
||||
return PTR_ERR(pkt);
|
||||
@@ -922,13 +926,13 @@ int audioreach_compr_set_param(struct q6apm_graph *graph, struct audioreach_modu
|
||||
void *p;
|
||||
int iid = q6apm_graph_get_rx_shmem_module_iid(graph);
|
||||
int payload_size = sizeof(struct apm_sh_module_media_fmt_cmd);
|
||||
|
||||
struct gpr_pkt *pkt __free(kfree) = audioreach_alloc_cmd_pkt(payload_size,
|
||||
DATA_CMD_WR_SH_MEM_EP_MEDIA_FORMAT,
|
||||
0, graph->port->id, iid);
|
||||
if (IS_ERR(pkt))
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
p = (void *)pkt + GPR_HDR_SIZE;
|
||||
header = p;
|
||||
rc = audioreach_set_compr_media_format(header, p, mcfg);
|
||||
@@ -952,6 +956,7 @@ static int audioreach_i2s_set_media_format(struct q6apm_graph *graph,
|
||||
int fs_sz = APM_FS_CFG_PSIZE;
|
||||
int size = ic_sz + ep_sz + fs_sz;
|
||||
void *p;
|
||||
|
||||
struct gpr_pkt *pkt __free(kfree) = audioreach_alloc_apm_cmd_pkt(size, APM_CMD_SET_CFG, 0);
|
||||
if (IS_ERR(pkt))
|
||||
return PTR_ERR(pkt);
|
||||
@@ -1013,6 +1018,7 @@ static int audioreach_logging_set_media_format(struct q6apm_graph *graph,
|
||||
struct data_logging_config *cfg;
|
||||
int size = sizeof(*cfg) + APM_MODULE_PARAM_DATA_SIZE;
|
||||
void *p;
|
||||
|
||||
struct gpr_pkt *pkt __free(kfree) = audioreach_alloc_apm_cmd_pkt(size, APM_CMD_SET_CFG, 0);
|
||||
if (IS_ERR(pkt))
|
||||
return PTR_ERR(pkt);
|
||||
@@ -1043,7 +1049,6 @@ static int audioreach_pcm_set_media_format(struct q6apm_graph *graph,
|
||||
struct apm_pcm_module_media_fmt_cmd *cfg;
|
||||
struct apm_module_param_data *param_data;
|
||||
int payload_size;
|
||||
struct gpr_pkt *pkt __free(kfree) = NULL;
|
||||
|
||||
if (num_channels > 4) {
|
||||
dev_err(graph->dev, "Error: Invalid channels (%d)!\n", num_channels);
|
||||
@@ -1052,7 +1057,8 @@ static int audioreach_pcm_set_media_format(struct q6apm_graph *graph,
|
||||
|
||||
payload_size = APM_PCM_MODULE_FMT_CMD_PSIZE(num_channels);
|
||||
|
||||
pkt = audioreach_alloc_apm_cmd_pkt(payload_size, APM_CMD_SET_CFG, 0);
|
||||
struct gpr_pkt *pkt __free(kfree) =
|
||||
audioreach_alloc_apm_cmd_pkt(payload_size, APM_CMD_SET_CFG, 0);
|
||||
if (IS_ERR(pkt))
|
||||
return PTR_ERR(pkt);
|
||||
|
||||
@@ -1090,7 +1096,6 @@ static int audioreach_shmem_set_media_format(struct q6apm_graph *graph,
|
||||
struct payload_media_fmt_pcm *cfg;
|
||||
struct media_format *header;
|
||||
int rc, payload_size;
|
||||
struct gpr_pkt *pkt __free(kfree) = NULL;
|
||||
void *p;
|
||||
|
||||
if (num_channels > 4) {
|
||||
@@ -1100,8 +1105,9 @@ static int audioreach_shmem_set_media_format(struct q6apm_graph *graph,
|
||||
|
||||
payload_size = APM_SHMEM_FMT_CFG_PSIZE(num_channels) + APM_MODULE_PARAM_DATA_SIZE;
|
||||
|
||||
pkt = audioreach_alloc_cmd_pkt(payload_size, APM_CMD_SET_CFG, 0,
|
||||
graph->port->id, module->instance_id);
|
||||
struct gpr_pkt *pkt __free(kfree) =
|
||||
audioreach_alloc_cmd_pkt(payload_size, APM_CMD_SET_CFG, 0,
|
||||
graph->port->id, module->instance_id);
|
||||
if (IS_ERR(pkt))
|
||||
return PTR_ERR(pkt);
|
||||
|
||||
|
||||
@@ -331,6 +331,7 @@ static int q6adm_device_open(struct q6adm *adm, struct q6copp *copp,
|
||||
int afe_port = q6afe_get_port_id(port_id);
|
||||
struct apr_pkt *pkt;
|
||||
int ret, pkt_size = APR_HDR_SIZE + sizeof(*open);
|
||||
|
||||
void *p __free(kfree) = kzalloc(pkt_size, GFP_KERNEL);
|
||||
if (!p)
|
||||
return -ENOMEM;
|
||||
@@ -466,6 +467,7 @@ int q6adm_matrix_map(struct device *dev, int path,
|
||||
struct q6copp *copp;
|
||||
int pkt_size = (APR_HDR_SIZE + sizeof(*route) + sizeof(*node) +
|
||||
(sizeof(uint32_t) * payload_map.num_copps));
|
||||
|
||||
void *matrix_map __free(kfree) = kzalloc(pkt_size, GFP_KERNEL);
|
||||
if (!matrix_map)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -1075,6 +1075,7 @@ static int q6afe_set_param(struct q6afe *afe, struct q6afe_port *port,
|
||||
struct apr_pkt *pkt;
|
||||
int ret, pkt_size = APR_HDR_SIZE + sizeof(*param) + sizeof(*pdata) + psize;
|
||||
void *pl;
|
||||
|
||||
void *p __free(kfree) = kzalloc(pkt_size, GFP_KERNEL);
|
||||
if (!p)
|
||||
return -ENOMEM;
|
||||
@@ -1126,6 +1127,7 @@ static int q6afe_port_set_param_v2(struct q6afe_port *port, void *data,
|
||||
u16 port_id = port->id;
|
||||
int ret, pkt_size = APR_HDR_SIZE + sizeof(*param) + sizeof(*pdata) + psize;
|
||||
void *pl;
|
||||
|
||||
void *p __free(kfree) = kzalloc(pkt_size, GFP_KERNEL);
|
||||
if (!p)
|
||||
return -ENOMEM;
|
||||
@@ -1275,7 +1277,6 @@ int q6afe_port_stop(struct q6afe_port *port)
|
||||
int port_id = port->id;
|
||||
int ret = 0;
|
||||
int index, pkt_size;
|
||||
void *p __free(kfree) = NULL;
|
||||
|
||||
index = port->token;
|
||||
if (index < 0 || index >= AFE_PORT_MAX) {
|
||||
@@ -1284,7 +1285,7 @@ int q6afe_port_stop(struct q6afe_port *port)
|
||||
}
|
||||
|
||||
pkt_size = APR_HDR_SIZE + sizeof(*stop);
|
||||
p = kzalloc(pkt_size, GFP_KERNEL);
|
||||
void *p __free(kfree) = kzalloc(pkt_size, GFP_KERNEL);
|
||||
if (!p)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -1665,7 +1666,6 @@ int q6afe_port_start(struct q6afe_port *port)
|
||||
int ret, param_id = port->cfg_type;
|
||||
struct apr_pkt *pkt;
|
||||
int pkt_size;
|
||||
void *p __free(kfree) = NULL;
|
||||
|
||||
ret = q6afe_port_set_param_v2(port, &port->port_cfg, param_id,
|
||||
AFE_MODULE_AUDIO_DEV_INTERFACE,
|
||||
@@ -1688,7 +1688,7 @@ int q6afe_port_start(struct q6afe_port *port)
|
||||
}
|
||||
|
||||
pkt_size = APR_HDR_SIZE + sizeof(*start);
|
||||
p = kzalloc(pkt_size, GFP_KERNEL);
|
||||
void *p __free(kfree) = kzalloc(pkt_size, GFP_KERNEL);
|
||||
if (!p)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -1832,6 +1832,7 @@ int q6afe_unvote_lpass_core_hw(struct device *dev, uint32_t hw_block_id,
|
||||
struct apr_pkt *pkt;
|
||||
int ret = 0;
|
||||
int pkt_size = APR_HDR_SIZE + sizeof(*vote_cfg);
|
||||
|
||||
void *p __free(kfree) = kzalloc(pkt_size, GFP_KERNEL);
|
||||
if (!p)
|
||||
return -ENOMEM;
|
||||
@@ -1866,6 +1867,7 @@ int q6afe_vote_lpass_core_hw(struct device *dev, uint32_t hw_block_id,
|
||||
struct apr_pkt *pkt;
|
||||
int ret = 0;
|
||||
int pkt_size = APR_HDR_SIZE + sizeof(*vote_cfg);
|
||||
|
||||
void *p __free(kfree) = kzalloc(pkt_size, GFP_KERNEL);
|
||||
if (!p)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -100,6 +100,7 @@ static int audioreach_graph_mgmt_cmd(struct audioreach_graph *graph, uint32_t op
|
||||
struct audioreach_sub_graph *sg;
|
||||
struct q6apm *apm = graph->apm;
|
||||
int i = 0, payload_size = APM_GRAPH_MGMT_PSIZE(mgmt_cmd, num_sub_graphs);
|
||||
|
||||
struct gpr_pkt *pkt __free(kfree) = audioreach_alloc_apm_cmd_pkt(payload_size, opcode, 0);
|
||||
if (IS_ERR(pkt))
|
||||
return PTR_ERR(pkt);
|
||||
@@ -259,7 +260,6 @@ int q6apm_unmap_memory_regions(struct q6apm_graph *graph, unsigned int dir)
|
||||
{
|
||||
struct apm_cmd_shared_mem_unmap_regions *cmd;
|
||||
struct audioreach_graph_data *data;
|
||||
struct gpr_pkt *pkt __free(kfree) = NULL;
|
||||
int rc;
|
||||
|
||||
if (dir == SNDRV_PCM_STREAM_PLAYBACK)
|
||||
@@ -270,8 +270,9 @@ int q6apm_unmap_memory_regions(struct q6apm_graph *graph, unsigned int dir)
|
||||
if (!data->mem_map_handle)
|
||||
return 0;
|
||||
|
||||
pkt = audioreach_alloc_apm_pkt(sizeof(*cmd), APM_CMD_SHARED_MEM_UNMAP_REGIONS, dir,
|
||||
graph->port->id);
|
||||
struct gpr_pkt *pkt __free(kfree) =
|
||||
audioreach_alloc_apm_pkt(sizeof(*cmd), APM_CMD_SHARED_MEM_UNMAP_REGIONS,
|
||||
dir, graph->port->id);
|
||||
if (IS_ERR(pkt))
|
||||
return PTR_ERR(pkt);
|
||||
|
||||
@@ -409,6 +410,7 @@ int q6apm_write_async(struct q6apm_graph *graph, uint32_t len, uint32_t msw_ts,
|
||||
struct apm_data_cmd_wr_sh_mem_ep_data_buffer_v2 *write_buffer;
|
||||
struct audio_buffer *ab;
|
||||
int iid = q6apm_graph_get_rx_shmem_module_iid(graph);
|
||||
|
||||
struct gpr_pkt *pkt __free(kfree) = audioreach_alloc_pkt(sizeof(*write_buffer),
|
||||
DATA_CMD_WR_SH_MEM_EP_DATA_BUFFER_V2,
|
||||
graph->rx_data.dsp_buf | (len << APM_WRITE_TOKEN_LEN_SHIFT),
|
||||
@@ -446,6 +448,7 @@ int q6apm_read(struct q6apm_graph *graph)
|
||||
struct audioreach_graph_data *port;
|
||||
struct audio_buffer *ab;
|
||||
int iid = q6apm_graph_get_tx_shmem_module_iid(graph);
|
||||
|
||||
struct gpr_pkt *pkt __free(kfree) = audioreach_alloc_pkt(sizeof(*read_buffer),
|
||||
DATA_CMD_RD_SH_MEM_EP_DATA_BUFFER_V2,
|
||||
graph->tx_data.dsp_buf, graph->port->id, iid);
|
||||
|
||||
@@ -335,7 +335,6 @@ static int __q6asm_memory_unmap(struct audio_client *ac,
|
||||
struct q6asm *a = dev_get_drvdata(ac->dev->parent);
|
||||
struct apr_pkt *pkt;
|
||||
int rc, pkt_size;
|
||||
void *p __free(kfree) = NULL;
|
||||
|
||||
if (ac->port[dir].mem_map_handle == 0) {
|
||||
dev_err(ac->dev, "invalid mem handle\n");
|
||||
@@ -343,7 +342,7 @@ static int __q6asm_memory_unmap(struct audio_client *ac,
|
||||
}
|
||||
|
||||
pkt_size = APR_HDR_SIZE + sizeof(*mem_unmap);
|
||||
p = kzalloc(pkt_size, GFP_KERNEL);
|
||||
void *p __free(kfree) = kzalloc(pkt_size, GFP_KERNEL);
|
||||
if (!p)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -428,7 +427,6 @@ static int __q6asm_memory_map_regions(struct audio_client *ac, int dir,
|
||||
struct audio_port_data *port = NULL;
|
||||
struct audio_buffer *ab = NULL;
|
||||
struct apr_pkt *pkt;
|
||||
void *p __free(kfree) = NULL;
|
||||
unsigned long flags;
|
||||
uint32_t num_regions, buf_sz;
|
||||
int i, pkt_size;
|
||||
@@ -447,7 +445,7 @@ static int __q6asm_memory_map_regions(struct audio_client *ac, int dir,
|
||||
pkt_size = APR_HDR_SIZE + sizeof(*cmd) +
|
||||
(sizeof(*mregions) * num_regions);
|
||||
|
||||
p = kzalloc(pkt_size, GFP_KERNEL);
|
||||
void *p __free(kfree) = kzalloc(pkt_size, GFP_KERNEL);
|
||||
if (!p)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -930,6 +928,7 @@ int q6asm_open_write(struct audio_client *ac, uint32_t stream_id,
|
||||
struct asm_stream_cmd_open_write_v3 *open;
|
||||
struct apr_pkt *pkt;
|
||||
int rc, pkt_size = APR_HDR_SIZE + sizeof(*open);
|
||||
|
||||
void *p __free(kfree) = kzalloc(pkt_size, GFP_KERNEL);
|
||||
if (!p)
|
||||
return -ENOMEM;
|
||||
@@ -1007,6 +1006,7 @@ static int __q6asm_run(struct audio_client *ac, uint32_t stream_id,
|
||||
struct asm_session_cmd_run_v2 *run;
|
||||
struct apr_pkt *pkt;
|
||||
int rc, pkt_size = APR_HDR_SIZE + sizeof(*run);
|
||||
|
||||
void *p __free(kfree) = kzalloc(pkt_size, GFP_ATOMIC);
|
||||
if (!p)
|
||||
return -ENOMEM;
|
||||
@@ -1089,6 +1089,7 @@ int q6asm_media_format_block_multi_ch_pcm(struct audio_client *ac,
|
||||
struct apr_pkt *pkt;
|
||||
u8 *channel_mapping;
|
||||
int pkt_size = APR_HDR_SIZE + sizeof(*fmt);
|
||||
|
||||
void *p __free(kfree) = kzalloc(pkt_size, GFP_KERNEL);
|
||||
if (!p)
|
||||
return -ENOMEM;
|
||||
@@ -1127,6 +1128,7 @@ int q6asm_stream_media_format_block_flac(struct audio_client *ac,
|
||||
struct asm_flac_fmt_blk_v2 *fmt;
|
||||
struct apr_pkt *pkt;
|
||||
int pkt_size = APR_HDR_SIZE + sizeof(*fmt);
|
||||
|
||||
void *p __free(kfree) = kzalloc(pkt_size, GFP_KERNEL);
|
||||
if (!p)
|
||||
return -ENOMEM;
|
||||
@@ -1158,6 +1160,7 @@ int q6asm_stream_media_format_block_wma_v9(struct audio_client *ac,
|
||||
struct asm_wmastdv9_fmt_blk_v2 *fmt;
|
||||
struct apr_pkt *pkt;
|
||||
int pkt_size = APR_HDR_SIZE + sizeof(*fmt);
|
||||
|
||||
void *p __free(kfree) = kzalloc(pkt_size, GFP_KERNEL);
|
||||
if (!p)
|
||||
return -ENOMEM;
|
||||
@@ -1190,6 +1193,7 @@ int q6asm_stream_media_format_block_wma_v10(struct audio_client *ac,
|
||||
struct asm_wmaprov10_fmt_blk_v2 *fmt;
|
||||
struct apr_pkt *pkt;
|
||||
int pkt_size = APR_HDR_SIZE + sizeof(*fmt);
|
||||
|
||||
void *p __free(kfree) = kzalloc(pkt_size, GFP_KERNEL);
|
||||
if (!p)
|
||||
return -ENOMEM;
|
||||
@@ -1223,6 +1227,7 @@ int q6asm_stream_media_format_block_alac(struct audio_client *ac,
|
||||
struct asm_alac_fmt_blk_v2 *fmt;
|
||||
struct apr_pkt *pkt;
|
||||
int pkt_size = APR_HDR_SIZE + sizeof(*fmt);
|
||||
|
||||
void *p __free(kfree) = kzalloc(pkt_size, GFP_KERNEL);
|
||||
if (!p)
|
||||
return -ENOMEM;
|
||||
@@ -1259,6 +1264,7 @@ int q6asm_stream_media_format_block_ape(struct audio_client *ac,
|
||||
struct asm_ape_fmt_blk_v2 *fmt;
|
||||
struct apr_pkt *pkt;
|
||||
int pkt_size = APR_HDR_SIZE + sizeof(*fmt);
|
||||
|
||||
void *p __free(kfree) = kzalloc(pkt_size, GFP_KERNEL);
|
||||
if (!p)
|
||||
return -ENOMEM;
|
||||
@@ -1293,6 +1299,7 @@ static int q6asm_stream_remove_silence(struct audio_client *ac, uint32_t stream_
|
||||
uint32_t *samples;
|
||||
struct apr_pkt *pkt;
|
||||
int rc, pkt_size = APR_HDR_SIZE + sizeof(uint32_t);
|
||||
|
||||
void *p __free(kfree) = kzalloc(pkt_size, GFP_ATOMIC);
|
||||
if (!p)
|
||||
return -ENOMEM;
|
||||
@@ -1351,6 +1358,7 @@ int q6asm_enc_cfg_blk_pcm_format_support(struct audio_client *ac,
|
||||
u8 *channel_mapping;
|
||||
u32 frames_per_buf = 0;
|
||||
int pkt_size = APR_HDR_SIZE + sizeof(*enc_cfg);
|
||||
|
||||
void *p __free(kfree) = kzalloc(pkt_size, GFP_KERNEL);
|
||||
if (!p)
|
||||
return -ENOMEM;
|
||||
@@ -1397,6 +1405,7 @@ int q6asm_read(struct audio_client *ac, uint32_t stream_id)
|
||||
unsigned long flags;
|
||||
int pkt_size = APR_HDR_SIZE + sizeof(*read);
|
||||
int rc = 0;
|
||||
|
||||
void *p __free(kfree) = kzalloc(pkt_size, GFP_ATOMIC);
|
||||
if (!p)
|
||||
return -ENOMEM;
|
||||
@@ -1439,6 +1448,7 @@ static int __q6asm_open_read(struct audio_client *ac, uint32_t stream_id,
|
||||
struct asm_stream_cmd_open_read_v3 *open;
|
||||
struct apr_pkt *pkt;
|
||||
int pkt_size = APR_HDR_SIZE + sizeof(*open);
|
||||
|
||||
void *p __free(kfree) = kzalloc(pkt_size, GFP_KERNEL);
|
||||
if (!p)
|
||||
return -ENOMEM;
|
||||
@@ -1509,6 +1519,7 @@ int q6asm_write_async(struct audio_client *ac, uint32_t stream_id, uint32_t len,
|
||||
struct apr_pkt *pkt;
|
||||
int pkt_size = APR_HDR_SIZE + sizeof(*write);
|
||||
int rc = 0;
|
||||
|
||||
void *p __free(kfree) = kzalloc(pkt_size, GFP_ATOMIC);
|
||||
if (!p)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -62,7 +62,6 @@ static int q6prm_set_hw_core_req(struct device *dev, uint32_t hw_block_id, bool
|
||||
struct prm_cmd_request_hw_core *req;
|
||||
gpr_device_t *gdev = prm->gdev;
|
||||
uint32_t opcode, rsp_opcode;
|
||||
struct gpr_pkt *pkt __free(kfree) = NULL;
|
||||
|
||||
if (enable) {
|
||||
opcode = PRM_CMD_REQUEST_HW_RSC;
|
||||
@@ -72,7 +71,8 @@ static int q6prm_set_hw_core_req(struct device *dev, uint32_t hw_block_id, bool
|
||||
rsp_opcode = PRM_CMD_RSP_RELEASE_HW_RSC;
|
||||
}
|
||||
|
||||
pkt = audioreach_alloc_cmd_pkt(sizeof(*req), opcode, 0, gdev->svc.id, GPR_PRM_MODULE_IID);
|
||||
struct gpr_pkt *pkt __free(kfree) =
|
||||
audioreach_alloc_cmd_pkt(sizeof(*req), opcode, 0, gdev->svc.id, GPR_PRM_MODULE_IID);
|
||||
if (IS_ERR(pkt))
|
||||
return PTR_ERR(pkt);
|
||||
|
||||
@@ -111,10 +111,10 @@ static int q6prm_request_lpass_clock(struct device *dev, int clk_id, int clk_att
|
||||
struct apm_module_param_data *param_data;
|
||||
struct prm_cmd_request_rsc *req;
|
||||
gpr_device_t *gdev = prm->gdev;
|
||||
struct gpr_pkt *pkt __free(kfree) = NULL;
|
||||
|
||||
pkt = audioreach_alloc_cmd_pkt(sizeof(*req), PRM_CMD_REQUEST_HW_RSC, 0, gdev->svc.id,
|
||||
GPR_PRM_MODULE_IID);
|
||||
struct gpr_pkt *pkt __free(kfree) =
|
||||
audioreach_alloc_cmd_pkt(sizeof(*req), PRM_CMD_REQUEST_HW_RSC, 0,
|
||||
gdev->svc.id, GPR_PRM_MODULE_IID);
|
||||
if (IS_ERR(pkt))
|
||||
return PTR_ERR(pkt);
|
||||
|
||||
@@ -143,10 +143,10 @@ static int q6prm_release_lpass_clock(struct device *dev, int clk_id, int clk_att
|
||||
struct apm_module_param_data *param_data;
|
||||
struct prm_cmd_release_rsc *rel;
|
||||
gpr_device_t *gdev = prm->gdev;
|
||||
struct gpr_pkt *pkt __free(kfree) = NULL;
|
||||
|
||||
pkt = audioreach_alloc_cmd_pkt(sizeof(*rel), PRM_CMD_RELEASE_HW_RSC, 0, gdev->svc.id,
|
||||
GPR_PRM_MODULE_IID);
|
||||
struct gpr_pkt *pkt __free(kfree) =
|
||||
audioreach_alloc_cmd_pkt(sizeof(*rel), PRM_CMD_RELEASE_HW_RSC, 0,
|
||||
gdev->svc.id, GPR_PRM_MODULE_IID);
|
||||
if (IS_ERR(pkt))
|
||||
return PTR_ERR(pkt);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user