From: Takashi Iwai Subject: Re: [PATCH] ALSA: Handle NULL jacks in snd_jack_report() Date: Thu, 16 Oct 2008 08:52:23 +0200 Message-ID: References: <1224086867-23934-1-git-send-email-broonie@opensource.wolfsonmicro.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 38F2324467 for ; Thu, 16 Oct 2008 08:53:18 +0200 (CEST) In-Reply-To: <1224086867-23934-1-git-send-email-broonie@opensource.wolfsonmicro.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Mark Brown Cc: alsa-devel@alsa-project.org, Matthew Ranostay List-Id: alsa-devel@alsa-project.org At Wed, 15 Oct 2008 17:07:47 +0100, Mark Brown wrote: > > 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 Thanks, applied to topic/misc-fixes branch for the next pull request. Takashi > --- > 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 8133a2b..bd2d9e6 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); > -- > 1.5.6.5 > > _______________________________________________ > Alsa-devel mailing list > Alsa-devel@alsa-project.org > http://mailman.alsa-project.org/mailman/listinfo/alsa-devel >