summaryrefslogtreecommitdiff
path: root/sound/core/jack.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/core/jack.c')
-rw-r--r--sound/core/jack.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/sound/core/jack.c b/sound/core/jack.c
index 8658578..b35fe73 100644
--- a/sound/core/jack.c
+++ b/sound/core/jack.c
@@ -34,12 +34,12 @@ static int jack_switch_types[SND_JACK_SWITCH_TYPES] = {
SW_LINEIN_INSERT,
};
-static int snd_jack_dev_disconnect(struct snd_device *device)
+static int snd_jack_dev_free(struct snd_device *device)
{
struct snd_jack *jack = device->device_data;
- if (!jack->input_dev)
- return 0;
+ if (jack->private_free)
+ jack->private_free(jack);
/* If the input device is registered with the input subsystem
* then we need to use a different deallocator. */
@@ -47,18 +47,6 @@ static int snd_jack_dev_disconnect(struct snd_device *device)
input_unregister_device(jack->input_dev);
else
input_free_device(jack->input_dev);
- jack->input_dev = NULL;
- return 0;
-}
-
-static int snd_jack_dev_free(struct snd_device *device)
-{
- struct snd_jack *jack = device->device_data;
-
- if (jack->private_free)
- jack->private_free(jack);
-
- snd_jack_dev_disconnect(device);
kfree(jack->id);
kfree(jack);
@@ -122,7 +110,6 @@ int snd_jack_new(struct snd_card *card, const char *id, int type,
static struct snd_device_ops ops = {
.dev_free = snd_jack_dev_free,
.dev_register = snd_jack_dev_register,
- .dev_disconnect = snd_jack_dev_disconnect,
};
jack = kzalloc(sizeof(struct snd_jack), GFP_KERNEL);