ASoC: qcom: Constify APR callback response data

APR bus driver calls each APR client callback with pointer to the APR
response packet.  The callbacks are not suppose to modify that response
packet, so make it a pointer to const to document that expectation
explicitly.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Link: https://patch.msgid.link/20251130-asoc-apr-const-v1-1-d0833f3ed423@oss.qualcomm.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Krzysztof Kozlowski 2025-11-30 10:40:23 +01:00 committed by Mark Brown
parent 8f0b4cce44
commit 86af3c2292
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
5 changed files with 11 additions and 11 deletions

View File

@ -155,7 +155,7 @@ struct apr_driver {
int (*probe)(struct apr_device *sl);
void (*remove)(struct apr_device *sl);
int (*callback)(struct apr_device *a,
struct apr_resp_pkt *d);
const struct apr_resp_pkt *d);
int (*gpr_callback)(struct gpr_resp_pkt *d, void *data, int op);
struct device_driver driver;
const struct apr_device_id *id_table;

View File

@ -186,11 +186,11 @@ static void q6adm_free_copp(struct kref *ref)
kfree(c);
}
static int q6adm_callback(struct apr_device *adev, struct apr_resp_pkt *data)
static int q6adm_callback(struct apr_device *adev, const struct apr_resp_pkt *data)
{
struct aprv2_ibasic_rsp_result_t *result = data->payload;
int port_idx, copp_idx;
struct apr_hdr *hdr = &data->hdr;
const struct apr_hdr *hdr = &data->hdr;
struct q6copp *copp;
struct q6adm *adm = dev_get_drvdata(&adev->dev);

View File

@ -958,11 +958,11 @@ static struct q6afe_port *q6afe_find_port(struct q6afe *afe, int token)
return ret;
}
static int q6afe_callback(struct apr_device *adev, struct apr_resp_pkt *data)
static int q6afe_callback(struct apr_device *adev, const struct apr_resp_pkt *data)
{
struct q6afe *afe = dev_get_drvdata(&adev->dev);
struct aprv2_ibasic_rsp_result_t *res;
struct apr_hdr *hdr = &data->hdr;
const struct apr_hdr *hdr = &data->hdr;
struct q6afe_port *port;
if (!data->payload_size)

View File

@ -599,12 +599,12 @@ int q6asm_get_hw_pointer(struct audio_client *ac, unsigned int dir)
EXPORT_SYMBOL_GPL(q6asm_get_hw_pointer);
static int32_t q6asm_stream_callback(struct apr_device *adev,
struct apr_resp_pkt *data,
const struct apr_resp_pkt *data,
int session_id)
{
struct q6asm *q6asm = dev_get_drvdata(&adev->dev);
struct aprv2_ibasic_rsp_result_t *result;
struct apr_hdr *hdr = &data->hdr;
const struct apr_hdr *hdr = &data->hdr;
struct audio_port_data *port;
struct audio_client *ac;
uint32_t client_event = 0;
@ -744,13 +744,13 @@ static int32_t q6asm_stream_callback(struct apr_device *adev,
}
static int q6asm_srvc_callback(struct apr_device *adev,
struct apr_resp_pkt *data)
const struct apr_resp_pkt *data)
{
struct q6asm *q6asm = dev_get_drvdata(&adev->dev);
struct aprv2_ibasic_rsp_result_t *result;
struct audio_port_data *port;
struct audio_client *ac = NULL;
struct apr_hdr *hdr = &data->hdr;
const struct apr_hdr *hdr = &data->hdr;
struct q6asm *a;
uint32_t sid = 0;
uint32_t dir = 0;

View File

@ -67,11 +67,11 @@ struct q6core {
static struct q6core *g_core;
static int q6core_callback(struct apr_device *adev, struct apr_resp_pkt *data)
static int q6core_callback(struct apr_device *adev, const struct apr_resp_pkt *data)
{
struct q6core *core = dev_get_drvdata(&adev->dev);
struct aprv2_ibasic_rsp_result_t *result;
struct apr_hdr *hdr = &data->hdr;
const struct apr_hdr *hdr = &data->hdr;
result = data->payload;
switch (hdr->opcode) {