mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
[ALSA] Conversions from kmalloc+memset to k(z|c)alloc
sound: Conversions from kmalloc+memset to k(c|z)alloc. Signed-off-by: Panagiotis Issaris <[email protected]> Signed-off-by: Takashi Iwai <[email protected]> Signed-off-by: Jaroslav Kysela <[email protected]>
This commit is contained in:
parent
fb6a0d635d
commit
59feddb25f
10 changed files with 15 additions and 29 deletions
|
|
@ -801,11 +801,10 @@ snd_pmac_awacs_init(struct snd_pmac *chip)
|
|||
chip->revision = (in_le32(&chip->awacs->codec_stat) >> 12) & 0xf;
|
||||
#ifdef PMAC_AMP_AVAIL
|
||||
if (chip->revision == 3 && chip->has_iic && CHECK_CUDA_AMP()) {
|
||||
struct awacs_amp *amp = kmalloc(sizeof(*amp), GFP_KERNEL);
|
||||
struct awacs_amp *amp = kzalloc(sizeof(*amp), GFP_KERNEL);
|
||||
if (! amp)
|
||||
return -ENOMEM;
|
||||
chip->mixer_data = amp;
|
||||
memset(amp, 0, sizeof(*amp));
|
||||
chip->mixer_free = awacs_amp_free;
|
||||
awacs_amp_set_vol(amp, 0, 63, 63, 0); /* mute and zero vol */
|
||||
awacs_amp_set_vol(amp, 1, 63, 63, 0);
|
||||
|
|
|
|||
|
|
@ -258,10 +258,9 @@ int __init snd_pmac_daca_init(struct snd_pmac *chip)
|
|||
request_module("i2c-powermac");
|
||||
#endif /* CONFIG_KMOD */
|
||||
|
||||
mix = kmalloc(sizeof(*mix), GFP_KERNEL);
|
||||
mix = kzalloc(sizeof(*mix), GFP_KERNEL);
|
||||
if (! mix)
|
||||
return -ENOMEM;
|
||||
memset(mix, 0, sizeof(*mix));
|
||||
chip->mixer_data = mix;
|
||||
chip->mixer_free = daca_cleanup;
|
||||
mix->amp_on = 1; /* default on */
|
||||
|
|
|
|||
|
|
@ -64,11 +64,10 @@ static int keywest_attach_adapter(struct i2c_adapter *adapter)
|
|||
if (strncmp(i2c_device_name(adapter), "mac-io", 6))
|
||||
return 0; /* ignored */
|
||||
|
||||
new_client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL);
|
||||
new_client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
|
||||
if (! new_client)
|
||||
return -ENOMEM;
|
||||
|
||||
memset(new_client, 0, sizeof(*new_client));
|
||||
new_client->addr = keywest_ctx->addr;
|
||||
i2c_set_clientdata(new_client, keywest_ctx);
|
||||
new_client->adapter = adapter;
|
||||
|
|
|
|||
|
|
@ -1316,10 +1316,9 @@ int __init snd_pmac_tumbler_init(struct snd_pmac *chip)
|
|||
request_module("i2c-powermac");
|
||||
#endif /* CONFIG_KMOD */
|
||||
|
||||
mix = kmalloc(sizeof(*mix), GFP_KERNEL);
|
||||
mix = kzalloc(sizeof(*mix), GFP_KERNEL);
|
||||
if (! mix)
|
||||
return -ENOMEM;
|
||||
memset(mix, 0, sizeof(*mix));
|
||||
mix->headphone_irq = -1;
|
||||
|
||||
chip->mixer_data = mix;
|
||||
|
|
|
|||
Loading…
Reference in a new issue