Commit 561b220a authored by Takashi Iwai's avatar Takashi Iwai Committed by Jaroslav Kysela
Browse files

[ALSA] Replace with kzalloc() - others



Documentation,SA11xx UDA1341 driver,Generic drivers,MPU401 UART,OPL3
OPL4,Digigram VX core,I2C cs8427,I2C lib core,I2C tea6330t,L3 drivers
AK4114 receiver,AK4117 receiver,PDAudioCF driver,PPC PMAC driver
SPARC AMD7930 driver,SPARC cs4231 driver,Synth,Common EMU synth
USB generic driver,USB USX2Y
Replace kcalloc(1,..) with kzalloc().
Signed-off-by: Takashi Iwai's avatarTakashi Iwai <tiwai@suse.de>
parent e560d8d8
......@@ -447,7 +447,7 @@
....
/* allocate a chip-specific data with zero filled */
chip = kcalloc(1, sizeof(*chip), GFP_KERNEL);
chip = kzalloc(sizeof(*chip), GFP_KERNEL);
if (chip == NULL)
return -ENOMEM;
......@@ -949,7 +949,7 @@
After allocating a card instance via
<function>snd_card_new()</function> (with
<constant>NULL</constant> on the 4th arg), call
<function>kcalloc()</function>.
<function>kzalloc()</function>.
<informalexample>
<programlisting>
......@@ -958,7 +958,7 @@
mychip_t *chip;
card = snd_card_new(index[dev], id[dev], THIS_MODULE, NULL);
.....
chip = kcalloc(1, sizeof(*chip), GFP_KERNEL);
chip = kzalloc(sizeof(*chip), GFP_KERNEL);
]]>
</programlisting>
</informalexample>
......@@ -1136,7 +1136,7 @@
return -ENXIO;
}
chip = kcalloc(1, sizeof(*chip), GFP_KERNEL);
chip = kzalloc(sizeof(*chip), GFP_KERNEL);
if (chip == NULL) {
pci_disable_device(pci);
return -ENOMEM;
......@@ -1292,7 +1292,7 @@
need to initialize this number as -1 before actual allocation,
since irq 0 is valid. The port address and its resource pointer
can be initialized as null by
<function>kcalloc()</function> automatically, so you
<function>kzalloc()</function> automatically, so you
don't have to take care of resetting them.
</para>
......
......@@ -21,7 +21,7 @@
* merged HAL layer (patches from Brian)
*/
/* $Id: sa11xx-uda1341.c,v 1.22 2005/09/05 16:17:58 tiwai Exp $ */
/* $Id: sa11xx-uda1341.c,v 1.23 2005/09/09 13:22:34 tiwai Exp $ */
/***************************************************************************************************
*
......@@ -918,7 +918,7 @@ static int __init sa11xx_uda1341_init(void)
if (card == NULL)
return -ENOMEM;
sa11xx_uda1341 = kcalloc(1, sizeof(*sa11xx_uda1341), GFP_KERNEL);
sa11xx_uda1341 = kzalloc(sizeof(*sa11xx_uda1341), GFP_KERNEL);
if (sa11xx_uda1341 == NULL)
return -ENOMEM;
spin_lock_init(&chip->s[0].dma_lock);
......
......@@ -337,7 +337,7 @@ static int snd_card_dummy_playback_open(snd_pcm_substream_t * substream)
snd_card_dummy_pcm_t *dpcm;
int err;
dpcm = kcalloc(1, sizeof(*dpcm), GFP_KERNEL);
dpcm = kzalloc(sizeof(*dpcm), GFP_KERNEL);
if (dpcm == NULL)
return -ENOMEM;
init_timer(&dpcm->timer);
......@@ -368,7 +368,7 @@ static int snd_card_dummy_capture_open(snd_pcm_substream_t * substream)
snd_card_dummy_pcm_t *dpcm;
int err;
dpcm = kcalloc(1, sizeof(*dpcm), GFP_KERNEL);
dpcm = kzalloc(sizeof(*dpcm), GFP_KERNEL);
if (dpcm == NULL)
return -ENOMEM;
init_timer(&dpcm->timer);
......
......@@ -463,7 +463,7 @@ int snd_mpu401_uart_new(snd_card_t * card, int device,
*rrawmidi = NULL;
if ((err = snd_rawmidi_new(card, "MPU-401U", device, 1, 1, &rmidi)) < 0)
return err;
mpu = kcalloc(1, sizeof(*mpu), GFP_KERNEL);
mpu = kzalloc(sizeof(*mpu), GFP_KERNEL);
if (mpu == NULL) {
snd_device_free(card, rmidi);
return -ENOMEM;
......
......@@ -688,7 +688,7 @@ static int snd_mtpav_get_RAWMIDI(mtpav_t * mcard)
static mtpav_t *new_mtpav(void)
{
mtpav_t *ncrd = kcalloc(1, sizeof(*ncrd), GFP_KERNEL);
mtpav_t *ncrd = kzalloc(sizeof(*ncrd), GFP_KERNEL);
if (ncrd != NULL) {
spin_lock_init(&ncrd->spinlock);
......
......@@ -354,7 +354,7 @@ int snd_opl3_new(snd_card_t *card,
int err;
*ropl3 = NULL;
opl3 = kcalloc(1, sizeof(*opl3), GFP_KERNEL);
opl3 = kzalloc(sizeof(*opl3), GFP_KERNEL);
if (opl3 == NULL)
return -ENOMEM;
......
......@@ -241,7 +241,7 @@ static int snd_opl3_load_patch_seq_oss(snd_seq_oss_arg_t *arg, int format,
}
size = sizeof(*put) + sizeof(fm_xinstrument_t);
put = kcalloc(1, size, GFP_KERNEL);
put = kzalloc(size, GFP_KERNEL);
if (put == NULL)
return -ENOMEM;
/* build header */
......
......@@ -204,7 +204,7 @@ int snd_opl4_create(snd_card_t *card,
if (ropl4)
*ropl4 = NULL;
opl4 = kcalloc(1, sizeof(*opl4), GFP_KERNEL);
opl4 = kzalloc(sizeof(*opl4), GFP_KERNEL);
if (!opl4)
return -ENOMEM;
......
......@@ -779,7 +779,7 @@ static int __init snd_uart16550_create(snd_card_t * card,
int err;
if ((uart = kcalloc(1, sizeof(*uart), GFP_KERNEL)) == NULL)
if ((uart = kzalloc(sizeof(*uart), GFP_KERNEL)) == NULL)
return -ENOMEM;
uart->adaptor = adaptor;
uart->card = card;
......
......@@ -782,7 +782,7 @@ vx_core_t *snd_vx_create(snd_card_t *card, struct snd_vx_hardware *hw,
snd_assert(card && hw && ops, return NULL);
chip = kcalloc(1, sizeof(*chip) + extra_size, GFP_KERNEL);
chip = kzalloc(sizeof(*chip) + extra_size, GFP_KERNEL);
if (! chip) {
snd_printk(KERN_ERR "vx_core: no memory\n");
return NULL;
......
......@@ -473,7 +473,7 @@ static int vx_alloc_pipe(vx_core_t *chip, int capture,
return err;
/* initialize the pipe record */
pipe = kcalloc(1, sizeof(*pipe), GFP_KERNEL);
pipe = kzalloc(sizeof(*pipe), GFP_KERNEL);
if (! pipe) {
/* release the pipe */
vx_init_rmh(&rmh, CMD_FREE_PIPE);
......
......@@ -200,7 +200,7 @@ int snd_cs8427_create(snd_i2c_bus_t *bus,
if ((err = snd_i2c_device_create(bus, "CS8427", CS8427_ADDR | (addr & 7), &device)) < 0)
return err;
chip = device->private_data = kcalloc(1, sizeof(*chip), GFP_KERNEL);
chip = device->private_data = kzalloc(sizeof(*chip), GFP_KERNEL);
if (chip == NULL) {
snd_i2c_device_free(device);
return -ENOMEM;
......
......@@ -81,7 +81,7 @@ int snd_i2c_bus_create(snd_card_t *card, const char *name, snd_i2c_bus_t *master
};
*ri2c = NULL;
bus = kcalloc(1, sizeof(*bus), GFP_KERNEL);
bus = kzalloc(sizeof(*bus), GFP_KERNEL);
if (bus == NULL)
return -ENOMEM;
init_MUTEX(&bus->lock_mutex);
......@@ -108,7 +108,7 @@ int snd_i2c_device_create(snd_i2c_bus_t *bus, const char *name, unsigned char ad
*rdevice = NULL;
snd_assert(bus != NULL, return -EINVAL);
device = kcalloc(1, sizeof(*device), GFP_KERNEL);
device = kzalloc(sizeof(*device), GFP_KERNEL);
if (device == NULL)
return -ENOMEM;
device->addr = addr;
......
......@@ -17,7 +17,7 @@
* 2002-05-12 Tomas Kasparek another code cleanup
*/
/* $Id: uda1341.c,v 1.15 2005/01/03 12:05:20 tiwai Exp $ */
/* $Id: uda1341.c,v 1.16 2005/09/09 13:22:34 tiwai Exp $ */
#include <sound/driver.h>
#include <linux/module.h>
......@@ -670,7 +670,7 @@ int __init snd_chip_uda1341_mixer_new(snd_card_t *card, struct l3_client **clnt)
snd_assert(card != NULL, return -EINVAL);
uda1341 = kcalloc(1, sizeof(*uda1341), GFP_KERNEL);
uda1341 = kzalloc(sizeof(*uda1341), GFP_KERNEL);
if (uda1341 == NULL)
return -ENOMEM;
......@@ -707,7 +707,7 @@ static int uda1341_attach(struct l3_client *clnt)
{
struct uda1341 *uda;
uda = kcalloc(1, sizeof(*uda), 0, GFP_KERNEL);
uda = kzalloc(sizeof(*uda), 0, GFP_KERNEL);
if (!uda)
return -ENOMEM;
......
......@@ -92,7 +92,7 @@ int snd_ak4114_create(snd_card_t *card,
.dev_free = snd_ak4114_dev_free,
};
chip = kcalloc(1, sizeof(*chip), GFP_KERNEL);
chip = kzalloc(sizeof(*chip), GFP_KERNEL);
if (chip == NULL)
return -ENOMEM;
spin_lock_init(&chip->lock);
......
......@@ -83,7 +83,7 @@ int snd_ak4117_create(snd_card_t *card, ak4117_read_t *read, ak4117_write_t *wri
.dev_free = snd_ak4117_dev_free,
};
chip = kcalloc(1, sizeof(*chip), GFP_KERNEL);
chip = kzalloc(sizeof(*chip), GFP_KERNEL);
if (chip == NULL)
return -ENOMEM;
spin_lock_init(&chip->lock);
......
......@@ -281,7 +281,7 @@ int snd_tea6330t_update_mixer(snd_card_t * card,
u8 default_treble, default_bass;
unsigned char bytes[7];
tea = kcalloc(1, sizeof(*tea), GFP_KERNEL);
tea = kzalloc(sizeof(*tea), GFP_KERNEL);
if (tea == NULL)
return -ENOMEM;
if ((err = snd_i2c_device_create(bus, "TEA6330T", TEA6330T_ADDR, &device)) < 0) {
......
......@@ -151,7 +151,7 @@ pdacf_t *snd_pdacf_create(snd_card_t *card)
{
pdacf_t *chip;
chip = kcalloc(1, sizeof(*chip), GFP_KERNEL);
chip = kzalloc(sizeof(*chip), GFP_KERNEL);
if (chip == NULL)
return NULL;
chip->card = card;
......
......@@ -1160,7 +1160,7 @@ int __init snd_pmac_new(snd_card_t *card, pmac_t **chip_return)
snd_runtime_check(chip_return, return -EINVAL);
*chip_return = NULL;
chip = kcalloc(1, sizeof(*chip), GFP_KERNEL);
chip = kzalloc(sizeof(*chip), GFP_KERNEL);
if (chip == NULL)
return -ENOMEM;
chip->card = card;
......
......@@ -967,7 +967,7 @@ static int __init snd_amd7930_create(snd_card_t *card,
int err;
*ramd = NULL;
amd = kcalloc(1, sizeof(*amd), GFP_KERNEL);
amd = kzalloc(sizeof(*amd), GFP_KERNEL);
if (amd == NULL)
return -ENOMEM;
......
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