Commit a3aaf7d2 authored by Takashi Sakamoto's avatar Takashi Sakamoto Committed by Takashi Iwai

ALSA: bebob: use managed-resource to maintain data specific to M-Audio FW-1814/ProjectMix I/O

ALSA bebob driver allocates memory object for data specific to M-Audio
FW-1884/ProjectMix I/O. The object is to maintain format of isochronous
packet payload for packet streaming by components for ALSA rawMIDI/PCM
interfaces. The object can be released as managed-resource of
'struct snd_card.card_dev'.

This commit uses managed-resource of the sound card device for this
purpose.
Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 366a20d7
...@@ -130,8 +130,6 @@ static void bebob_free(struct snd_bebob *bebob) ...@@ -130,8 +130,6 @@ static void bebob_free(struct snd_bebob *bebob)
{ {
snd_bebob_stream_destroy_duplex(bebob); snd_bebob_stream_destroy_duplex(bebob);
kfree(bebob->maudio_special_quirk);
mutex_destroy(&bebob->mutex); mutex_destroy(&bebob->mutex);
fw_unit_put(bebob->unit); fw_unit_put(bebob->unit);
} }
...@@ -262,8 +260,6 @@ do_registration(struct work_struct *work) ...@@ -262,8 +260,6 @@ do_registration(struct work_struct *work)
error: error:
mutex_unlock(&devices_mutex); mutex_unlock(&devices_mutex);
snd_bebob_stream_destroy_duplex(bebob); snd_bebob_stream_destroy_duplex(bebob);
kfree(bebob->maudio_special_quirk);
bebob->maudio_special_quirk = NULL;
snd_card_free(bebob->card); snd_card_free(bebob->card);
dev_info(&bebob->unit->device, dev_info(&bebob->unit->device,
"Sound card registration failed: %d\n", err); "Sound card registration failed: %d\n", err);
......
...@@ -261,8 +261,9 @@ snd_bebob_maudio_special_discover(struct snd_bebob *bebob, bool is1814) ...@@ -261,8 +261,9 @@ snd_bebob_maudio_special_discover(struct snd_bebob *bebob, bool is1814)
struct special_params *params; struct special_params *params;
int err; int err;
params = kzalloc(sizeof(struct special_params), GFP_KERNEL); params = devm_kzalloc(&bebob->card->card_dev,
if (params == NULL) sizeof(struct special_params), GFP_KERNEL);
if (!params)
return -ENOMEM; return -ENOMEM;
mutex_lock(&bebob->mutex); mutex_lock(&bebob->mutex);
......
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