aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/hwdep.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2005-11-17 07:58:21 -0500
committerJaroslav Kysela <perex@suse.cz>2006-01-03 06:17:38 -0500
commitd9a98de218ce18befabb5782c43cb4a2766b4b02 (patch)
tree4fbacff1ed8122c4a6a6d2d281b62203987e0a47 /sound/core/hwdep.c
parent48c9d417d7269da2a2da5b602fcb5fdbee36305e (diff)
[ALSA] Remove xxx_t typedefs: Hwdep
Modules: HWDEP Midlevel Remove xxx_t typedefs from the core hwdep codes. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core/hwdep.c')
-rw-r--r--sound/core/hwdep.c90
1 files changed, 49 insertions, 41 deletions
diff --git a/sound/core/hwdep.c b/sound/core/hwdep.c
index e91cee35a4b..da0fb9f0841 100644
--- a/sound/core/hwdep.c
+++ b/sound/core/hwdep.c
@@ -35,14 +35,14 @@ MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
35MODULE_DESCRIPTION("Hardware dependent layer"); 35MODULE_DESCRIPTION("Hardware dependent layer");
36MODULE_LICENSE("GPL"); 36MODULE_LICENSE("GPL");
37 37
38static snd_hwdep_t *snd_hwdep_devices[SNDRV_CARDS * SNDRV_MINOR_HWDEPS]; 38static struct snd_hwdep *snd_hwdep_devices[SNDRV_CARDS * SNDRV_MINOR_HWDEPS];
39 39
40static DECLARE_MUTEX(register_mutex); 40static DECLARE_MUTEX(register_mutex);
41 41
42static int snd_hwdep_free(snd_hwdep_t *hwdep); 42static int snd_hwdep_free(struct snd_hwdep *hwdep);
43static int snd_hwdep_dev_free(snd_device_t *device); 43static int snd_hwdep_dev_free(struct snd_device *device);
44static int snd_hwdep_dev_register(snd_device_t *device); 44static int snd_hwdep_dev_register(struct snd_device *device);
45static int snd_hwdep_dev_unregister(snd_device_t *device); 45static int snd_hwdep_dev_unregister(struct snd_device *device);
46 46
47/* 47/*
48 48
@@ -50,23 +50,25 @@ static int snd_hwdep_dev_unregister(snd_device_t *device);
50 50
51static loff_t snd_hwdep_llseek(struct file * file, loff_t offset, int orig) 51static loff_t snd_hwdep_llseek(struct file * file, loff_t offset, int orig)
52{ 52{
53 snd_hwdep_t *hw = file->private_data; 53 struct snd_hwdep *hw = file->private_data;
54 if (hw->ops.llseek) 54 if (hw->ops.llseek)
55 return hw->ops.llseek(hw, file, offset, orig); 55 return hw->ops.llseek(hw, file, offset, orig);
56 return -ENXIO; 56 return -ENXIO;
57} 57}
58 58
59static ssize_t snd_hwdep_read(struct file * file, char __user *buf, size_t count, loff_t *offset) 59static ssize_t snd_hwdep_read(struct file * file, char __user *buf,
60 size_t count, loff_t *offset)
60{ 61{
61 snd_hwdep_t *hw = file->private_data; 62 struct snd_hwdep *hw = file->private_data;
62 if (hw->ops.read) 63 if (hw->ops.read)
63 return hw->ops.read(hw, buf, count, offset); 64 return hw->ops.read(hw, buf, count, offset);
64 return -ENXIO; 65 return -ENXIO;
65} 66}
66 67
67static ssize_t snd_hwdep_write(struct file * file, const char __user *buf, size_t count, loff_t *offset) 68static ssize_t snd_hwdep_write(struct file * file, const char __user *buf,
69 size_t count, loff_t *offset)
68{ 70{
69 snd_hwdep_t *hw = file->private_data; 71 struct snd_hwdep *hw = file->private_data;
70 if (hw->ops.write) 72 if (hw->ops.write)
71 return hw->ops.write(hw, buf, count, offset); 73 return hw->ops.write(hw, buf, count, offset);
72 return -ENXIO; 74 return -ENXIO;
@@ -77,7 +79,7 @@ static int snd_hwdep_open(struct inode *inode, struct file * file)
77 int major = imajor(inode); 79 int major = imajor(inode);
78 int cardnum; 80 int cardnum;
79 int device; 81 int device;
80 snd_hwdep_t *hw; 82 struct snd_hwdep *hw;
81 int err; 83 int err;
82 wait_queue_t wait; 84 wait_queue_t wait;
83 85
@@ -154,7 +156,7 @@ static int snd_hwdep_open(struct inode *inode, struct file * file)
154static int snd_hwdep_release(struct inode *inode, struct file * file) 156static int snd_hwdep_release(struct inode *inode, struct file * file)
155{ 157{
156 int err = -ENXIO; 158 int err = -ENXIO;
157 snd_hwdep_t *hw = file->private_data; 159 struct snd_hwdep *hw = file->private_data;
158 down(&hw->open_mutex); 160 down(&hw->open_mutex);
159 if (hw->ops.release) { 161 if (hw->ops.release) {
160 err = hw->ops.release(hw, file); 162 err = hw->ops.release(hw, file);
@@ -170,15 +172,16 @@ static int snd_hwdep_release(struct inode *inode, struct file * file)
170 172
171static unsigned int snd_hwdep_poll(struct file * file, poll_table * wait) 173static unsigned int snd_hwdep_poll(struct file * file, poll_table * wait)
172{ 174{
173 snd_hwdep_t *hw = file->private_data; 175 struct snd_hwdep *hw = file->private_data;
174 if (hw->ops.poll) 176 if (hw->ops.poll)
175 return hw->ops.poll(hw, file, wait); 177 return hw->ops.poll(hw, file, wait);
176 return 0; 178 return 0;
177} 179}
178 180
179static int snd_hwdep_info(snd_hwdep_t *hw, snd_hwdep_info_t __user *_info) 181static int snd_hwdep_info(struct snd_hwdep *hw,
182 struct snd_hwdep_info __user *_info)
180{ 183{
181 snd_hwdep_info_t info; 184 struct snd_hwdep_info info;
182 185
183 memset(&info, 0, sizeof(info)); 186 memset(&info, 0, sizeof(info));
184 info.card = hw->card->number; 187 info.card = hw->card->number;
@@ -190,9 +193,10 @@ static int snd_hwdep_info(snd_hwdep_t *hw, snd_hwdep_info_t __user *_info)
190 return 0; 193 return 0;
191} 194}
192 195
193static int snd_hwdep_dsp_status(snd_hwdep_t *hw, snd_hwdep_dsp_status_t __user *_info) 196static int snd_hwdep_dsp_status(struct snd_hwdep *hw,
197 struct snd_hwdep_dsp_status __user *_info)
194{ 198{
195 snd_hwdep_dsp_status_t info; 199 struct snd_hwdep_dsp_status info;
196 int err; 200 int err;
197 201
198 if (! hw->ops.dsp_status) 202 if (! hw->ops.dsp_status)
@@ -206,9 +210,10 @@ static int snd_hwdep_dsp_status(snd_hwdep_t *hw, snd_hwdep_dsp_status_t __user *
206 return 0; 210 return 0;
207} 211}
208 212
209static int snd_hwdep_dsp_load(snd_hwdep_t *hw, snd_hwdep_dsp_image_t __user *_info) 213static int snd_hwdep_dsp_load(struct snd_hwdep *hw,
214 struct snd_hwdep_dsp_image __user *_info)
210{ 215{
211 snd_hwdep_dsp_image_t info; 216 struct snd_hwdep_dsp_image info;
212 int err; 217 int err;
213 218
214 if (! hw->ops.dsp_load) 219 if (! hw->ops.dsp_load)
@@ -228,9 +233,10 @@ static int snd_hwdep_dsp_load(snd_hwdep_t *hw, snd_hwdep_dsp_image_t __user *_in
228 return 0; 233 return 0;
229} 234}
230 235
231static long snd_hwdep_ioctl(struct file * file, unsigned int cmd, unsigned long arg) 236static long snd_hwdep_ioctl(struct file * file, unsigned int cmd,
237 unsigned long arg)
232{ 238{
233 snd_hwdep_t *hw = file->private_data; 239 struct snd_hwdep *hw = file->private_data;
234 void __user *argp = (void __user *)arg; 240 void __user *argp = (void __user *)arg;
235 switch (cmd) { 241 switch (cmd) {
236 case SNDRV_HWDEP_IOCTL_PVERSION: 242 case SNDRV_HWDEP_IOCTL_PVERSION:
@@ -249,13 +255,14 @@ static long snd_hwdep_ioctl(struct file * file, unsigned int cmd, unsigned long
249 255
250static int snd_hwdep_mmap(struct file * file, struct vm_area_struct * vma) 256static int snd_hwdep_mmap(struct file * file, struct vm_area_struct * vma)
251{ 257{
252 snd_hwdep_t *hw = file->private_data; 258 struct snd_hwdep *hw = file->private_data;
253 if (hw->ops.mmap) 259 if (hw->ops.mmap)
254 return hw->ops.mmap(hw, file, vma); 260 return hw->ops.mmap(hw, file, vma);
255 return -ENXIO; 261 return -ENXIO;
256} 262}
257 263
258static int snd_hwdep_control_ioctl(snd_card_t * card, snd_ctl_file_t * control, 264static int snd_hwdep_control_ioctl(struct snd_card *card,
265 struct snd_ctl_file * control,
259 unsigned int cmd, unsigned long arg) 266 unsigned int cmd, unsigned long arg)
260{ 267{
261 unsigned int tmp; 268 unsigned int tmp;
@@ -282,9 +289,9 @@ static int snd_hwdep_control_ioctl(snd_card_t * card, snd_ctl_file_t * control,
282 } 289 }
283 case SNDRV_CTL_IOCTL_HWDEP_INFO: 290 case SNDRV_CTL_IOCTL_HWDEP_INFO:
284 { 291 {
285 snd_hwdep_info_t __user *info = (snd_hwdep_info_t __user *)arg; 292 struct snd_hwdep_info __user *info = (struct snd_hwdep_info __user *)arg;
286 int device; 293 int device;
287 snd_hwdep_t *hwdep; 294 struct snd_hwdep *hwdep;
288 295
289 if (get_user(device, &info->device)) 296 if (get_user(device, &info->device))
290 return -EFAULT; 297 return -EFAULT;
@@ -323,7 +330,7 @@ static struct file_operations snd_hwdep_f_ops =
323 .mmap = snd_hwdep_mmap, 330 .mmap = snd_hwdep_mmap,
324}; 331};
325 332
326static snd_minor_t snd_hwdep_reg = 333static struct snd_minor snd_hwdep_reg =
327{ 334{
328 .comment = "hardware dependent", 335 .comment = "hardware dependent",
329 .f_ops = &snd_hwdep_f_ops, 336 .f_ops = &snd_hwdep_f_ops,
@@ -342,11 +349,12 @@ static snd_minor_t snd_hwdep_reg =
342 * 349 *
343 * Returns zero if successful, or a negative error code on failure. 350 * Returns zero if successful, or a negative error code on failure.
344 */ 351 */
345int snd_hwdep_new(snd_card_t * card, char *id, int device, snd_hwdep_t ** rhwdep) 352int snd_hwdep_new(struct snd_card *card, char *id, int device,
353 struct snd_hwdep **rhwdep)
346{ 354{
347 snd_hwdep_t *hwdep; 355 struct snd_hwdep *hwdep;
348 int err; 356 int err;
349 static snd_device_ops_t ops = { 357 static struct snd_device_ops ops = {
350 .dev_free = snd_hwdep_dev_free, 358 .dev_free = snd_hwdep_dev_free,
351 .dev_register = snd_hwdep_dev_register, 359 .dev_register = snd_hwdep_dev_register,
352 .dev_unregister = snd_hwdep_dev_unregister 360 .dev_unregister = snd_hwdep_dev_unregister
@@ -376,7 +384,7 @@ int snd_hwdep_new(snd_card_t * card, char *id, int device, snd_hwdep_t ** rhwdep
376 return 0; 384 return 0;
377} 385}
378 386
379static int snd_hwdep_free(snd_hwdep_t *hwdep) 387static int snd_hwdep_free(struct snd_hwdep *hwdep)
380{ 388{
381 snd_assert(hwdep != NULL, return -ENXIO); 389 snd_assert(hwdep != NULL, return -ENXIO);
382 if (hwdep->private_free) 390 if (hwdep->private_free)
@@ -385,15 +393,15 @@ static int snd_hwdep_free(snd_hwdep_t *hwdep)
385 return 0; 393 return 0;
386} 394}
387 395
388static int snd_hwdep_dev_free(snd_device_t *device) 396static int snd_hwdep_dev_free(struct snd_device *device)
389{ 397{
390 snd_hwdep_t *hwdep = device->device_data; 398 struct snd_hwdep *hwdep = device->device_data;
391 return snd_hwdep_free(hwdep); 399 return snd_hwdep_free(hwdep);
392} 400}
393 401
394static int snd_hwdep_dev_register(snd_device_t *device) 402static int snd_hwdep_dev_register(struct snd_device *device)
395{ 403{
396 snd_hwdep_t *hwdep = device->device_data; 404 struct snd_hwdep *hwdep = device->device_data;
397 int idx, err; 405 int idx, err;
398 char name[32]; 406 char name[32];
399 407
@@ -434,9 +442,9 @@ static int snd_hwdep_dev_register(snd_device_t *device)
434 return 0; 442 return 0;
435} 443}
436 444
437static int snd_hwdep_dev_unregister(snd_device_t *device) 445static int snd_hwdep_dev_unregister(struct snd_device *device)
438{ 446{
439 snd_hwdep_t *hwdep = device->device_data; 447 struct snd_hwdep *hwdep = device->device_data;
440 int idx; 448 int idx;
441 449
442 snd_assert(hwdep != NULL, return -ENXIO); 450 snd_assert(hwdep != NULL, return -ENXIO);
@@ -460,11 +468,11 @@ static int snd_hwdep_dev_unregister(snd_device_t *device)
460 * Info interface 468 * Info interface
461 */ 469 */
462 470
463static void snd_hwdep_proc_read(snd_info_entry_t *entry, 471static void snd_hwdep_proc_read(struct snd_info_entry *entry,
464 snd_info_buffer_t * buffer) 472 struct snd_info_buffer *buffer)
465{ 473{
466 int idx; 474 int idx;
467 snd_hwdep_t *hwdep; 475 struct snd_hwdep *hwdep;
468 476
469 down(&register_mutex); 477 down(&register_mutex);
470 for (idx = 0; idx < SNDRV_CARDS * SNDRV_MINOR_HWDEPS; idx++) { 478 for (idx = 0; idx < SNDRV_CARDS * SNDRV_MINOR_HWDEPS; idx++) {
@@ -483,11 +491,11 @@ static void snd_hwdep_proc_read(snd_info_entry_t *entry,
483 * ENTRY functions 491 * ENTRY functions
484 */ 492 */
485 493
486static snd_info_entry_t *snd_hwdep_proc_entry = NULL; 494static struct snd_info_entry *snd_hwdep_proc_entry = NULL;
487 495
488static int __init alsa_hwdep_init(void) 496static int __init alsa_hwdep_init(void)
489{ 497{
490 snd_info_entry_t *entry; 498 struct snd_info_entry *entry;
491 499
492 memset(snd_hwdep_devices, 0, sizeof(snd_hwdep_devices)); 500 memset(snd_hwdep_devices, 0, sizeof(snd_hwdep_devices));
493 if ((entry = snd_info_create_module_entry(THIS_MODULE, "hwdep", NULL)) != NULL) { 501 if ((entry = snd_info_create_module_entry(THIS_MODULE, "hwdep", NULL)) != NULL) {