summaryrefslogtreecommitdiffstats
path: root/sound/core
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2005-11-17 13:51:18 +0100
committerJaroslav Kysela <perex@suse.cz>2006-01-03 12:17:30 +0100
commit512bbd6a85230f16389f0dd51925472e72fc8a91 (patch)
treef563f496c46355ed6ed1bca4ab876e984eb69a84 /sound/core
parent3f05f868f1112b970e7fb9c0aa42cc99370098fe (diff)
[ALSA] Remove xxx_t typedefs: Core component
Modules: ALSA Core Remove xxx_t typedefs from the core component. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core')
-rw-r--r--sound/core/device.c42
-rw-r--r--sound/core/init.c86
-rw-r--r--sound/core/sound.c32
3 files changed, 83 insertions, 77 deletions
diff --git a/sound/core/device.c b/sound/core/device.c
index 1f509f56e60..afa8cc7fb05 100644
--- a/sound/core/device.c
+++ b/sound/core/device.c
@@ -41,10 +41,10 @@
*
* Returns zero if successful, or a negative error code on failure.
*/
-int snd_device_new(snd_card_t *card, snd_device_type_t type,
- void *device_data, snd_device_ops_t *ops)
+int snd_device_new(struct snd_card *card, snd_device_type_t type,
+ void *device_data, struct snd_device_ops *ops)
{
- snd_device_t *dev;
+ struct snd_device *dev;
snd_assert(card != NULL, return -ENXIO);
snd_assert(device_data != NULL, return -ENXIO);
@@ -73,10 +73,10 @@ int snd_device_new(snd_card_t *card, snd_device_type_t type,
* Returns zero if successful, or a negative error code on failure or if the
* device not found.
*/
-int snd_device_free(snd_card_t *card, void *device_data)
+int snd_device_free(struct snd_card *card, void *device_data)
{
struct list_head *list;
- snd_device_t *dev;
+ struct snd_device *dev;
snd_assert(card != NULL, return -ENXIO);
snd_assert(device_data != NULL, return -ENXIO);
@@ -86,7 +86,8 @@ int snd_device_free(snd_card_t *card, void *device_data)
continue;
/* unlink */
list_del(&dev->list);
- if ((dev->state == SNDRV_DEV_REGISTERED || dev->state == SNDRV_DEV_DISCONNECTED) &&
+ if ((dev->state == SNDRV_DEV_REGISTERED ||
+ dev->state == SNDRV_DEV_DISCONNECTED) &&
dev->ops->dev_unregister) {
if (dev->ops->dev_unregister(dev))
snd_printk(KERN_ERR "device unregister failure\n");
@@ -99,7 +100,8 @@ int snd_device_free(snd_card_t *card, void *device_data)
kfree(dev);
return 0;
}
- snd_printd("device free %p (from %p), not found\n", device_data, __builtin_return_address(0));
+ snd_printd("device free %p (from %p), not found\n", device_data,
+ __builtin_return_address(0));
return -ENXIO;
}
@@ -116,10 +118,10 @@ int snd_device_free(snd_card_t *card, void *device_data)
* Returns zero if successful, or a negative error code on failure or if the
* device not found.
*/
-int snd_device_disconnect(snd_card_t *card, void *device_data)
+int snd_device_disconnect(struct snd_card *card, void *device_data)
{
struct list_head *list;
- snd_device_t *dev;
+ struct snd_device *dev;
snd_assert(card != NULL, return -ENXIO);
snd_assert(device_data != NULL, return -ENXIO);
@@ -127,14 +129,16 @@ int snd_device_disconnect(snd_card_t *card, void *device_data)
dev = snd_device(list);
if (dev->device_data != device_data)
continue;
- if (dev->state == SNDRV_DEV_REGISTERED && dev->ops->dev_disconnect) {
+ if (dev->state == SNDRV_DEV_REGISTERED &&
+ dev->ops->dev_disconnect) {
if (dev->ops->dev_disconnect(dev))
snd_printk(KERN_ERR "device disconnect failure\n");
dev->state = SNDRV_DEV_DISCONNECTED;
}
return 0;
}
- snd_printd("device disconnect %p (from %p), not found\n", device_data, __builtin_return_address(0));
+ snd_printd("device disconnect %p (from %p), not found\n", device_data,
+ __builtin_return_address(0));
return -ENXIO;
}
@@ -151,10 +155,10 @@ int snd_device_disconnect(snd_card_t *card, void *device_data)
* Returns zero if successful, or a negative error code on failure or if the
* device not found.
*/
-int snd_device_register(snd_card_t *card, void *device_data)
+int snd_device_register(struct snd_card *card, void *device_data)
{
struct list_head *list;
- snd_device_t *dev;
+ struct snd_device *dev;
int err;
snd_assert(card != NULL, return -ENXIO);
@@ -179,10 +183,10 @@ int snd_device_register(snd_card_t *card, void *device_data)
* register all the devices on the card.
* called from init.c
*/
-int snd_device_register_all(snd_card_t *card)
+int snd_device_register_all(struct snd_card *card)
{
struct list_head *list;
- snd_device_t *dev;
+ struct snd_device *dev;
int err;
snd_assert(card != NULL, return -ENXIO);
@@ -201,9 +205,9 @@ int snd_device_register_all(snd_card_t *card)
* disconnect all the devices on the card.
* called from init.c
*/
-int snd_device_disconnect_all(snd_card_t *card)
+int snd_device_disconnect_all(struct snd_card *card)
{
- snd_device_t *dev;
+ struct snd_device *dev;
struct list_head *list;
int err = 0;
@@ -220,9 +224,9 @@ int snd_device_disconnect_all(snd_card_t *card)
* release all the devices on the card.
* called from init.c
*/
-int snd_device_free_all(snd_card_t *card, snd_device_cmd_t cmd)
+int snd_device_free_all(struct snd_card *card, snd_device_cmd_t cmd)
{
- snd_device_t *dev;
+ struct snd_device *dev;
struct list_head *list;
int err;
unsigned int range_low, range_high;
diff --git a/sound/core/init.c b/sound/core/init.c
index 33813f92ab5..dca64d199cb 100644
--- a/sound/core/init.c
+++ b/sound/core/init.c
@@ -40,14 +40,15 @@ struct snd_shutdown_f_ops {
};
unsigned int snd_cards_lock = 0; /* locked for registering/using */
-snd_card_t *snd_cards[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = NULL};
+struct snd_card *snd_cards[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = NULL};
DEFINE_RWLOCK(snd_card_rwlock);
#if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE)
-int (*snd_mixer_oss_notify_callback)(snd_card_t *card, int free_flag);
+int (*snd_mixer_oss_notify_callback)(struct snd_card *card, int free_flag);
#endif
-static void snd_card_id_read(snd_info_entry_t *entry, snd_info_buffer_t * buffer)
+static void snd_card_id_read(struct snd_info_entry *entry,
+ struct snd_info_buffer *buffer)
{
snd_iprintf(buffer, "%s\n", entry->card->id);
}
@@ -63,13 +64,13 @@ static void snd_card_free_thread(void * __card);
*
* Creates and initializes a soundcard structure.
*
- * Returns kmallocated snd_card_t structure. Creates the ALSA control interface
+ * Returns kmallocated snd_card structure. Creates the ALSA control interface
* (which is blocked until snd_card_register function is called).
*/
-snd_card_t *snd_card_new(int idx, const char *xid,
+struct snd_card *snd_card_new(int idx, const char *xid,
struct module *module, int extra_size)
{
- snd_card_t *card;
+ struct snd_card *card;
int err;
if (extra_size < 0)
@@ -132,7 +133,7 @@ snd_card_t *snd_card_new(int idx, const char *xid,
goto __error_ctl;
}
if (extra_size > 0)
- card->private_data = (char *)card + sizeof(snd_card_t);
+ card->private_data = (char *)card + sizeof(struct snd_card);
return card;
__error_ctl:
@@ -158,7 +159,7 @@ static unsigned int snd_disconnect_poll(struct file * file, poll_table * wait)
* Note: The current implementation replaces all active file->f_op with special
* dummy file operations (they do nothing except release).
*/
-int snd_card_disconnect(snd_card_t * card)
+int snd_card_disconnect(struct snd_card *card)
{
struct snd_monitor_file *mfile;
struct file *file;
@@ -229,7 +230,7 @@ int snd_card_disconnect(snd_card_t * card)
}
#ifdef CONFIG_SND_GENERIC_DRIVER
-static void snd_generic_device_unregister(snd_card_t *card);
+static void snd_generic_device_unregister(struct snd_card *card);
#else
#define snd_generic_device_unregister(x) /*NOP*/
#endif
@@ -245,7 +246,7 @@ static void snd_generic_device_unregister(snd_card_t *card);
* Returns zero. Frees all associated devices and frees the control
* interface associated to given soundcard.
*/
-int snd_card_free(snd_card_t * card)
+int snd_card_free(struct snd_card *card)
{
struct snd_shutdown_f_ops *s_f_ops;
@@ -300,7 +301,7 @@ int snd_card_free(snd_card_t * card)
static void snd_card_free_thread(void * __card)
{
- snd_card_t *card = __card;
+ struct snd_card *card = __card;
struct module * module = card->module;
if (!try_module_get(module)) {
@@ -327,7 +328,7 @@ static void snd_card_free_thread(void * __card)
*
* Returns - zero otherwise a negative error code if the start of thread failed.
*/
-int snd_card_free_in_thread(snd_card_t * card)
+int snd_card_free_in_thread(struct snd_card *card)
{
if (card->files == NULL) {
snd_card_free(card);
@@ -343,7 +344,7 @@ int snd_card_free_in_thread(snd_card_t * card)
return -EFAULT;
}
-static void choose_default_id(snd_card_t * card)
+static void choose_default_id(struct snd_card *card)
{
int i, len, idx_flag = 0, loops = 8;
char *id, *spos;
@@ -415,10 +416,10 @@ static void choose_default_id(snd_card_t * card)
*
* Returns zero otherwise a negative error code if the registrain failed.
*/
-int snd_card_register(snd_card_t * card)
+int snd_card_register(struct snd_card *card)
{
int err;
- snd_info_entry_t *entry;
+ struct snd_info_entry *entry;
snd_assert(card != NULL, return -EINVAL);
if ((err = snd_device_register_all(card)) < 0)
@@ -456,12 +457,12 @@ int snd_card_register(snd_card_t * card)
return 0;
}
-static snd_info_entry_t *snd_card_info_entry = NULL;
+static struct snd_info_entry *snd_card_info_entry = NULL;
-static void snd_card_info_read(snd_info_entry_t *entry, snd_info_buffer_t * buffer)
+static void snd_card_info_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
{
int idx, count;
- snd_card_t *card;
+ struct snd_card *card;
for (idx = count = 0; idx < SNDRV_CARDS; idx++) {
read_lock(&snd_card_rwlock);
@@ -483,10 +484,10 @@ static void snd_card_info_read(snd_info_entry_t *entry, snd_info_buffer_t * buff
#if defined(CONFIG_SND_OSSEMUL) && defined(CONFIG_PROC_FS)
-void snd_card_info_read_oss(snd_info_buffer_t * buffer)
+void snd_card_info_read_oss(struct snd_info_buffer *buffer)
{
int idx, count;
- snd_card_t *card;
+ struct snd_card *card;
for (idx = count = 0; idx < SNDRV_CARDS; idx++) {
read_lock(&snd_card_rwlock);
@@ -504,11 +505,12 @@ void snd_card_info_read_oss(snd_info_buffer_t * buffer)
#endif
#ifdef MODULE
-static snd_info_entry_t *snd_card_module_info_entry;
-static void snd_card_module_info_read(snd_info_entry_t *entry, snd_info_buffer_t * buffer)
+static struct snd_info_entry *snd_card_module_info_entry;
+static void snd_card_module_info_read(struct snd_info_entry *entry,
+ struct snd_info_buffer *buffer)
{
int idx;
- snd_card_t *card;
+ struct snd_card *card;
for (idx = 0; idx < SNDRV_CARDS; idx++) {
read_lock(&snd_card_rwlock);
@@ -521,7 +523,7 @@ static void snd_card_module_info_read(snd_info_entry_t *entry, snd_info_buffer_t
int __init snd_card_info_init(void)
{
- snd_info_entry_t *entry;
+ struct snd_info_entry *entry;
entry = snd_info_create_module_entry(THIS_MODULE, "cards", NULL);
if (! entry)
@@ -571,7 +573,7 @@ int __exit snd_card_info_done(void)
* Returns zero otherwise a negative error code.
*/
-int snd_component_add(snd_card_t *card, const char *component)
+int snd_component_add(struct snd_card *card, const char *component)
{
char *ptr;
int len = strlen(component);
@@ -602,7 +604,7 @@ int snd_component_add(snd_card_t *card, const char *component)
*
* Returns zero or a negative error code.
*/
-int snd_card_file_add(snd_card_t *card, struct file *file)
+int snd_card_file_add(struct snd_card *card, struct file *file)
{
struct snd_monitor_file *mfile;
@@ -636,7 +638,7 @@ int snd_card_file_add(snd_card_t *card, struct file *file)
*
* Returns zero or a negative error code.
*/
-int snd_card_file_remove(snd_card_t *card, struct file *file)
+int snd_card_file_remove(struct snd_card *card, struct file *file)
{
struct snd_monitor_file *mfile, *pfile = NULL;
@@ -671,7 +673,7 @@ int snd_card_file_remove(snd_card_t *card, struct file *file)
*/
struct snd_generic_device {
struct platform_device pdev;
- snd_card_t *card;
+ struct snd_card *card;
};
#define get_snd_generic_card(dev) container_of(dev, struct snd_generic_device, pdev)->card
@@ -698,7 +700,7 @@ void snd_generic_device_release(struct device *dev)
{
}
-static int snd_generic_device_register(snd_card_t *card)
+static int snd_generic_device_register(struct snd_card *card)
{
struct snd_generic_device *dev;
int err;
@@ -724,7 +726,7 @@ static int snd_generic_device_register(snd_card_t *card)
return 0;
}
-static void snd_generic_device_unregister(snd_card_t *card)
+static void snd_generic_device_unregister(struct snd_card *card)
{
struct snd_generic_device *dev = card->generic_dev;
if (dev) {
@@ -744,7 +746,7 @@ static void snd_generic_device_unregister(snd_card_t *card)
*
* Returns zero if successful, or a negative error code.
*/
-int snd_card_set_generic_dev(snd_card_t *card)
+int snd_card_set_generic_dev(struct snd_card *card)
{
int err;
if ((err = snd_generic_device_register(card)) < 0)
@@ -766,7 +768,7 @@ int snd_card_set_generic_dev(snd_card_t *card)
*
* Note: the power lock must be active before call.
*/
-int snd_power_wait(snd_card_t *card, unsigned int power_state, struct file *file)
+int snd_power_wait(struct snd_card *card, unsigned int power_state, struct file *file)
{
wait_queue_t wait;
int result = 0;
@@ -809,9 +811,9 @@ int snd_power_wait(snd_card_t *card, unsigned int power_state, struct file *file
* These callbacks are called from ALSA's common PCI suspend/resume
* handler and from the control API.
*/
-int snd_card_set_pm_callback(snd_card_t *card,
- int (*suspend)(snd_card_t *, pm_message_t),
- int (*resume)(snd_card_t *),
+int snd_card_set_pm_callback(struct snd_card *card,
+ int (*suspend)(struct snd_card *, pm_message_t),
+ int (*resume)(struct snd_card *),
void *private_data)
{
card->pm_suspend = suspend;
@@ -824,7 +826,7 @@ int snd_card_set_pm_callback(snd_card_t *card,
/* suspend/resume callbacks for snd_generic platform device */
static int snd_generic_suspend(struct platform_device *dev, pm_message_t state)
{
- snd_card_t *card;
+ struct snd_card *card;
card = get_snd_generic_card(dev);
if (card->power_state == SNDRV_CTL_POWER_D3hot)
@@ -837,7 +839,7 @@ static int snd_generic_suspend(struct platform_device *dev, pm_message_t state)
static int snd_generic_resume(struct platform_device *dev)
{
- snd_card_t *card;
+ struct snd_card *card;
card = get_snd_generic_card(dev);
if (card->power_state == SNDRV_CTL_POWER_D0)
@@ -859,9 +861,9 @@ static int snd_generic_resume(struct platform_device *dev)
* the given card. These callbacks are called from the ALSA's common
* PM handler and from the control API.
*/
-int snd_card_set_generic_pm_callback(snd_card_t *card,
- int (*suspend)(snd_card_t *, pm_message_t),
- int (*resume)(snd_card_t *),
+int snd_card_set_generic_pm_callback(struct snd_card *card,
+ int (*suspend)(struct snd_card *, pm_message_t),
+ int (*resume)(struct snd_card *),
void *private_data)
{
int err;
@@ -874,7 +876,7 @@ int snd_card_set_generic_pm_callback(snd_card_t *card,
#ifdef CONFIG_PCI
int snd_card_pci_suspend(struct pci_dev *dev, pm_message_t state)
{
- snd_card_t *card = pci_get_drvdata(dev);
+ struct snd_card *card = pci_get_drvdata(dev);
int err;
if (! card || ! card->pm_suspend)
return 0;
@@ -888,7 +890,7 @@ int snd_card_pci_suspend(struct pci_dev *dev, pm_message_t state)
int snd_card_pci_resume(struct pci_dev *dev)
{
- snd_card_t *card = pci_get_drvdata(dev);
+ struct snd_card *card = pci_get_drvdata(dev);
if (! card || ! card->pm_resume)
return 0;
if (card->power_state == SNDRV_CTL_POWER_D0)
diff --git a/sound/core/sound.c b/sound/core/sound.c
index 6e7cad1e947..04de0084e42 100644
--- a/sound/core/sound.c
+++ b/sound/core/sound.c
@@ -108,13 +108,13 @@ static void snd_request_other(int minor)
#endif /* request_module support */
-static snd_minor_t *snd_minor_search(int minor)
+static struct snd_minor *snd_minor_search(int minor)
{
struct list_head *list;
- snd_minor_t *mptr;
+ struct snd_minor *mptr;
list_for_each(list, &snd_minors_hash[SNDRV_MINOR_CARD(minor)]) {
- mptr = list_entry(list, snd_minor_t, list);
+ mptr = list_entry(list, struct snd_minor, list);
if (mptr->number == minor)
return mptr;
}
@@ -126,7 +126,7 @@ static int snd_open(struct inode *inode, struct file *file)
int minor = iminor(inode);
int card = SNDRV_MINOR_CARD(minor);
int dev = SNDRV_MINOR_DEVICE(minor);
- snd_minor_t *mptr = NULL;
+ struct snd_minor *mptr = NULL;
struct file_operations *old_fops;
int err = 0;
@@ -164,7 +164,7 @@ static struct file_operations snd_fops =
.open = snd_open
};
-static int snd_kernel_minor(int type, snd_card_t * card, int dev)
+static int snd_kernel_minor(int type, struct snd_card *card, int dev)
{
int minor;
@@ -196,7 +196,7 @@ static int snd_kernel_minor(int type, snd_card_t * card, int dev)
* @type: the device type, SNDRV_DEVICE_TYPE_XXX
* @card: the card instance
* @dev: the device index
- * @reg: the snd_minor_t record
+ * @reg: the struct snd_minor record
* @name: the device file name
*
* Registers an ALSA device file for the given card.
@@ -204,16 +204,16 @@ static int snd_kernel_minor(int type, snd_card_t * card, int dev)
*
* Retrurns zero if successful, or a negative error code on failure.
*/
-int snd_register_device(int type, snd_card_t * card, int dev, snd_minor_t * reg, const char *name)
+int snd_register_device(int type, struct snd_card *card, int dev, struct snd_minor * reg, const char *name)
{
int minor = snd_kernel_minor(type, card, dev);
- snd_minor_t *preg;
+ struct snd_minor *preg;
struct device *device = NULL;
if (minor < 0)
return minor;
snd_assert(name, return -EINVAL);
- preg = (snd_minor_t *)kmalloc(sizeof(snd_minor_t) + strlen(name) + 1, GFP_KERNEL);
+ preg = kmalloc(sizeof(struct snd_minor) + strlen(name) + 1, GFP_KERNEL);
if (preg == NULL)
return -ENOMEM;
*preg = *reg;
@@ -248,10 +248,10 @@ int snd_register_device(int type, snd_card_t * card, int dev, snd_minor_t * reg,
*
* Returns zero if sucecessful, or a negative error code on failure
*/
-int snd_unregister_device(int type, snd_card_t * card, int dev)
+int snd_unregister_device(int type, struct snd_card *card, int dev)
{
int minor = snd_kernel_minor(type, card, dev);
- snd_minor_t *mptr;
+ struct snd_minor *mptr;
if (minor < 0)
return minor;
@@ -275,18 +275,18 @@ int snd_unregister_device(int type, snd_card_t * card, int dev)
* INFO PART
*/
-static snd_info_entry_t *snd_minor_info_entry = NULL;
+static struct snd_info_entry *snd_minor_info_entry = NULL;
-static void snd_minor_info_read(snd_info_entry_t *entry, snd_info_buffer_t * buffer)
+static void snd_minor_info_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
{
int card, device;
struct list_head *list;
- snd_minor_t *mptr;
+ struct snd_minor *mptr;
down(&sound_mutex);
for (card = 0; card < SNDRV_CARDS; card++) {
list_for_each(list, &snd_minors_hash[card]) {
- mptr = list_entry(list, snd_minor_t, list);
+ mptr = list_entry(list, struct snd_minor, list);
if (SNDRV_MINOR_DEVICE(mptr->number) != SNDRV_MINOR_GLOBAL) {
if ((device = mptr->device) >= 0)
snd_iprintf(buffer, "%3i: [%i-%2i]: %s\n", mptr->number, card, device, mptr->comment);
@@ -302,7 +302,7 @@ static void snd_minor_info_read(snd_info_entry_t *entry, snd_info_buffer_t * buf
int __init snd_minor_info_init(void)
{
- snd_info_entry_t *entry;
+ struct snd_info_entry *entry;
entry = snd_info_create_module_entry(THIS_MODULE, "devices", NULL);
if (entry) {