summaryrefslogtreecommitdiffstats
path: root/sound/core/init.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-02-03 17:57:16 +0100
committerTakashi Iwai <tiwai@suse.de>2015-02-03 17:57:16 +0100
commit3fe9cf390f6dc84f76b112b0a660967a84f9a81b (patch)
tree18b8573687ae8131db155aa791f4d2357d91e6c5 /sound/core/init.c
parent6ccd93bdb989507717edb375d40534f1177822c5 (diff)
parent830953c0724b42be30a74febcde6c89c706ed286 (diff)
downloadblackbird-op-linux-3fe9cf390f6dc84f76b112b0a660967a84f9a81b.tar.gz
blackbird-op-linux-3fe9cf390f6dc84f76b112b0a660967a84f9a81b.zip
Merge branch 'topic/snd-device' into for-next
Diffstat (limited to 'sound/core/init.c')
-rw-r--r--sound/core/init.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/sound/core/init.c b/sound/core/init.c
index 074875d68c15..96194599e82e 100644
--- a/sound/core/init.c
+++ b/sound/core/init.c
@@ -157,6 +157,29 @@ static int get_slot_from_bitmask(int mask, int (*check)(struct module *, int),
return mask; /* unchanged */
}
+/* the default release callback set in snd_device_initialize() below;
+ * this is just NOP for now, as almost all jobs are already done in
+ * dev_free callback of snd_device chain instead.
+ */
+static void default_release(struct device *dev)
+{
+}
+
+/**
+ * snd_device_initialize - Initialize struct device for sound devices
+ * @dev: device to initialize
+ * @card: card to assign, optional
+ */
+void snd_device_initialize(struct device *dev, struct snd_card *card)
+{
+ device_initialize(dev);
+ if (card)
+ dev->parent = &card->card_dev;
+ dev->class = sound_class;
+ dev->release = default_release;
+}
+EXPORT_SYMBOL_GPL(snd_device_initialize);
+
static int snd_card_do_free(struct snd_card *card);
static const struct attribute_group *card_dev_attr_groups[];
OpenPOWER on IntegriCloud