diff options
author | Eliot Blennerhassett <eblennerhassett@audioscience.com> | 2011-04-05 04:55:48 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-04-05 05:51:04 -0400 |
commit | 42258daba22897f9859b0f3cb42700322b7c16bc (patch) | |
tree | 9dcf72eaa1d9c6d8f9a8df907f0f10068162017a | |
parent | 6d0b898e9c402d6b7d0d07adacdbee2ebedafdcd (diff) |
ALSA: asihpi: Minor cleanups
Remove some unneeded defintions
Use %pR to print resources
Make some data const
Consistent braces for else
Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/pci/asihpi/hpi_internal.h | 2 | ||||
-rw-r--r-- | sound/pci/asihpi/hpicmn.c | 9 | ||||
-rw-r--r-- | sound/pci/asihpi/hpicmn.h | 2 | ||||
-rw-r--r-- | sound/pci/asihpi/hpioctl.c | 9 |
4 files changed, 12 insertions, 10 deletions
diff --git a/sound/pci/asihpi/hpi_internal.h b/sound/pci/asihpi/hpi_internal.h index d829a65f47d0..4fab1595a6a2 100644 --- a/sound/pci/asihpi/hpi_internal.h +++ b/sound/pci/asihpi/hpi_internal.h | |||
@@ -1583,9 +1583,7 @@ void hpi_stream_response_to_legacy(struct hpi_stream_res *pSR); | |||
1583 | 1583 | ||
1584 | /*////////////////////////////////////////////////////////////////////////// */ | 1584 | /*////////////////////////////////////////////////////////////////////////// */ |
1585 | /* declarations for individual HPI entry points */ | 1585 | /* declarations for individual HPI entry points */ |
1586 | hpi_handler_func HPI_1000; | ||
1587 | hpi_handler_func HPI_6000; | 1586 | hpi_handler_func HPI_6000; |
1588 | hpi_handler_func HPI_6205; | 1587 | hpi_handler_func HPI_6205; |
1589 | hpi_handler_func HPI_COMMON; | ||
1590 | 1588 | ||
1591 | #endif /* _HPI_INTERNAL_H_ */ | 1589 | #endif /* _HPI_INTERNAL_H_ */ |
diff --git a/sound/pci/asihpi/hpicmn.c b/sound/pci/asihpi/hpicmn.c index 0428f285725d..b15a02e91f82 100644 --- a/sound/pci/asihpi/hpicmn.c +++ b/sound/pci/asihpi/hpicmn.c | |||
@@ -227,8 +227,9 @@ static unsigned int control_cache_alloc_check(struct hpi_control_cache *pC) | |||
227 | if (info->control_type) { | 227 | if (info->control_type) { |
228 | pC->p_info[info->control_index] = info; | 228 | pC->p_info[info->control_index] = info; |
229 | cached++; | 229 | cached++; |
230 | } else /* dummy cache entry */ | 230 | } else { /* dummy cache entry */ |
231 | pC->p_info[info->control_index] = NULL; | 231 | pC->p_info[info->control_index] = NULL; |
232 | } | ||
232 | 233 | ||
233 | byte_count += info->size_in32bit_words * 4; | 234 | byte_count += info->size_in32bit_words * 4; |
234 | 235 | ||
@@ -298,7 +299,7 @@ struct pad_ofs_size { | |||
298 | unsigned int field_size; | 299 | unsigned int field_size; |
299 | }; | 300 | }; |
300 | 301 | ||
301 | static struct pad_ofs_size pad_desc[] = { | 302 | static const struct pad_ofs_size pad_desc[] = { |
302 | HPICMN_PAD_OFS_AND_SIZE(c_channel), /* HPI_PAD_CHANNEL_NAME */ | 303 | HPICMN_PAD_OFS_AND_SIZE(c_channel), /* HPI_PAD_CHANNEL_NAME */ |
303 | HPICMN_PAD_OFS_AND_SIZE(c_artist), /* HPI_PAD_ARTIST */ | 304 | HPICMN_PAD_OFS_AND_SIZE(c_artist), /* HPI_PAD_ARTIST */ |
304 | HPICMN_PAD_OFS_AND_SIZE(c_title), /* HPI_PAD_TITLE */ | 305 | HPICMN_PAD_OFS_AND_SIZE(c_title), /* HPI_PAD_TITLE */ |
@@ -617,6 +618,10 @@ void hpi_cmn_control_cache_sync_to_msg(struct hpi_control_cache *p_cache, | |||
617 | } | 618 | } |
618 | } | 619 | } |
619 | 620 | ||
621 | /** Allocate control cache. | ||
622 | |||
623 | \return Cache pointer, or NULL if allocation fails. | ||
624 | */ | ||
620 | struct hpi_control_cache *hpi_alloc_control_cache(const u32 control_count, | 625 | struct hpi_control_cache *hpi_alloc_control_cache(const u32 control_count, |
621 | const u32 size_in_bytes, u8 *p_dsp_control_buffer) | 626 | const u32 size_in_bytes, u8 *p_dsp_control_buffer) |
622 | { | 627 | { |
diff --git a/sound/pci/asihpi/hpicmn.h b/sound/pci/asihpi/hpicmn.h index 590f0b69e655..d53cdf6e535f 100644 --- a/sound/pci/asihpi/hpicmn.h +++ b/sound/pci/asihpi/hpicmn.h | |||
@@ -60,3 +60,5 @@ void hpi_cmn_control_cache_sync_to_msg(struct hpi_control_cache *pC, | |||
60 | struct hpi_message *phm, struct hpi_response *phr); | 60 | struct hpi_message *phm, struct hpi_response *phr); |
61 | 61 | ||
62 | u16 hpi_validate_response(struct hpi_message *phm, struct hpi_response *phr); | 62 | u16 hpi_validate_response(struct hpi_message *phm, struct hpi_response *phr); |
63 | |||
64 | hpi_handler_func HPI_COMMON; | ||
diff --git a/sound/pci/asihpi/hpioctl.c b/sound/pci/asihpi/hpioctl.c index 484f41189867..d8e7047512f8 100644 --- a/sound/pci/asihpi/hpioctl.c +++ b/sound/pci/asihpi/hpioctl.c | |||
@@ -317,7 +317,7 @@ out: | |||
317 | int __devinit asihpi_adapter_probe(struct pci_dev *pci_dev, | 317 | int __devinit asihpi_adapter_probe(struct pci_dev *pci_dev, |
318 | const struct pci_device_id *pci_id) | 318 | const struct pci_device_id *pci_id) |
319 | { | 319 | { |
320 | int err, idx, nm; | 320 | int idx, nm; |
321 | unsigned int memlen; | 321 | unsigned int memlen; |
322 | struct hpi_message hm; | 322 | struct hpi_message hm; |
323 | struct hpi_response hr; | 323 | struct hpi_response hr; |
@@ -351,11 +351,8 @@ int __devinit asihpi_adapter_probe(struct pci_dev *pci_dev, | |||
351 | nm = HPI_MAX_ADAPTER_MEM_SPACES; | 351 | nm = HPI_MAX_ADAPTER_MEM_SPACES; |
352 | 352 | ||
353 | for (idx = 0; idx < nm; idx++) { | 353 | for (idx = 0; idx < nm; idx++) { |
354 | HPI_DEBUG_LOG(INFO, "resource %d %s %08llx-%08llx %04llx\n", | 354 | HPI_DEBUG_LOG(INFO, "resource %d %pR\n", idx, |
355 | idx, pci_dev->resource[idx].name, | 355 | &pci_dev->resource[idx]); |
356 | (unsigned long long)pci_resource_start(pci_dev, idx), | ||
357 | (unsigned long long)pci_resource_end(pci_dev, idx), | ||
358 | (unsigned long long)pci_resource_flags(pci_dev, idx)); | ||
359 | 356 | ||
360 | if (pci_resource_flags(pci_dev, idx) & IORESOURCE_MEM) { | 357 | if (pci_resource_flags(pci_dev, idx) & IORESOURCE_MEM) { |
361 | memlen = pci_resource_len(pci_dev, idx); | 358 | memlen = pci_resource_len(pci_dev, idx); |