diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2008-10-15 17:07:47 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2008-10-16 08:40:03 +0200 |
commit | 9a3f371e9962749e5bdcf45a3bebdba555651a2b (patch) | |
tree | 4c755f3a7fa62fc3618c6b9f384dad663698eb2b /sound/core/jack.c | |
parent | 428ffb7151a4078994b5c01ecbf845954843c1ec (diff) |
ALSA: Handle NULL jacks in snd_jack_report()
Facilitate drivers that wish to carry on if they can't create a jack
input device by handling attempts to report the state of a NULL jack,
removing the need to check for initialisation before use.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core/jack.c')
-rw-r--r-- | sound/core/jack.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/core/jack.c b/sound/core/jack.c index 8133a2b173a..bd2d9e6b55e 100644 --- a/sound/core/jack.c +++ b/sound/core/jack.c @@ -147,6 +147,9 @@ EXPORT_SYMBOL(snd_jack_set_parent); */ void snd_jack_report(struct snd_jack *jack, int status) { + if (!jack) + return; + if (jack->type & SND_JACK_HEADPHONE) input_report_switch(jack->input_dev, SW_HEADPHONE_INSERT, status & SND_JACK_HEADPHONE); |