[alsa-devel] [PATCH 06/17] ALSA: oxfw: add memory allocation for model-specific structure

Takashi Sakamoto o-takashi at sakamocchi.jp
Sun Dec 6 05:18:14 CET 2015


ALSA OXFW driver should have backward compatibility to old
firewire-speakers driver. Additionally, in future commit, scs1x driver
will be merged to it. It's nice to add a pointer to have a memory block
for model-specific structures.

This commit adds a member to 'struct snd_oxfw' for this aim. Deallocation
is done at freeing ALSA card structure.

Signed-off-by: Takashi Sakamoto <o-takashi at sakamocchi.jp>
---
 sound/firewire/oxfw/oxfw.c | 1 +
 sound/firewire/oxfw/oxfw.h | 1 +
 2 files changed, 2 insertions(+)

diff --git a/sound/firewire/oxfw/oxfw.c b/sound/firewire/oxfw/oxfw.c
index d4fb3c1..7e50a4f 100644
--- a/sound/firewire/oxfw/oxfw.c
+++ b/sound/firewire/oxfw/oxfw.c
@@ -132,6 +132,7 @@ static void oxfw_card_free(struct snd_card *card)
 		kfree(oxfw->rx_stream_formats[i]);
 	}
 
+	kfree(oxfw->spec);
 	mutex_destroy(&oxfw->mutex);
 }
 
diff --git a/sound/firewire/oxfw/oxfw.h b/sound/firewire/oxfw/oxfw.h
index f3e14ff..9625661 100644
--- a/sound/firewire/oxfw/oxfw.h
+++ b/sound/firewire/oxfw/oxfw.h
@@ -74,6 +74,7 @@ struct snd_oxfw {
 	wait_queue_head_t hwdep_wait;
 
 	const struct ieee1394_device_id *entry;
+	void *spec;
 };
 
 /*
-- 
2.5.0



More information about the Alsa-devel mailing list