summaryrefslogtreecommitdiffstats
path: root/sound/firewire/motu
diff options
context:
space:
mode:
Diffstat (limited to 'sound/firewire/motu')
-rw-r--r--sound/firewire/motu/motu.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sound/firewire/motu/motu.c b/sound/firewire/motu/motu.c
index 300d31b6f191..fd5726424c7a 100644
--- a/sound/firewire/motu/motu.c
+++ b/sound/firewire/motu/motu.c
@@ -57,10 +57,9 @@ static void motu_free(struct snd_motu *motu)
57 snd_motu_transaction_unregister(motu); 57 snd_motu_transaction_unregister(motu);
58 58
59 snd_motu_stream_destroy_duplex(motu); 59 snd_motu_stream_destroy_duplex(motu);
60 fw_unit_put(motu->unit);
61 60
62 mutex_destroy(&motu->mutex); 61 mutex_destroy(&motu->mutex);
63 kfree(motu); 62 fw_unit_put(motu->unit);
64} 63}
65 64
66/* 65/*
@@ -143,14 +142,13 @@ static int motu_probe(struct fw_unit *unit,
143 struct snd_motu *motu; 142 struct snd_motu *motu;
144 143
145 /* Allocate this independently of sound card instance. */ 144 /* Allocate this independently of sound card instance. */
146 motu = kzalloc(sizeof(struct snd_motu), GFP_KERNEL); 145 motu = devm_kzalloc(&unit->device, sizeof(struct snd_motu), GFP_KERNEL);
147 if (motu == NULL) 146 if (!motu)
148 return -ENOMEM; 147 return -ENOMEM;
149
150 motu->spec = (const struct snd_motu_spec *)entry->driver_data;
151 motu->unit = fw_unit_get(unit); 148 motu->unit = fw_unit_get(unit);
152 dev_set_drvdata(&unit->device, motu); 149 dev_set_drvdata(&unit->device, motu);
153 150
151 motu->spec = (const struct snd_motu_spec *)entry->driver_data;
154 mutex_init(&motu->mutex); 152 mutex_init(&motu->mutex);
155 spin_lock_init(&motu->lock); 153 spin_lock_init(&motu->lock);
156 init_waitqueue_head(&motu->hwdep_wait); 154 init_waitqueue_head(&motu->hwdep_wait);