lkml.org 
[lkml]   [2008]   [May]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/1] [ASOC]: AD1980 audio codec ASOC driver
At Mon, 12 May 2008 18:45:12 +0800,
Bryan Wu wrote:
> diff --git a/sound/soc/codecs/ad1980.c b/sound/soc/codecs/ad1980.c
(snip)
> +static int ad1980_add_controls(struct snd_soc_codec *codec)
> +{
> + int err, i;
> +
> + for (i = 0; i < ARRAY_SIZE(ad1980_snd_ac97_controls); i++) {
> + err = snd_ctl_add(codec->card, snd_soc_cnew( \

The backslash isn't needed.

> +static unsigned int ac97_read(struct snd_soc_codec *codec,
> + unsigned int reg)
> +{
> + u16 *cache = codec->reg_cache;
> +
> + if (reg == AC97_RESET || reg == AC97_INT_PAGING || \
> + reg == AC97_POWERDOWN || reg == AC97_EXTENDED_STATUS \
> + || reg == AC97_VENDOR_ID1 || reg == AC97_VENDOR_ID2)

Ditto. Maybe a switch is a better choice here.

> + return soc_ac97_ops.read(codec->ac97, reg);
> + else {
> + reg = reg >> 1;
> +
> + if (reg > (ARRAY_SIZE(ad1980_reg)))

Isn't it reg >= ARRAY_SIZE(ad1980_reg) ??

> +static int ac97_write(struct snd_soc_codec *codec, unsigned int reg,
> + unsigned int val)
> +{
> + u16 *cache = codec->reg_cache;
> +
> + soc_ac97_ops.write(codec->ac97, reg, val);
> + reg = reg >> 1;
> + if (reg <= (ARRAY_SIZE(ad1980_reg)))

And reg < ARRAY_SIZE(ad1980_reg)


thanks,

Takashi


\
 
 \ /
  Last update: 2008-05-13 13:01    [W:0.082 / U:0.432 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site