From: Takashi Iwai Subject: Re: [PATCH 1/2] ALSA: Add jack reporting API Date: Mon, 28 Jul 2008 19:01:19 +0200 Message-ID: References: <1217263836-1270-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 mx1.suse.de (ns.suse.de [195.135.220.2]) by alsa0.perex.cz (Postfix) with ESMTP id 38D7D10388E for ; Mon, 28 Jul 2008 19:01:20 +0200 (CEST) In-Reply-To: <1217263836-1270-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 List-Id: alsa-devel@alsa-project.org At Mon, 28 Jul 2008 17:50:35 +0100, Mark Brown wrote: > > +/** > + * Jack types which can be reported. These values are used as a > + * bitmask. > + */ > +enum snd_jack_types { > + SND_JACK_HEADPHONE = 0x0001, > + SND_JACK_MICROPHONE = 0x0002, > + SND_JACK_HEADSET = 0x0003, /* Both microphone and headphone */ They are bitmask, so HEADSET should be better defined as SND_JACK_HEADPHONE | SND_JACK_MICROPHONE ? > +void snd_jack_set_parent(struct snd_jack *jack, struct device *parent) > +{ > + BUG_ON(jack->registered); I'm afraid BUG_ON() is brutal for this kind of check. Takashi