ak4531_codec.c (85e9ca333d03fbd56b9e123c8456f0d98e20faad) | ak4531_codec.c (da3cec35dd3c31d8706db4bf379372ce70d92118) |
---|---|
1/* 2 * Copyright (c) by Jaroslav Kysela <perex@perex.cz> 3 * Universal routines for AK4531 codec 4 * 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or --- 378 unchanged lines hidden (view full) --- 387{ 388 unsigned int idx; 389 int err; 390 struct snd_ak4531 *ak4531; 391 static struct snd_device_ops ops = { 392 .dev_free = snd_ak4531_dev_free, 393 }; 394 | 1/* 2 * Copyright (c) by Jaroslav Kysela <perex@perex.cz> 3 * Universal routines for AK4531 codec 4 * 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or --- 378 unchanged lines hidden (view full) --- 387{ 388 unsigned int idx; 389 int err; 390 struct snd_ak4531 *ak4531; 391 static struct snd_device_ops ops = { 392 .dev_free = snd_ak4531_dev_free, 393 }; 394 |
395 snd_assert(rak4531 != NULL, return -EINVAL); 396 *rak4531 = NULL; 397 snd_assert(card != NULL && _ak4531 != NULL, return -EINVAL); | 395 if (snd_BUG_ON(!card || !_ak4531)) 396 return -EINVAL; 397 if (rak4531) 398 *rak4531 = NULL; |
398 ak4531 = kzalloc(sizeof(*ak4531), GFP_KERNEL); 399 if (ak4531 == NULL) 400 return -ENOMEM; 401 *ak4531 = *_ak4531; 402 mutex_init(&ak4531->reg_mutex); 403 if ((err = snd_component_add(card, "AK4531")) < 0) { 404 snd_ak4531_free(ak4531); 405 return err; --- 17 unchanged lines hidden (view full) --- 423 if ((err = snd_device_new(card, SNDRV_DEV_CODEC, ak4531, &ops)) < 0) { 424 snd_ak4531_free(ak4531); 425 return err; 426 } 427 428#if 0 429 snd_ak4531_dump(ak4531); 430#endif | 399 ak4531 = kzalloc(sizeof(*ak4531), GFP_KERNEL); 400 if (ak4531 == NULL) 401 return -ENOMEM; 402 *ak4531 = *_ak4531; 403 mutex_init(&ak4531->reg_mutex); 404 if ((err = snd_component_add(card, "AK4531")) < 0) { 405 snd_ak4531_free(ak4531); 406 return err; --- 17 unchanged lines hidden (view full) --- 424 if ((err = snd_device_new(card, SNDRV_DEV_CODEC, ak4531, &ops)) < 0) { 425 snd_ak4531_free(ak4531); 426 return err; 427 } 428 429#if 0 430 snd_ak4531_dump(ak4531); 431#endif |
431 *rak4531 = ak4531; | 432 if (rak4531) 433 *rak4531 = ak4531; |
432 return 0; 433} 434 435/* 436 * power management 437 */ 438#ifdef CONFIG_PM 439void snd_ak4531_suspend(struct snd_ak4531 *ak4531) --- 51 unchanged lines hidden --- | 434 return 0; 435} 436 437/* 438 * power management 439 */ 440#ifdef CONFIG_PM 441void snd_ak4531_suspend(struct snd_ak4531 *ak4531) --- 51 unchanged lines hidden --- |