Commit 4a4d2cfd authored by Takashi Iwai's avatar Takashi Iwai Committed by Jaroslav Kysela

[ALSA] Remove xxx_t typedefs: Generic drivers

Modules: Generic drivers

Remove xxx_t typedefs from the generic drivers
(dummy, mtpav, serial-u16550 and virmidi).
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 03da312a
This diff is collapsed.
...@@ -130,12 +130,12 @@ typedef struct mtpav_port { ...@@ -130,12 +130,12 @@ typedef struct mtpav_port {
u8 hwport; u8 hwport;
u8 mode; u8 mode;
u8 running_status; u8 running_status;
snd_rawmidi_substream_t *input; struct snd_rawmidi_substream *input;
snd_rawmidi_substream_t *output; struct snd_rawmidi_substream *output;
} mtpav_port_t; } mtpav_port_t;
typedef struct mtpav { typedef struct mtpav {
snd_card_t *card; struct snd_card *card;
unsigned long port; unsigned long port;
struct resource *res_port; struct resource *res_port;
int irq; /* interrupt (for inputs) */ int irq; /* interrupt (for inputs) */
...@@ -143,7 +143,7 @@ typedef struct mtpav { ...@@ -143,7 +143,7 @@ typedef struct mtpav {
int share_irq; /* number of accesses to input interrupts */ int share_irq; /* number of accesses to input interrupts */
int istimer; /* number of accesses to timer interrupts */ int istimer; /* number of accesses to timer interrupts */
struct timer_list timer; /* timer interrupts for outputs */ struct timer_list timer; /* timer interrupts for outputs */
snd_rawmidi_t *rmidi; struct snd_rawmidi *rmidi;
int num_ports; /* number of hw ports (1-8) */ int num_ports; /* number of hw ports (1-8) */
mtpav_port_t ports[NUMPORTS]; /* all ports including computer, adat and bc */ mtpav_port_t ports[NUMPORTS]; /* all ports including computer, adat and bc */
...@@ -292,7 +292,7 @@ static void snd_mtpav_send_byte(mtpav_t *chip, u8 byte) ...@@ -292,7 +292,7 @@ static void snd_mtpav_send_byte(mtpav_t *chip, u8 byte)
/* call this with spin lock held */ /* call this with spin lock held */
static void snd_mtpav_output_port_write(mtpav_port_t *port, static void snd_mtpav_output_port_write(mtpav_port_t *port,
snd_rawmidi_substream_t *substream) struct snd_rawmidi_substream *substream)
{ {
u8 outbyte; u8 outbyte;
...@@ -324,7 +324,7 @@ static void snd_mtpav_output_port_write(mtpav_port_t *port, ...@@ -324,7 +324,7 @@ static void snd_mtpav_output_port_write(mtpav_port_t *port,
} while (snd_rawmidi_transmit(substream, &outbyte, 1) == 1); } while (snd_rawmidi_transmit(substream, &outbyte, 1) == 1);
} }
static void snd_mtpav_output_write(snd_rawmidi_substream_t * substream) static void snd_mtpav_output_write(struct snd_rawmidi_substream *substream)
{ {
mtpav_port_t *port = &mtp_card->ports[substream->number]; mtpav_port_t *port = &mtp_card->ports[substream->number];
unsigned long flags; unsigned long flags;
...@@ -353,7 +353,7 @@ static void snd_mtpav_portscan(mtpav_t *chip) // put mtp into smart routing mode ...@@ -353,7 +353,7 @@ static void snd_mtpav_portscan(mtpav_t *chip) // put mtp into smart routing mode
/* /*
*/ */
static int snd_mtpav_input_open(snd_rawmidi_substream_t * substream) static int snd_mtpav_input_open(struct snd_rawmidi_substream *substream)
{ {
unsigned long flags; unsigned long flags;
mtpav_port_t *portp = &mtp_card->ports[substream->number]; mtpav_port_t *portp = &mtp_card->ports[substream->number];
...@@ -371,7 +371,7 @@ static int snd_mtpav_input_open(snd_rawmidi_substream_t * substream) ...@@ -371,7 +371,7 @@ static int snd_mtpav_input_open(snd_rawmidi_substream_t * substream)
/* /*
*/ */
static int snd_mtpav_input_close(snd_rawmidi_substream_t *substream) static int snd_mtpav_input_close(struct snd_rawmidi_substream *substream)
{ {
unsigned long flags; unsigned long flags;
mtpav_port_t *portp = &mtp_card->ports[substream->number]; mtpav_port_t *portp = &mtp_card->ports[substream->number];
...@@ -392,7 +392,7 @@ static int snd_mtpav_input_close(snd_rawmidi_substream_t *substream) ...@@ -392,7 +392,7 @@ static int snd_mtpav_input_close(snd_rawmidi_substream_t *substream)
/* /*
*/ */
static void snd_mtpav_input_trigger(snd_rawmidi_substream_t * substream, int up) static void snd_mtpav_input_trigger(struct snd_rawmidi_substream *substream, int up)
{ {
unsigned long flags; unsigned long flags;
mtpav_port_t *portp = &mtp_card->ports[substream->number]; mtpav_port_t *portp = &mtp_card->ports[substream->number];
...@@ -449,7 +449,7 @@ static void snd_mtpav_remove_output_timer(mtpav_t *chip) ...@@ -449,7 +449,7 @@ static void snd_mtpav_remove_output_timer(mtpav_t *chip)
/* /*
*/ */
static int snd_mtpav_output_open(snd_rawmidi_substream_t * substream) static int snd_mtpav_output_open(struct snd_rawmidi_substream *substream)
{ {
unsigned long flags; unsigned long flags;
mtpav_port_t *portp = &mtp_card->ports[substream->number]; mtpav_port_t *portp = &mtp_card->ports[substream->number];
...@@ -464,7 +464,7 @@ static int snd_mtpav_output_open(snd_rawmidi_substream_t * substream) ...@@ -464,7 +464,7 @@ static int snd_mtpav_output_open(snd_rawmidi_substream_t * substream)
/* /*
*/ */
static int snd_mtpav_output_close(snd_rawmidi_substream_t * substream) static int snd_mtpav_output_close(struct snd_rawmidi_substream *substream)
{ {
unsigned long flags; unsigned long flags;
mtpav_port_t *portp = &mtp_card->ports[substream->number]; mtpav_port_t *portp = &mtp_card->ports[substream->number];
...@@ -479,7 +479,7 @@ static int snd_mtpav_output_close(snd_rawmidi_substream_t * substream) ...@@ -479,7 +479,7 @@ static int snd_mtpav_output_close(snd_rawmidi_substream_t * substream)
/* /*
*/ */
static void snd_mtpav_output_trigger(snd_rawmidi_substream_t * substream, int up) static void snd_mtpav_output_trigger(struct snd_rawmidi_substream *substream, int up)
{ {
unsigned long flags; unsigned long flags;
mtpav_port_t *portp = &mtp_card->ports[substream->number]; mtpav_port_t *portp = &mtp_card->ports[substream->number];
...@@ -611,13 +611,13 @@ static int snd_mtpav_get_ISA(mtpav_t * mcard) ...@@ -611,13 +611,13 @@ static int snd_mtpav_get_ISA(mtpav_t * mcard)
/* /*
*/ */
static snd_rawmidi_ops_t snd_mtpav_output = { static struct snd_rawmidi_ops snd_mtpav_output = {
.open = snd_mtpav_output_open, .open = snd_mtpav_output_open,
.close = snd_mtpav_output_close, .close = snd_mtpav_output_close,
.trigger = snd_mtpav_output_trigger, .trigger = snd_mtpav_output_trigger,
}; };
static snd_rawmidi_ops_t snd_mtpav_input = { static struct snd_rawmidi_ops snd_mtpav_input = {
.open = snd_mtpav_input_open, .open = snd_mtpav_input_open,
.close = snd_mtpav_input_close, .close = snd_mtpav_input_close,
.trigger = snd_mtpav_input_trigger, .trigger = snd_mtpav_input_trigger,
...@@ -628,7 +628,7 @@ static snd_rawmidi_ops_t snd_mtpav_input = { ...@@ -628,7 +628,7 @@ static snd_rawmidi_ops_t snd_mtpav_input = {
* get RAWMIDI resources * get RAWMIDI resources
*/ */
static void snd_mtpav_set_name(mtpav_t *chip, snd_rawmidi_substream_t *substream) static void snd_mtpav_set_name(mtpav_t *chip, struct snd_rawmidi_substream *substream)
{ {
if (substream->number >= 0 && substream->number < chip->num_ports) if (substream->number >= 0 && substream->number < chip->num_ports)
sprintf(substream->name, "MTP direct %d", (substream->number % chip->num_ports) + 1); sprintf(substream->name, "MTP direct %d", (substream->number % chip->num_ports) + 1);
...@@ -645,8 +645,8 @@ static void snd_mtpav_set_name(mtpav_t *chip, snd_rawmidi_substream_t *substream ...@@ -645,8 +645,8 @@ static void snd_mtpav_set_name(mtpav_t *chip, snd_rawmidi_substream_t *substream
static int snd_mtpav_get_RAWMIDI(mtpav_t * mcard) static int snd_mtpav_get_RAWMIDI(mtpav_t * mcard)
{ {
int rval = 0; int rval = 0;
snd_rawmidi_t *rawmidi; struct snd_rawmidi *rawmidi;
snd_rawmidi_substream_t *substream; struct snd_rawmidi_substream *substream;
struct list_head *list; struct list_head *list;
//printk("entering snd_mtpav_get_RAWMIDI\n"); //printk("entering snd_mtpav_get_RAWMIDI\n");
...@@ -666,12 +666,12 @@ static int snd_mtpav_get_RAWMIDI(mtpav_t * mcard) ...@@ -666,12 +666,12 @@ static int snd_mtpav_get_RAWMIDI(mtpav_t * mcard)
rawmidi = mcard->rmidi; rawmidi = mcard->rmidi;
list_for_each(list, &rawmidi->streams[SNDRV_RAWMIDI_STREAM_INPUT].substreams) { list_for_each(list, &rawmidi->streams[SNDRV_RAWMIDI_STREAM_INPUT].substreams) {
substream = list_entry(list, snd_rawmidi_substream_t, list); substream = list_entry(list, struct snd_rawmidi_substream, list);
snd_mtpav_set_name(mcard, substream); snd_mtpav_set_name(mcard, substream);
substream->ops = &snd_mtpav_input; substream->ops = &snd_mtpav_input;
} }
list_for_each(list, &rawmidi->streams[SNDRV_RAWMIDI_STREAM_OUTPUT].substreams) { list_for_each(list, &rawmidi->streams[SNDRV_RAWMIDI_STREAM_OUTPUT].substreams) {
substream = list_entry(list, snd_rawmidi_substream_t, list); substream = list_entry(list, struct snd_rawmidi_substream, list);
snd_mtpav_set_name(mcard, substream); snd_mtpav_set_name(mcard, substream);
substream->ops = &snd_mtpav_output; substream->ops = &snd_mtpav_output;
mcard->ports[substream->number].hwport = translate_subdevice_to_hwport(mcard, substream->number); mcard->ports[substream->number].hwport = translate_subdevice_to_hwport(mcard, substream->number);
......
...@@ -116,10 +116,10 @@ MODULE_PARM_DESC(adaptor, "Type of adaptor."); ...@@ -116,10 +116,10 @@ MODULE_PARM_DESC(adaptor, "Type of adaptor.");
#define SERIAL_MODE_OUTPUT_TRIGGERED (1 << 3) #define SERIAL_MODE_OUTPUT_TRIGGERED (1 << 3)
typedef struct _snd_uart16550 { typedef struct _snd_uart16550 {
snd_card_t *card; struct snd_card *card;
snd_rawmidi_t *rmidi; struct snd_rawmidi *rmidi;
snd_rawmidi_substream_t *midi_output[SNDRV_SERIAL_MAX_OUTS]; struct snd_rawmidi_substream *midi_output[SNDRV_SERIAL_MAX_OUTS];
snd_rawmidi_substream_t *midi_input[SNDRV_SERIAL_MAX_INS]; struct snd_rawmidi_substream *midi_input[SNDRV_SERIAL_MAX_INS];
int filemode; //open status of file int filemode; //open status of file
...@@ -166,7 +166,7 @@ typedef struct _snd_uart16550 { ...@@ -166,7 +166,7 @@ typedef struct _snd_uart16550 {
} snd_uart16550_t; } snd_uart16550_t;
static snd_card_t *snd_serial_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR; static struct snd_card *snd_serial_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR;
static inline void snd_uart16550_add_timer(snd_uart16550_t *uart) static inline void snd_uart16550_add_timer(snd_uart16550_t *uart)
{ {
...@@ -509,7 +509,7 @@ static void snd_uart16550_do_close(snd_uart16550_t * uart) ...@@ -509,7 +509,7 @@ static void snd_uart16550_do_close(snd_uart16550_t * uart)
} }
} }
static int snd_uart16550_input_open(snd_rawmidi_substream_t * substream) static int snd_uart16550_input_open(struct snd_rawmidi_substream *substream)
{ {
unsigned long flags; unsigned long flags;
snd_uart16550_t *uart = substream->rmidi->private_data; snd_uart16550_t *uart = substream->rmidi->private_data;
...@@ -523,7 +523,7 @@ static int snd_uart16550_input_open(snd_rawmidi_substream_t * substream) ...@@ -523,7 +523,7 @@ static int snd_uart16550_input_open(snd_rawmidi_substream_t * substream)
return 0; return 0;
} }
static int snd_uart16550_input_close(snd_rawmidi_substream_t * substream) static int snd_uart16550_input_close(struct snd_rawmidi_substream *substream)
{ {
unsigned long flags; unsigned long flags;
snd_uart16550_t *uart = substream->rmidi->private_data; snd_uart16550_t *uart = substream->rmidi->private_data;
...@@ -537,7 +537,7 @@ static int snd_uart16550_input_close(snd_rawmidi_substream_t * substream) ...@@ -537,7 +537,7 @@ static int snd_uart16550_input_close(snd_rawmidi_substream_t * substream)
return 0; return 0;
} }
static void snd_uart16550_input_trigger(snd_rawmidi_substream_t * substream, int up) static void snd_uart16550_input_trigger(struct snd_rawmidi_substream *substream, int up)
{ {
unsigned long flags; unsigned long flags;
snd_uart16550_t *uart = substream->rmidi->private_data; snd_uart16550_t *uart = substream->rmidi->private_data;
...@@ -551,7 +551,7 @@ static void snd_uart16550_input_trigger(snd_rawmidi_substream_t * substream, int ...@@ -551,7 +551,7 @@ static void snd_uart16550_input_trigger(snd_rawmidi_substream_t * substream, int
spin_unlock_irqrestore(&uart->open_lock, flags); spin_unlock_irqrestore(&uart->open_lock, flags);
} }
static int snd_uart16550_output_open(snd_rawmidi_substream_t * substream) static int snd_uart16550_output_open(struct snd_rawmidi_substream *substream)
{ {
unsigned long flags; unsigned long flags;
snd_uart16550_t *uart = substream->rmidi->private_data; snd_uart16550_t *uart = substream->rmidi->private_data;
...@@ -565,7 +565,7 @@ static int snd_uart16550_output_open(snd_rawmidi_substream_t * substream) ...@@ -565,7 +565,7 @@ static int snd_uart16550_output_open(snd_rawmidi_substream_t * substream)
return 0; return 0;
}; };
static int snd_uart16550_output_close(snd_rawmidi_substream_t * substream) static int snd_uart16550_output_close(struct snd_rawmidi_substream *substream)
{ {
unsigned long flags; unsigned long flags;
snd_uart16550_t *uart = substream->rmidi->private_data; snd_uart16550_t *uart = substream->rmidi->private_data;
...@@ -603,7 +603,7 @@ static inline int snd_uart16550_write_buffer(snd_uart16550_t *uart, unsigned cha ...@@ -603,7 +603,7 @@ static inline int snd_uart16550_write_buffer(snd_uart16550_t *uart, unsigned cha
return 0; return 0;
} }
static int snd_uart16550_output_byte(snd_uart16550_t *uart, snd_rawmidi_substream_t * substream, unsigned char midi_byte) static int snd_uart16550_output_byte(snd_uart16550_t *uart, struct snd_rawmidi_substream *substream, unsigned char midi_byte)
{ {
if (uart->buff_in_count == 0 /* Buffer empty? */ if (uart->buff_in_count == 0 /* Buffer empty? */
&& ((uart->adaptor != SNDRV_SERIAL_MS124W_SA && && ((uart->adaptor != SNDRV_SERIAL_MS124W_SA &&
...@@ -636,7 +636,7 @@ static int snd_uart16550_output_byte(snd_uart16550_t *uart, snd_rawmidi_substrea ...@@ -636,7 +636,7 @@ static int snd_uart16550_output_byte(snd_uart16550_t *uart, snd_rawmidi_substrea
return 1; return 1;
} }
static void snd_uart16550_output_write(snd_rawmidi_substream_t * substream) static void snd_uart16550_output_write(struct snd_rawmidi_substream *substream)
{ {
unsigned long flags; unsigned long flags;
unsigned char midi_byte, addr_byte; unsigned char midi_byte, addr_byte;
...@@ -715,7 +715,7 @@ static void snd_uart16550_output_write(snd_rawmidi_substream_t * substream) ...@@ -715,7 +715,7 @@ static void snd_uart16550_output_write(snd_rawmidi_substream_t * substream)
spin_unlock_irqrestore(&uart->open_lock, flags); spin_unlock_irqrestore(&uart->open_lock, flags);
} }
static void snd_uart16550_output_trigger(snd_rawmidi_substream_t * substream, int up) static void snd_uart16550_output_trigger(struct snd_rawmidi_substream *substream, int up)
{ {
unsigned long flags; unsigned long flags;
snd_uart16550_t *uart = substream->rmidi->private_data; snd_uart16550_t *uart = substream->rmidi->private_data;
...@@ -731,14 +731,14 @@ static void snd_uart16550_output_trigger(snd_rawmidi_substream_t * substream, in ...@@ -731,14 +731,14 @@ static void snd_uart16550_output_trigger(snd_rawmidi_substream_t * substream, in
snd_uart16550_output_write(substream); snd_uart16550_output_write(substream);
} }
static snd_rawmidi_ops_t snd_uart16550_output = static struct snd_rawmidi_ops snd_uart16550_output =
{ {
.open = snd_uart16550_output_open, .open = snd_uart16550_output_open,
.close = snd_uart16550_output_close, .close = snd_uart16550_output_close,
.trigger = snd_uart16550_output_trigger, .trigger = snd_uart16550_output_trigger,
}; };
static snd_rawmidi_ops_t snd_uart16550_input = static struct snd_rawmidi_ops snd_uart16550_input =
{ {
.open = snd_uart16550_input_open, .open = snd_uart16550_input_open,
.close = snd_uart16550_input_close, .close = snd_uart16550_input_close,
...@@ -754,13 +754,13 @@ static int snd_uart16550_free(snd_uart16550_t *uart) ...@@ -754,13 +754,13 @@ static int snd_uart16550_free(snd_uart16550_t *uart)
return 0; return 0;
}; };
static int snd_uart16550_dev_free(snd_device_t *device) static int snd_uart16550_dev_free(struct snd_device *device)
{ {
snd_uart16550_t *uart = device->device_data; snd_uart16550_t *uart = device->device_data;
return snd_uart16550_free(uart); return snd_uart16550_free(uart);
} }
static int __init snd_uart16550_create(snd_card_t * card, static int __init snd_uart16550_create(struct snd_card *card,
unsigned long iobase, unsigned long iobase,
int irq, int irq,
unsigned int speed, unsigned int speed,
...@@ -769,7 +769,7 @@ static int __init snd_uart16550_create(snd_card_t * card, ...@@ -769,7 +769,7 @@ static int __init snd_uart16550_create(snd_card_t * card,
int droponfull, int droponfull,
snd_uart16550_t **ruart) snd_uart16550_t **ruart)
{ {
static snd_device_ops_t ops = { static struct snd_device_ops ops = {
.dev_free = snd_uart16550_dev_free, .dev_free = snd_uart16550_dev_free,
}; };
snd_uart16550_t *uart; snd_uart16550_t *uart;
...@@ -838,19 +838,19 @@ static int __init snd_uart16550_create(snd_card_t * card, ...@@ -838,19 +838,19 @@ static int __init snd_uart16550_create(snd_card_t * card,
return 0; return 0;
} }
static void __init snd_uart16550_substreams(snd_rawmidi_str_t *stream) static void __init snd_uart16550_substreams(struct snd_rawmidi_str *stream)
{ {
struct list_head *list; struct list_head *list;
list_for_each(list, &stream->substreams) { list_for_each(list, &stream->substreams) {
snd_rawmidi_substream_t *substream = list_entry(list, snd_rawmidi_substream_t, list); struct snd_rawmidi_substream *substream = list_entry(list, struct snd_rawmidi_substream, list);
sprintf(substream->name, "Serial MIDI %d", substream->number + 1); sprintf(substream->name, "Serial MIDI %d", substream->number + 1);
} }
} }
static int __init snd_uart16550_rmidi(snd_uart16550_t *uart, int device, int outs, int ins, snd_rawmidi_t **rmidi) static int __init snd_uart16550_rmidi(snd_uart16550_t *uart, int device, int outs, int ins, struct snd_rawmidi **rmidi)
{ {
snd_rawmidi_t *rrawmidi; struct snd_rawmidi *rrawmidi;
int err; int err;
if ((err = snd_rawmidi_new(uart->card, "UART Serial MIDI", device, outs, ins, &rrawmidi)) < 0) if ((err = snd_rawmidi_new(uart->card, "UART Serial MIDI", device, outs, ins, &rrawmidi)) < 0)
...@@ -871,7 +871,7 @@ static int __init snd_uart16550_rmidi(snd_uart16550_t *uart, int device, int out ...@@ -871,7 +871,7 @@ static int __init snd_uart16550_rmidi(snd_uart16550_t *uart, int device, int out
static int __init snd_serial_probe(int dev) static int __init snd_serial_probe(int dev)
{ {
snd_card_t *card; struct snd_card *card;
snd_uart16550_t *uart; snd_uart16550_t *uart;
int err; int err;
......
...@@ -75,17 +75,17 @@ MODULE_PARM_DESC(enable, "Enable this soundcard."); ...@@ -75,17 +75,17 @@ MODULE_PARM_DESC(enable, "Enable this soundcard.");
module_param_array(midi_devs, int, NULL, 0444); module_param_array(midi_devs, int, NULL, 0444);
MODULE_PARM_DESC(midi_devs, "MIDI devices # (1-8)"); MODULE_PARM_DESC(midi_devs, "MIDI devices # (1-8)");
typedef struct snd_card_virmidi { struct snd_card_virmidi {
snd_card_t *card; struct snd_card *card;
snd_rawmidi_t *midi[MAX_MIDI_DEVICES]; struct snd_rawmidi *midi[MAX_MIDI_DEVICES];
} snd_card_virmidi_t; };
static snd_card_t *snd_virmidi_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR; static struct snd_card *snd_virmidi_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR;
static int __init snd_card_virmidi_probe(int dev) static int __init snd_card_virmidi_probe(int dev)
{ {
snd_card_t *card; struct snd_card *card;
struct snd_card_virmidi *vmidi; struct snd_card_virmidi *vmidi;
int idx, err; int idx, err;
...@@ -103,8 +103,8 @@ static int __init snd_card_virmidi_probe(int dev) ...@@ -103,8 +103,8 @@ static int __init snd_card_virmidi_probe(int dev)
midi_devs[dev] = MAX_MIDI_DEVICES; midi_devs[dev] = MAX_MIDI_DEVICES;
} }
for (idx = 0; idx < midi_devs[dev]; idx++) { for (idx = 0; idx < midi_devs[dev]; idx++) {
snd_rawmidi_t *rmidi; struct snd_rawmidi *rmidi;
snd_virmidi_dev_t *rdev; struct snd_virmidi_dev *rdev;
if ((err = snd_virmidi_new(card, idx, &rmidi)) < 0) if ((err = snd_virmidi_new(card, idx, &rmidi)) < 0)
goto __nodev; goto __nodev;
rdev = rmidi->private_data; rdev = rmidi->private_data;
......
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