aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/asihpi/hpicmn.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/asihpi/hpicmn.c')
-rw-r--r--sound/pci/asihpi/hpicmn.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/sound/pci/asihpi/hpicmn.c b/sound/pci/asihpi/hpicmn.c
index b15a02e91f82..65b7ca13115b 100644
--- a/sound/pci/asihpi/hpicmn.c
+++ b/sound/pci/asihpi/hpicmn.c
@@ -57,7 +57,7 @@ u16 hpi_validate_response(struct hpi_message *phm, struct hpi_response *phr)
57 } 57 }
58 58
59 if (phr->function != phm->function) { 59 if (phr->function != phm->function) {
60 HPI_DEBUG_LOG(ERROR, "header type %d invalid\n", 60 HPI_DEBUG_LOG(ERROR, "header function %d invalid\n",
61 phr->function); 61 phr->function);
62 return HPI_ERROR_INVALID_RESPONSE; 62 return HPI_ERROR_INVALID_RESPONSE;
63 } 63 }
@@ -315,8 +315,7 @@ short hpi_check_control_cache(struct hpi_control_cache *p_cache,
315 short found = 1; 315 short found = 1;
316 struct hpi_control_cache_info *pI; 316 struct hpi_control_cache_info *pI;
317 struct hpi_control_cache_single *pC; 317 struct hpi_control_cache_single *pC;
318 struct hpi_control_cache_pad *p_pad; 318 size_t response_size;
319
320 if (!find_control(phm->obj_index, p_cache, &pI)) { 319 if (!find_control(phm->obj_index, p_cache, &pI)) {
321 HPI_DEBUG_LOG(VERBOSE, 320 HPI_DEBUG_LOG(VERBOSE,
322 "HPICMN find_control() failed for adap %d\n", 321 "HPICMN find_control() failed for adap %d\n",
@@ -326,11 +325,15 @@ short hpi_check_control_cache(struct hpi_control_cache *p_cache,
326 325
327 phr->error = 0; 326 phr->error = 0;
328 327
328 /* set the default response size */
329 response_size =
330 sizeof(struct hpi_response_header) +
331 sizeof(struct hpi_control_res);
332
329 /* pC is the default cached control strucure. May be cast to 333 /* pC is the default cached control strucure. May be cast to
330 something else in the following switch statement. 334 something else in the following switch statement.
331 */ 335 */
332 pC = (struct hpi_control_cache_single *)pI; 336 pC = (struct hpi_control_cache_single *)pI;
333 p_pad = (struct hpi_control_cache_pad *)pI;
334 337
335 switch (pI->control_type) { 338 switch (pI->control_type) {
336 339
@@ -529,9 +532,7 @@ short hpi_check_control_cache(struct hpi_control_cache *p_cache,
529 pI->control_index, pI->control_type, phm->u.c.attribute); 532 pI->control_index, pI->control_type, phm->u.c.attribute);
530 533
531 if (found) 534 if (found)
532 phr->size = 535 phr->size = (u16)response_size;
533 sizeof(struct hpi_response_header) +
534 sizeof(struct hpi_control_res);
535 536
536 return found; 537 return found;
537} 538}
@@ -682,7 +683,7 @@ static void subsys_message(struct hpi_message *phm, struct hpi_response *phr)
682void HPI_COMMON(struct hpi_message *phm, struct hpi_response *phr) 683void HPI_COMMON(struct hpi_message *phm, struct hpi_response *phr)
683{ 684{
684 switch (phm->type) { 685 switch (phm->type) {
685 case HPI_TYPE_MESSAGE: 686 case HPI_TYPE_REQUEST:
686 switch (phm->object) { 687 switch (phm->object) {
687 case HPI_OBJ_SUBSYSTEM: 688 case HPI_OBJ_SUBSYSTEM:
688 subsys_message(phm, phr); 689 subsys_message(phm, phr);