Skip to content

Commit 4a4d2cf

Browse files
tiwaiJaroslav Kysela
authored andcommitted
[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: Takashi Iwai <tiwai@suse.de>
1 parent 03da312 commit 4a4d2cf

4 files changed

Lines changed: 115 additions & 109 deletions

File tree

‎sound/drivers/dummy.c‎

Lines changed: 65 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ MODULE_SUPPORTED_DEVICE("{{ALSA,Dummy soundcard}}");
4242

4343
#if 0 /* emu10k1 emulation */
4444
#define MAX_BUFFER_SIZE (128 * 1024)
45-
static int emu10k1_playback_constraints(snd_pcm_runtime_t *runtime)
45+
static int emu10k1_playback_constraints(struct snd_pcm_runtime *runtime)
4646
{
4747
int err;
4848
if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0)
@@ -149,15 +149,15 @@ MODULE_PARM_DESC(pcm_substreams, "PCM substreams # (1-16) for dummy driver.");
149149
#define MIXER_ADDR_CD 4
150150
#define MIXER_ADDR_LAST 4
151151

152-
typedef struct snd_card_dummy {
153-
snd_card_t *card;
152+
struct snd_dummy {
153+
struct snd_card *card;
154154
spinlock_t mixer_lock;
155155
int mixer_volume[MIXER_ADDR_LAST+1][2];
156156
int capture_source[MIXER_ADDR_LAST+1][2];
157-
} snd_card_dummy_t;
157+
};
158158

159-
typedef struct snd_card_dummy_pcm {
160-
snd_card_dummy_t *dummy;
159+
struct snd_dummy_pcm {
160+
struct snd_dummy *dummy;
161161
spinlock_t lock;
162162
struct timer_list timer;
163163
unsigned int pcm_size;
@@ -166,27 +166,27 @@ typedef struct snd_card_dummy_pcm {
166166
unsigned int pcm_jiffie; /* bytes per one jiffie */
167167
unsigned int pcm_irq_pos; /* IRQ position */
168168
unsigned int pcm_buf_pos; /* position in buffer */
169-
snd_pcm_substream_t *substream;
170-
} snd_card_dummy_pcm_t;
169+
struct snd_pcm_substream *substream;
170+
};
171171

172-
static snd_card_t *snd_dummy_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR;
172+
static struct snd_card *snd_dummy_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR;
173173

174174

175-
static inline void snd_card_dummy_pcm_timer_start(snd_card_dummy_pcm_t *dpcm)
175+
static inline void snd_card_dummy_pcm_timer_start(struct snd_dummy_pcm *dpcm)
176176
{
177177
dpcm->timer.expires = 1 + jiffies;
178178
add_timer(&dpcm->timer);
179179
}
180180

181-
static inline void snd_card_dummy_pcm_timer_stop(snd_card_dummy_pcm_t *dpcm)
181+
static inline void snd_card_dummy_pcm_timer_stop(struct snd_dummy_pcm *dpcm)
182182
{
183183
del_timer(&dpcm->timer);
184184
}
185185

186-
static int snd_card_dummy_pcm_trigger(snd_pcm_substream_t *substream, int cmd)
186+
static int snd_card_dummy_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
187187
{
188-
snd_pcm_runtime_t *runtime = substream->runtime;
189-
snd_dummy_card_pcm_t *dpcm = runtime->private_data;
188+
struct snd_pcm_runtime *runtime = substream->runtime;
189+
struct snd_dummy_pcm *dpcm = runtime->private_data;
190190
int err = 0;
191191

192192
spin_lock(&dpcm->lock);
@@ -201,10 +201,10 @@ static int snd_card_dummy_pcm_trigger(snd_pcm_substream_t *substream, int cmd)
201201
return err;
202202
}
203203

204-
static int snd_card_dummy_pcm_prepare(snd_pcm_substream_t * substream)
204+
static int snd_card_dummy_pcm_prepare(struct snd_pcm_substream *substream)
205205
{
206-
snd_pcm_runtime_t *runtime = substream->runtime;
207-
snd_card_dummy_pcm_t *dpcm = runtime->private_data;
206+
struct snd_pcm_runtime *runtime = substream->runtime;
207+
struct snd_dummy_pcm *dpcm = runtime->private_data;
208208
unsigned int bps;
209209

210210
bps = runtime->rate * runtime->channels;
@@ -223,7 +223,7 @@ static int snd_card_dummy_pcm_prepare(snd_pcm_substream_t * substream)
223223

224224
static void snd_card_dummy_pcm_timer_function(unsigned long data)
225225
{
226-
snd_card_dummy_pcm_t *dpcm = (snd_card_dummy_pcm_t *)data;
226+
struct snd_dummy_pcm *dpcm = (struct snd_dummy_pcm *)data;
227227

228228
spin_lock(&dpcm->lock);
229229
dpcm->timer.expires = 1 + jiffies;
@@ -240,15 +240,15 @@ static void snd_card_dummy_pcm_timer_function(unsigned long data)
240240
spin_unlock(&dpcm->lock);
241241
}
242242

243-
static snd_pcm_uframes_t snd_card_dummy_pcm_pointer(snd_pcm_substream_t * substream)
243+
static snd_pcm_uframes_t snd_card_dummy_pcm_pointer(struct snd_pcm_substream *substream)
244244
{
245-
snd_pcm_runtime_t *runtime = substream->runtime;
246-
snd_card_dummy_pcm_t *dpcm = runtime->private_data;
245+
struct snd_pcm_runtime *runtime = substream->runtime;
246+
struct snd_dummy_pcm *dpcm = runtime->private_data;
247247

248248
return bytes_to_frames(runtime, dpcm->pcm_buf_pos);
249249
}
250250

251-
static snd_pcm_hardware_t snd_card_dummy_playback =
251+
static struct snd_pcm_hardware snd_card_dummy_playback =
252252
{
253253
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
254254
SNDRV_PCM_INFO_MMAP_VALID),
@@ -266,7 +266,7 @@ static snd_pcm_hardware_t snd_card_dummy_playback =
266266
.fifo_size = 0,
267267
};
268268

269-
static snd_pcm_hardware_t snd_card_dummy_capture =
269+
static struct snd_pcm_hardware snd_card_dummy_capture =
270270
{
271271
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
272272
SNDRV_PCM_INFO_MMAP_VALID),
@@ -284,25 +284,25 @@ static snd_pcm_hardware_t snd_card_dummy_capture =
284284
.fifo_size = 0,
285285
};
286286

287-
static void snd_card_dummy_runtime_free(snd_pcm_runtime_t *runtime)
287+
static void snd_card_dummy_runtime_free(struct snd_pcm_runtime *runtime)
288288
{
289289
kfree(runtime->private_data);
290290
}
291291

292-
static int snd_card_dummy_hw_params(snd_pcm_substream_t * substream,
293-
snd_pcm_hw_params_t * hw_params)
292+
static int snd_card_dummy_hw_params(struct snd_pcm_substream *substream,
293+
struct snd_pcm_hw_params *hw_params)
294294
{
295295
return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params));
296296
}
297297

298-
static int snd_card_dummy_hw_free(snd_pcm_substream_t * substream)
298+
static int snd_card_dummy_hw_free(struct snd_pcm_substream *substream)
299299
{
300300
return snd_pcm_lib_free_pages(substream);
301301
}
302302

303-
static snd_card_dummy_pcm_t *new_pcm_stream(snd_pcm_substream_t *substream)
303+
static struct snd_dummy_pcm *new_pcm_stream(struct snd_pcm_substream *substream)
304304
{
305-
snd_card_dummy_pcm_t *dpcm;
305+
struct snd_dummy_pcm *dpcm;
306306

307307
dpcm = kzalloc(sizeof(*dpcm), GFP_KERNEL);
308308
if (! dpcm)
@@ -315,10 +315,10 @@ static snd_card_dummy_pcm_t *new_pcm_stream(snd_pcm_substream_t *substream)
315315
return dpcm;
316316
}
317317

318-
static int snd_card_dummy_playback_open(snd_pcm_substream_t * substream)
318+
static int snd_card_dummy_playback_open(struct snd_pcm_substream *substream)
319319
{
320-
snd_pcm_runtime_t *runtime = substream->runtime;
321-
snd_card_dummy_pcm_t *dpcm;
320+
struct snd_pcm_runtime *runtime = substream->runtime;
321+
struct snd_dummy_pcm *dpcm;
322322
int err;
323323

324324
if ((dpcm = new_pcm_stream(substream)) == NULL)
@@ -340,10 +340,10 @@ static int snd_card_dummy_playback_open(snd_pcm_substream_t * substream)
340340
return 0;
341341
}
342342

343-
static int snd_card_dummy_capture_open(snd_pcm_substream_t * substream)
343+
static int snd_card_dummy_capture_open(struct snd_pcm_substream *substream)
344344
{
345-
snd_pcm_runtime_t *runtime = substream->runtime;
346-
snd_card_dummy_pcm_t *dpcm;
345+
struct snd_pcm_runtime *runtime = substream->runtime;
346+
struct snd_dummy_pcm *dpcm;
347347
int err;
348348

349349
if ((dpcm = new_pcm_stream(substream)) == NULL)
@@ -365,17 +365,17 @@ static int snd_card_dummy_capture_open(snd_pcm_substream_t * substream)
365365
return 0;
366366
}
367367

368-
static int snd_card_dummy_playback_close(snd_pcm_substream_t * substream)
368+
static int snd_card_dummy_playback_close(struct snd_pcm_substream *substream)
369369
{
370370
return 0;
371371
}
372372

373-
static int snd_card_dummy_capture_close(snd_pcm_substream_t * substream)
373+
static int snd_card_dummy_capture_close(struct snd_pcm_substream *substream)
374374
{
375375
return 0;
376376
}
377377

378-
static snd_pcm_ops_t snd_card_dummy_playback_ops = {
378+
static struct snd_pcm_ops snd_card_dummy_playback_ops = {
379379
.open = snd_card_dummy_playback_open,
380380
.close = snd_card_dummy_playback_close,
381381
.ioctl = snd_pcm_lib_ioctl,
@@ -386,7 +386,7 @@ static snd_pcm_ops_t snd_card_dummy_playback_ops = {
386386
.pointer = snd_card_dummy_pcm_pointer,
387387
};
388388

389-
static snd_pcm_ops_t snd_card_dummy_capture_ops = {
389+
static struct snd_pcm_ops snd_card_dummy_capture_ops = {
390390
.open = snd_card_dummy_capture_open,
391391
.close = snd_card_dummy_capture_close,
392392
.ioctl = snd_pcm_lib_ioctl,
@@ -397,12 +397,13 @@ static snd_pcm_ops_t snd_card_dummy_capture_ops = {
397397
.pointer = snd_card_dummy_pcm_pointer,
398398
};
399399

400-
static int __init snd_card_dummy_pcm(snd_card_dummy_t *dummy, int device, int substreams)
400+
static int __init snd_card_dummy_pcm(struct snd_dummy *dummy, int device, int substreams)
401401
{
402-
snd_pcm_t *pcm;
402+
struct snd_pcm *pcm;
403403
int err;
404404

405-
if ((err = snd_pcm_new(dummy->card, "Dummy PCM", device, substreams, substreams, &pcm)) < 0)
405+
if ((err = snd_pcm_new(dummy->card, "Dummy PCM", device,
406+
substreams, substreams, &pcm)) < 0)
406407
return err;
407408
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_card_dummy_playback_ops);
408409
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_card_dummy_capture_ops);
@@ -421,7 +422,8 @@ static int __init snd_card_dummy_pcm(snd_card_dummy_t *dummy, int device, int su
421422
.get = snd_dummy_volume_get, .put = snd_dummy_volume_put, \
422423
.private_value = addr }
423424

424-
static int snd_dummy_volume_info(snd_kcontrol_t * kcontrol, snd_ctl_elem_info_t * uinfo)
425+
static int snd_dummy_volume_info(struct snd_kcontrol *kcontrol,
426+
struct snd_ctl_elem_info *uinfo)
425427
{
426428
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
427429
uinfo->count = 2;
@@ -430,9 +432,10 @@ static int snd_dummy_volume_info(snd_kcontrol_t * kcontrol, snd_ctl_elem_info_t
430432
return 0;
431433
}
432434

433-
static int snd_dummy_volume_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
435+
static int snd_dummy_volume_get(struct snd_kcontrol *kcontrol,
436+
struct snd_ctl_elem_value *ucontrol)
434437
{
435-
snd_card_dummy_t *dummy = snd_kcontrol_chip(kcontrol);
438+
struct snd_dummy *dummy = snd_kcontrol_chip(kcontrol);
436439
int addr = kcontrol->private_value;
437440

438441
spin_lock_irq(&dummy->mixer_lock);
@@ -442,9 +445,10 @@ static int snd_dummy_volume_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t
442445
return 0;
443446
}
444447

445-
static int snd_dummy_volume_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
448+
static int snd_dummy_volume_put(struct snd_kcontrol *kcontrol,
449+
struct snd_ctl_elem_value *ucontrol)
446450
{
447-
snd_card_dummy_t *dummy = snd_kcontrol_chip(kcontrol);
451+
struct snd_dummy *dummy = snd_kcontrol_chip(kcontrol);
448452
int change, addr = kcontrol->private_value;
449453
int left, right;
450454

@@ -473,7 +477,8 @@ static int snd_dummy_volume_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t
473477
.get = snd_dummy_capsrc_get, .put = snd_dummy_capsrc_put, \
474478
.private_value = addr }
475479

476-
static int snd_dummy_capsrc_info(snd_kcontrol_t * kcontrol, snd_ctl_elem_info_t * uinfo)
480+
static int snd_dummy_capsrc_info(struct snd_kcontrol *kcontrol,
481+
struct snd_ctl_elem_info *uinfo)
477482
{
478483
uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
479484
uinfo->count = 2;
@@ -482,9 +487,10 @@ static int snd_dummy_capsrc_info(snd_kcontrol_t * kcontrol, snd_ctl_elem_info_t
482487
return 0;
483488
}
484489

485-
static int snd_dummy_capsrc_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
490+
static int snd_dummy_capsrc_get(struct snd_kcontrol *kcontrol,
491+
struct snd_ctl_elem_value *ucontrol)
486492
{
487-
snd_card_dummy_t *dummy = snd_kcontrol_chip(kcontrol);
493+
struct snd_dummy *dummy = snd_kcontrol_chip(kcontrol);
488494
int addr = kcontrol->private_value;
489495

490496
spin_lock_irq(&dummy->mixer_lock);
@@ -494,9 +500,9 @@ static int snd_dummy_capsrc_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t
494500
return 0;
495501
}
496502

497-
static int snd_dummy_capsrc_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
503+
static int snd_dummy_capsrc_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
498504
{
499-
snd_card_dummy_t *dummy = snd_kcontrol_chip(kcontrol);
505+
struct snd_dummy *dummy = snd_kcontrol_chip(kcontrol);
500506
int change, addr = kcontrol->private_value;
501507
int left, right;
502508

@@ -511,7 +517,7 @@ static int snd_dummy_capsrc_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t
511517
return change;
512518
}
513519

514-
static snd_kcontrol_new_t snd_dummy_controls[] = {
520+
static struct snd_kcontrol_new snd_dummy_controls[] = {
515521
DUMMY_VOLUME("Master Volume", 0, MIXER_ADDR_MASTER),
516522
DUMMY_CAPSRC("Master Capture Switch", 0, MIXER_ADDR_MASTER),
517523
DUMMY_VOLUME("Synth Volume", 0, MIXER_ADDR_SYNTH),
@@ -524,9 +530,9 @@ DUMMY_VOLUME("CD Volume", 0, MIXER_ADDR_CD),
524530
DUMMY_CAPSRC("CD Capture Switch", 0, MIXER_ADDR_MASTER)
525531
};
526532

527-
static int __init snd_card_dummy_new_mixer(snd_card_dummy_t * dummy)
533+
static int __init snd_card_dummy_new_mixer(struct snd_dummy *dummy)
528534
{
529-
snd_card_t *card = dummy->card;
535+
struct snd_card *card = dummy->card;
530536
unsigned int idx;
531537
int err;
532538

@@ -543,17 +549,17 @@ static int __init snd_card_dummy_new_mixer(snd_card_dummy_t * dummy)
543549

544550
static int __init snd_card_dummy_probe(int dev)
545551
{
546-
snd_card_t *card;
547-
struct snd_card_dummy *dummy;
552+
struct snd_card *card;
553+
struct snd_dummy *dummy;
548554
int idx, err;
549555

550556
if (!enable[dev])
551557
return -ENODEV;
552558
card = snd_card_new(index[dev], id[dev], THIS_MODULE,
553-
sizeof(struct snd_card_dummy));
559+
sizeof(struct snd_dummy));
554560
if (card == NULL)
555561
return -ENOMEM;
556-
dummy = (struct snd_card_dummy *)card->private_data;
562+
dummy = card->private_data;
557563
dummy->card = card;
558564
for (idx = 0; idx < MAX_PCM_DEVICES && idx < pcm_devs[dev]; idx++) {
559565
if (pcm_substreams[dev] < 1)

0 commit comments

Comments
 (0)