提交 512bbd6a 编写于 作者: T Takashi Iwai 提交者: Jaroslav Kysela

[ALSA] Remove xxx_t typedefs: Core component

Modules: ALSA Core

Remove xxx_t typedefs from the core component.
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 3f05f868
此差异已折叠。
......@@ -28,13 +28,6 @@
#include <linux/workqueue.h> /* struct workqueue_struct */
#include <linux/pm.h> /* pm_message_t */
/* Typedef's */
typedef struct sndrv_interval snd_interval_t;
typedef enum sndrv_card_type snd_card_type;
typedef struct sndrv_xferi snd_xferi_t;
typedef struct sndrv_xfern snd_xfern_t;
typedef struct sndrv_xferv snd_xferv_t;
/* forward declarations */
#ifdef CONFIG_PCI
struct pci_dev;
......@@ -47,76 +40,50 @@ struct sbus_dev;
#define SNDRV_DEV_TYPE_RANGE_SIZE 0x1000
typedef enum {
SNDRV_DEV_TOPLEVEL = (0*SNDRV_DEV_TYPE_RANGE_SIZE),
SNDRV_DEV_CONTROL,
SNDRV_DEV_LOWLEVEL_PRE,
SNDRV_DEV_LOWLEVEL_NORMAL = (1*SNDRV_DEV_TYPE_RANGE_SIZE),
SNDRV_DEV_PCM,
SNDRV_DEV_RAWMIDI,
SNDRV_DEV_TIMER,
SNDRV_DEV_SEQUENCER,
SNDRV_DEV_HWDEP,
SNDRV_DEV_INFO,
SNDRV_DEV_BUS,
SNDRV_DEV_CODEC,
SNDRV_DEV_LOWLEVEL = (2*SNDRV_DEV_TYPE_RANGE_SIZE)
} snd_device_type_t;
typedef enum {
SNDRV_DEV_BUILD,
SNDRV_DEV_REGISTERED,
SNDRV_DEV_DISCONNECTED
} snd_device_state_t;
typedef enum {
SNDRV_DEV_CMD_PRE = 0,
SNDRV_DEV_CMD_NORMAL = 1,
SNDRV_DEV_CMD_POST = 2
} snd_device_cmd_t;
typedef struct _snd_card snd_card_t;
typedef struct _snd_device snd_device_t;
typedef int (snd_dev_free_t)(snd_device_t *device);
typedef int (snd_dev_register_t)(snd_device_t *device);
typedef int (snd_dev_disconnect_t)(snd_device_t *device);
typedef int (snd_dev_unregister_t)(snd_device_t *device);
typedef struct {
snd_dev_free_t *dev_free;
snd_dev_register_t *dev_register;
snd_dev_disconnect_t *dev_disconnect;
snd_dev_unregister_t *dev_unregister;
} snd_device_ops_t;
struct _snd_device {
typedef int __bitwise snd_device_type_t;
#define SNDRV_DEV_TOPLEVEL ((__force snd_device_type_t) 0)
#define SNDRV_DEV_CONTROL ((__force snd_device_type_t) 1)
#define SNDRV_DEV_LOWLEVEL_PRE ((__force snd_device_type_t) 2)
#define SNDRV_DEV_LOWLEVEL_NORMAL ((__force snd_device_type_t) 0x1000)
#define SNDRV_DEV_PCM ((__force snd_device_type_t) 0x1001)
#define SNDRV_DEV_RAWMIDI ((__force snd_device_type_t) 0x1002)
#define SNDRV_DEV_TIMER ((__force snd_device_type_t) 0x1003)
#define SNDRV_DEV_SEQUENCER ((__force snd_device_type_t) 0x1004)
#define SNDRV_DEV_HWDEP ((__force snd_device_type_t) 0x1005)
#define SNDRV_DEV_INFO ((__force snd_device_type_t) 0x1006)
#define SNDRV_DEV_BUS ((__force snd_device_type_t) 0x1007)
#define SNDRV_DEV_CODEC ((__force snd_device_type_t) 0x1008)
#define SNDRV_DEV_LOWLEVEL ((__force snd_device_type_t) 0x2000)
typedef int __bitwise snd_device_state_t;
#define SNDRV_DEV_BUILD ((__force snd_device_state_t) 0)
#define SNDRV_DEV_REGISTERED ((__force snd_device_state_t) 1)
#define SNDRV_DEV_DISCONNECTED ((__force snd_device_state_t) 2)
typedef int __bitwise snd_device_cmd_t;
#define SNDRV_DEV_CMD_PRE ((__force snd_device_cmd_t) 0)
#define SNDRV_DEV_CMD_NORMAL ((__force snd_device_cmd_t) 1)
#define SNDRV_DEV_CMD_POST ((__force snd_device_cmd_t) 2)
struct snd_device;
struct snd_device_ops {
int (*dev_free)(struct snd_device *dev);
int (*dev_register)(struct snd_device *dev);
int (*dev_disconnect)(struct snd_device *dev);
int (*dev_unregister)(struct snd_device *dev);
};
struct snd_device {
struct list_head list; /* list of registered devices */
snd_card_t *card; /* card which holds this device */
struct snd_card *card; /* card which holds this device */
snd_device_state_t state; /* state of the device */
snd_device_type_t type; /* device type */
void *device_data; /* device structure */
snd_device_ops_t *ops; /* operations */
struct snd_device_ops *ops; /* operations */
};
#define snd_device(n) list_entry(n, snd_device_t, list)
/* various typedefs */
typedef struct snd_info_entry snd_info_entry_t;
typedef struct _snd_pcm snd_pcm_t;
typedef struct _snd_pcm_str snd_pcm_str_t;
typedef struct _snd_pcm_substream snd_pcm_substream_t;
typedef struct _snd_mixer snd_kmixer_t;
typedef struct _snd_rawmidi snd_rawmidi_t;
typedef struct _snd_ctl_file snd_ctl_file_t;
typedef struct _snd_kcontrol snd_kcontrol_t;
typedef struct _snd_timer snd_timer_t;
typedef struct _snd_timer_instance snd_timer_instance_t;
typedef struct _snd_hwdep snd_hwdep_t;
#if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE)
typedef struct _snd_oss_mixer snd_mixer_oss_t;
#endif
#define snd_device(n) list_entry(n, struct snd_device, list)
/* monitor files for graceful shutdown (hotplug) */
......@@ -129,7 +96,7 @@ struct snd_shutdown_f_ops; /* define it later in init.c */
/* main structure for soundcard */
struct _snd_card {
struct snd_card {
int number; /* number of soundcard (index to
snd_cards) */
......@@ -143,7 +110,7 @@ struct _snd_card {
struct module *module; /* top-level module */
void *private_data; /* private data for soundcard */
void (*private_free) (snd_card_t *card); /* callback for freeing of
void (*private_free) (struct snd_card *card); /* callback for freeing of
private data */
struct list_head devices; /* devices */
......@@ -155,8 +122,8 @@ struct _snd_card {
struct list_head controls; /* all controls for this card */
struct list_head ctl_files; /* active control files */
snd_info_entry_t *proc_root; /* root for soundcard specific files */
snd_info_entry_t *proc_id; /* the card id */
struct snd_info_entry *proc_root; /* root for soundcard specific files */
struct snd_info_entry *proc_id; /* the card id */
struct proc_dir_entry *proc_root_link; /* number link to real id */
struct snd_monitor_file *files; /* all files associated to this card */
......@@ -172,8 +139,8 @@ struct _snd_card {
#endif
#ifdef CONFIG_PM
int (*pm_suspend)(snd_card_t *card, pm_message_t state);
int (*pm_resume)(snd_card_t *card);
int (*pm_suspend)(struct snd_card *card, pm_message_t state);
int (*pm_resume)(struct snd_card *card);
void *pm_private_data;
unsigned int power_state; /* power state */
struct semaphore power_lock; /* power lock */
......@@ -181,43 +148,43 @@ struct _snd_card {
#endif
#if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE)
snd_mixer_oss_t *mixer_oss;
struct snd_mixer_oss *mixer_oss;
int mixer_oss_change_count;
#endif
};
#ifdef CONFIG_PM
static inline void snd_power_lock(snd_card_t *card)
static inline void snd_power_lock(struct snd_card *card)
{
down(&card->power_lock);
}
static inline void snd_power_unlock(snd_card_t *card)
static inline void snd_power_unlock(struct snd_card *card)
{
up(&card->power_lock);
}
static inline unsigned int snd_power_get_state(snd_card_t *card)
static inline unsigned int snd_power_get_state(struct snd_card *card)
{
return card->power_state;
}
static inline void snd_power_change_state(snd_card_t *card, unsigned int state)
static inline void snd_power_change_state(struct snd_card *card, unsigned int state)
{
card->power_state = state;
wake_up(&card->power_sleep);
}
/* init.c */
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);
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);
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);
#define snd_card_set_isa_pm_callback(card,suspend,resume,data) \
snd_card_set_generic_pm_callback(card, suspend, resume, data)
......@@ -231,7 +198,7 @@ int snd_card_pci_resume(struct pci_dev *dev);
#define snd_power_lock(card) do { (void)(card); } while (0)
#define snd_power_unlock(card) do { (void)(card); } while (0)
static inline int snd_power_wait(snd_card_t *card, unsigned int state, struct file *file) { return 0; }
static inline int snd_power_wait(struct snd_card *card, unsigned int state, struct file *file) { return 0; }
#define snd_power_get_state(card) SNDRV_CTL_POWER_D0
#define snd_power_change_state(card, state) do { (void)(card); } while (0)
#define snd_card_set_pm_callback(card,suspend,resume,data)
......@@ -241,7 +208,7 @@ static inline int snd_power_wait(snd_card_t *card, unsigned int state, struct fi
#endif /* CONFIG_PM */
struct _snd_minor {
struct snd_minor {
struct list_head list; /* list of all minors per card */
int number; /* minor number */
int device; /* device number */
......@@ -251,8 +218,6 @@ struct _snd_minor {
structure) */
};
typedef struct _snd_minor snd_minor_t;
/* sound.c */
extern int snd_major;
......@@ -260,12 +225,12 @@ extern int snd_ecards_limit;
void snd_request_card(int card);
int snd_register_device(int type, snd_card_t *card, int dev, snd_minor_t *reg, const char *name);
int snd_unregister_device(int type, snd_card_t *card, int dev);
int snd_register_device(int type, struct snd_card *card, int dev, struct snd_minor *reg, const char *name);
int snd_unregister_device(int type, struct snd_card *card, int dev);
#ifdef CONFIG_SND_OSSEMUL
int snd_register_oss_device(int type, snd_card_t *card, int dev, snd_minor_t *reg, const char *name);
int snd_unregister_oss_device(int type, snd_card_t *card, int dev);
int snd_register_oss_device(int type, struct snd_card *card, int dev, struct snd_minor *reg, const char *name);
int snd_unregister_oss_device(int type, struct snd_card *card, int dev);
#endif
int snd_minor_info_init(void);
......@@ -291,43 +256,43 @@ int copy_from_user_toio(volatile void __iomem *dst, const void __user *src, size
/* init.c */
extern unsigned int snd_cards_lock;
extern snd_card_t *snd_cards[SNDRV_CARDS];
extern struct snd_card *snd_cards[SNDRV_CARDS];
extern rwlock_t snd_card_rwlock;
#if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE)
#define SND_MIXER_OSS_NOTIFY_REGISTER 0
#define SND_MIXER_OSS_NOTIFY_DISCONNECT 1
#define SND_MIXER_OSS_NOTIFY_FREE 2
extern int (*snd_mixer_oss_notify_callback)(snd_card_t *card, int cmd);
extern int (*snd_mixer_oss_notify_callback)(struct snd_card *card, int cmd);
#endif
snd_card_t *snd_card_new(int idx, const char *id,
struct snd_card *snd_card_new(int idx, const char *id,
struct module *module, int extra_size);
int snd_card_disconnect(snd_card_t *card);
int snd_card_free(snd_card_t *card);
int snd_card_free_in_thread(snd_card_t *card);
int snd_card_register(snd_card_t *card);
int snd_card_disconnect(struct snd_card *card);
int snd_card_free(struct snd_card *card);
int snd_card_free_in_thread(struct snd_card *card);
int snd_card_register(struct snd_card *card);
int snd_card_info_init(void);
int snd_card_info_done(void);
int snd_component_add(snd_card_t *card, const char *component);
int snd_card_file_add(snd_card_t *card, struct file *file);
int snd_card_file_remove(snd_card_t *card, struct file *file);
int snd_component_add(struct snd_card *card, const char *component);
int snd_card_file_add(struct snd_card *card, struct file *file);
int snd_card_file_remove(struct snd_card *card, struct file *file);
#ifndef snd_card_set_dev
#define snd_card_set_dev(card,devptr) ((card)->dev = (devptr))
#endif
/* register a generic device (for ISA, etc) */
int snd_card_set_generic_dev(snd_card_t *card);
int snd_card_set_generic_dev(struct snd_card *card);
/* device.c */
int snd_device_new(snd_card_t *card, snd_device_type_t type,
void *device_data, snd_device_ops_t *ops);
int snd_device_register(snd_card_t *card, void *device_data);
int snd_device_register_all(snd_card_t *card);
int snd_device_disconnect(snd_card_t *card, void *device_data);
int snd_device_disconnect_all(snd_card_t *card);
int snd_device_free(snd_card_t *card, void *device_data);
int snd_device_free_all(snd_card_t *card, snd_device_cmd_t cmd);
int snd_device_new(struct snd_card *card, snd_device_type_t type,
void *device_data, struct snd_device_ops *ops);
int snd_device_register(struct snd_card *card, void *device_data);
int snd_device_register_all(struct snd_card *card);
int snd_device_disconnect(struct snd_card *card, void *device_data);
int snd_device_disconnect_all(struct snd_card *card);
int snd_device_free(struct snd_card *card, void *device_data);
int snd_device_free_all(struct snd_card *card, snd_device_cmd_t cmd);
/* isadma.c */
......@@ -443,4 +408,6 @@ void snd_verbose_printd(const char *file, int line, const char *format, ...)
#endif
#endif
#include "typedefs.h"
#endif /* __SOUND_CORE_H */
......@@ -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;
......
......@@ -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)
......
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册