Skip to content

Commit

Permalink
ALSA: Handle NULL jacks in snd_jack_report()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mark Brown authored and Takashi Iwai committed Oct 16, 2008
1 parent 428ffb7 commit 9a3f371
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sound/core/jack.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9a3f371

Please sign in to comment.