Commit 512bbd6a authored by Takashi Iwai's avatar Takashi Iwai Committed by Jaroslav Kysela

[ALSA] Remove xxx_t typedefs: Core component

Modules: ALSA Core

Remove xxx_t typedefs from the core component.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 3f05f868
This diff is collapsed.
This diff is collapsed.
...@@ -41,10 +41,10 @@ ...@@ -41,10 +41,10 @@
* *
* Returns zero if successful, or a negative error code on failure. * Returns zero if successful, or a negative error code on failure.
*/ */
int snd_device_new(snd_card_t *card, snd_device_type_t type, int snd_device_new(struct snd_card *card, snd_device_type_t type,
void *device_data, snd_device_ops_t *ops) void *device_data, struct snd_device_ops *ops)
{ {
snd_device_t *dev; struct snd_device *dev;
snd_assert(card != NULL, return -ENXIO); snd_assert(card != NULL, return -ENXIO);
snd_assert(device_data != 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, ...@@ -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 * Returns zero if successful, or a negative error code on failure or if the
* device not found. * 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; struct list_head *list;
snd_device_t *dev; struct snd_device *dev;
snd_assert(card != NULL, return -ENXIO); snd_assert(card != NULL, return -ENXIO);
snd_assert(device_data != 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) ...@@ -86,7 +86,8 @@ int snd_device_free(snd_card_t *card, void *device_data)
continue; continue;
/* unlink */ /* unlink */
list_del(&dev->list); 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) { dev->ops->dev_unregister) {
if (dev->ops->dev_unregister(dev)) if (dev->ops->dev_unregister(dev))
snd_printk(KERN_ERR "device unregister failure\n"); snd_printk(KERN_ERR "device unregister failure\n");
...@@ -99,7 +100,8 @@ int snd_device_free(snd_card_t *card, void *device_data) ...@@ -99,7 +100,8 @@ int snd_device_free(snd_card_t *card, void *device_data)
kfree(dev); kfree(dev);
return 0; 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; return -ENXIO;
} }
...@@ -116,10 +118,10 @@ int snd_device_free(snd_card_t *card, void *device_data) ...@@ -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 * Returns zero if successful, or a negative error code on failure or if the
* device not found. * 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; struct list_head *list;
snd_device_t *dev; struct snd_device *dev;
snd_assert(card != NULL, return -ENXIO); snd_assert(card != NULL, return -ENXIO);
snd_assert(device_data != 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) ...@@ -127,14 +129,16 @@ int snd_device_disconnect(snd_card_t *card, void *device_data)
dev = snd_device(list); dev = snd_device(list);
if (dev->device_data != device_data) if (dev->device_data != device_data)
continue; 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)) if (dev->ops->dev_disconnect(dev))
snd_printk(KERN_ERR "device disconnect failure\n"); snd_printk(KERN_ERR "device disconnect failure\n");
dev->state = SNDRV_DEV_DISCONNECTED; dev->state = SNDRV_DEV_DISCONNECTED;
} }
return 0; 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; return -ENXIO;
} }
...@@ -151,10 +155,10 @@ int snd_device_disconnect(snd_card_t *card, void *device_data) ...@@ -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 * Returns zero if successful, or a negative error code on failure or if the
* device not found. * 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; struct list_head *list;
snd_device_t *dev; struct snd_device *dev;
int err; int err;
snd_assert(card != NULL, return -ENXIO); snd_assert(card != NULL, return -ENXIO);
...@@ -179,10 +183,10 @@ int snd_device_register(snd_card_t *card, void *device_data) ...@@ -179,10 +183,10 @@ int snd_device_register(snd_card_t *card, void *device_data)
* register all the devices on the card. * register all the devices on the card.
* called from init.c * 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; struct list_head *list;
snd_device_t *dev; struct snd_device *dev;
int err; int err;
snd_assert(card != NULL, return -ENXIO); snd_assert(card != NULL, return -ENXIO);
...@@ -201,9 +205,9 @@ int snd_device_register_all(snd_card_t *card) ...@@ -201,9 +205,9 @@ int snd_device_register_all(snd_card_t *card)
* disconnect all the devices on the card. * disconnect all the devices on the card.
* called from init.c * 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; struct list_head *list;
int err = 0; int err = 0;
...@@ -220,9 +224,9 @@ int snd_device_disconnect_all(snd_card_t *card) ...@@ -220,9 +224,9 @@ int snd_device_disconnect_all(snd_card_t *card)
* release all the devices on the card. * release all the devices on the card.
* called from init.c * 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; struct list_head *list;
int err; int err;
unsigned int range_low, range_high; unsigned int range_low, range_high;
......
This diff is collapsed.
...@@ -108,13 +108,13 @@ static void snd_request_other(int minor) ...@@ -108,13 +108,13 @@ static void snd_request_other(int minor)
#endif /* request_module support */ #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; struct list_head *list;
snd_minor_t *mptr; struct snd_minor *mptr;
list_for_each(list, &snd_minors_hash[SNDRV_MINOR_CARD(minor)]) { 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) if (mptr->number == minor)
return mptr; return mptr;
} }
...@@ -126,7 +126,7 @@ static int snd_open(struct inode *inode, struct file *file) ...@@ -126,7 +126,7 @@ static int snd_open(struct inode *inode, struct file *file)
int minor = iminor(inode); int minor = iminor(inode);
int card = SNDRV_MINOR_CARD(minor); int card = SNDRV_MINOR_CARD(minor);
int dev = SNDRV_MINOR_DEVICE(minor); int dev = SNDRV_MINOR_DEVICE(minor);
snd_minor_t *mptr = NULL; struct snd_minor *mptr = NULL;
struct file_operations *old_fops; struct file_operations *old_fops;
int err = 0; int err = 0;
...@@ -164,7 +164,7 @@ static struct file_operations snd_fops = ...@@ -164,7 +164,7 @@ static struct file_operations snd_fops =
.open = snd_open .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; int minor;
...@@ -196,7 +196,7 @@ static int snd_kernel_minor(int type, snd_card_t * card, int dev) ...@@ -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 * @type: the device type, SNDRV_DEVICE_TYPE_XXX
* @card: the card instance * @card: the card instance
* @dev: the device index * @dev: the device index
* @reg: the snd_minor_t record * @reg: the struct snd_minor record
* @name: the device file name * @name: the device file name
* *
* Registers an ALSA device file for the given card. * 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) ...@@ -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. * 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); int minor = snd_kernel_minor(type, card, dev);
snd_minor_t *preg; struct snd_minor *preg;
struct device *device = NULL; struct device *device = NULL;
if (minor < 0) if (minor < 0)
return minor; return minor;
snd_assert(name, return -EINVAL); 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) if (preg == NULL)
return -ENOMEM; return -ENOMEM;
*preg = *reg; *preg = *reg;
...@@ -248,10 +248,10 @@ int snd_register_device(int type, snd_card_t * card, int dev, snd_minor_t * 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 * 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); int minor = snd_kernel_minor(type, card, dev);
snd_minor_t *mptr; struct snd_minor *mptr;
if (minor < 0) if (minor < 0)
return minor; return minor;
...@@ -275,18 +275,18 @@ int snd_unregister_device(int type, snd_card_t * card, int dev) ...@@ -275,18 +275,18 @@ int snd_unregister_device(int type, snd_card_t * card, int dev)
* INFO PART * 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; int card, device;
struct list_head *list; struct list_head *list;
snd_minor_t *mptr; struct snd_minor *mptr;
down(&sound_mutex); down(&sound_mutex);
for (card = 0; card < SNDRV_CARDS; card++) { for (card = 0; card < SNDRV_CARDS; card++) {
list_for_each(list, &snd_minors_hash[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 (SNDRV_MINOR_DEVICE(mptr->number) != SNDRV_MINOR_GLOBAL) {
if ((device = mptr->device) >= 0) if ((device = mptr->device) >= 0)
snd_iprintf(buffer, "%3i: [%i-%2i]: %s\n", mptr->number, card, device, mptr->comment); 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 ...@@ -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) 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); entry = snd_info_create_module_entry(THIS_MODULE, "devices", NULL);
if (entry) { if (entry) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment