[alsa-devel] [PATCH2/5] ASoC S3C24xx machine drivers - Openmoko Neo1973

Takashi Iwai tiwai at suse.de
Thu May 10 17:33:17 CEST 2007


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


More information about the Alsa-devel mailing list