From: Takashi Iwai Subject: Re: [PATCH2/5] ASoC S3C24xx machine drivers - Openmoko Neo1973 Date: Thu, 10 May 2007 17:33:17 +0200 Message-ID: References: <1178802024.10518.70.camel@a10072.wolfsonmicro.main> 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 02B9F243AA for ; Thu, 10 May 2007 17:33:18 +0200 (CEST) In-Reply-To: <1178802024.10518.70.camel@a10072.wolfsonmicro.main> 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: Liam Girdwood Cc: "alsa-devel@alsa-project.org" , Graeme Gregory List-Id: alsa-devel@alsa-project.org At Thu, 10 May 2007 14:00:23 +0100, Liam Girdwood wrote: > > +static const char *lm4857_mode[] = { > + "Off", > + "Call Speaker", > + "Stereo Speakers", > + "Stereo Speakers + Headphones", > + "Headphones" > +}; > + > +static const struct soc_enum lm4857_mode_enum[] = { > + SOC_ENUM_SINGLE_EXT(5, lm4857_mode), ARRAY_SIZE(lm4857_mode) may be better than a number. > +static const char *neo_scenarios[] = { > + "Off", > + "GSM Handset", > + "GSM Headset", > + "GSM Bluetooth", > + "Speakers", > + "Headphones", > + "Capture Handset", > + "Capture Headset", > + "Capture Bluetooth" > +}; > + > +static const struct soc_enum neo_scenario_enum[] = { > + SOC_ENUM_SINGLE_EXT(9,neo_scenarios), Ditto. > +static int neo1973_wm8753_init(struct snd_soc_codec *codec) (snip) > + for (i = 0; i < ARRAY_SIZE(wm8753_neo1973_controls); i++) { > + if ((err = snd_ctl_add(codec->card, > + snd_soc_cnew(&wm8753_neo1973_controls[i], > + codec, NULL))) < 0) Split 'err = ...' and if, please. > + return err; > + } > + > + /* set up neo1973 specific audio path audio_mapnects */ > + for(i = 0; audio_map[i][0] != NULL; i++) { Put a space after for. > +static int lm4857_amp_probe(struct i2c_adapter *adap, int addr, int kind) > +{ > + int ret; > + > + client_template.adapter = adap; > + client_template.addr = addr; > + > + i2c = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); > + if (i2c == NULL) > + return -ENOMEM; > + > + memcpy(i2c, &client_template, sizeof(struct i2c_client)); Use can use kmemdup(). thanks, Takashi