mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-30 16:53:20 -04:00
media: qcom: iris: Make iris_destroy_internal_buffer() return void
iris_destroy_internal_buffer() is guaranteed to succeed and never reports an error. Returning an int is misleading and forces callers to handle a meaningless status value. Convert it to return void to match its behavior and simplify callers. Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Signed-off-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com> Signed-off-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com> Signed-off-by: Bryan O'Donoghue <bod@kernel.org>
This commit is contained in:
committed by
Bryan O'Donoghue
parent
75126861e6
commit
d2f0ebbcde
@@ -648,7 +648,7 @@ int iris_queue_internal_buffers(struct iris_inst *inst, u32 plane)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int iris_destroy_internal_buffer(struct iris_inst *inst, struct iris_buffer *buffer)
|
||||
void iris_destroy_internal_buffer(struct iris_inst *inst, struct iris_buffer *buffer)
|
||||
{
|
||||
struct iris_core *core = inst->core;
|
||||
|
||||
@@ -656,8 +656,6 @@ int iris_destroy_internal_buffer(struct iris_inst *inst, struct iris_buffer *buf
|
||||
dma_free_attrs(core->dev, buffer->buffer_size, buffer->kvaddr,
|
||||
buffer->device_addr, buffer->dma_attrs);
|
||||
kfree(buffer);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int iris_destroy_internal_buffers(struct iris_inst *inst, u32 plane, bool force)
|
||||
@@ -666,7 +664,6 @@ static int iris_destroy_internal_buffers(struct iris_inst *inst, u32 plane, bool
|
||||
struct iris_buffers *buffers;
|
||||
const u32 *internal_buf_type;
|
||||
u32 i, len;
|
||||
int ret;
|
||||
|
||||
iris_get_int_buf_tbl(inst, plane, &internal_buf_type, &len);
|
||||
|
||||
@@ -681,9 +678,7 @@ static int iris_destroy_internal_buffers(struct iris_inst *inst, u32 plane, bool
|
||||
if (!force && buf->attr & BUF_ATTR_QUEUED)
|
||||
continue;
|
||||
|
||||
ret = iris_destroy_internal_buffer(inst, buf);
|
||||
if (ret)
|
||||
return ret;
|
||||
iris_destroy_internal_buffer(inst, buf);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -693,11 +688,8 @@ static int iris_destroy_internal_buffers(struct iris_inst *inst, u32 plane, bool
|
||||
else
|
||||
buffers = &inst->buffers[BUF_ARP];
|
||||
|
||||
list_for_each_entry_safe(buf, next, &buffers->list, list) {
|
||||
ret = iris_destroy_internal_buffer(inst, buf);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
list_for_each_entry_safe(buf, next, &buffers->list, list)
|
||||
iris_destroy_internal_buffer(inst, buf);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -112,7 +112,7 @@ void iris_get_internal_buffers(struct iris_inst *inst, u32 plane);
|
||||
int iris_create_internal_buffers(struct iris_inst *inst, u32 plane);
|
||||
int iris_queue_internal_buffers(struct iris_inst *inst, u32 plane);
|
||||
int iris_queue_internal_deferred_buffers(struct iris_inst *inst, enum iris_buffer_type buffer_type);
|
||||
int iris_destroy_internal_buffer(struct iris_inst *inst, struct iris_buffer *buffer);
|
||||
void iris_destroy_internal_buffer(struct iris_inst *inst, struct iris_buffer *buffer);
|
||||
int iris_destroy_all_internal_buffers(struct iris_inst *inst, u32 plane);
|
||||
int iris_destroy_dequeued_internal_buffers(struct iris_inst *inst, u32 plane);
|
||||
int iris_alloc_and_queue_persist_bufs(struct iris_inst *inst, enum iris_buffer_type buf_type);
|
||||
|
||||
@@ -442,7 +442,7 @@ static int iris_hfi_gen1_session_unset_buffers(struct iris_inst *inst, struct ir
|
||||
|
||||
ret = iris_wait_for_session_response(inst, false);
|
||||
if (!ret)
|
||||
ret = iris_destroy_internal_buffer(inst, buf);
|
||||
iris_destroy_internal_buffer(inst, buf);
|
||||
|
||||
exit:
|
||||
kfree(pkt);
|
||||
|
||||
@@ -447,7 +447,9 @@ static int iris_hfi_gen2_handle_release_internal_buffer(struct iris_inst *inst,
|
||||
|
||||
buf->attr &= ~BUF_ATTR_QUEUED;
|
||||
|
||||
return iris_destroy_internal_buffer(inst, buf);
|
||||
iris_destroy_internal_buffer(inst, buf);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int iris_hfi_gen2_handle_session_stop(struct iris_inst *inst,
|
||||
|
||||
Reference in New Issue
Block a user