Messages in this thread | | | Date | Wed, 21 Sep 2005 19:34:50 +0400 | From | Alexey Dobriyan <> | Subject | Re: + cleanup-for-cs5535-audio-driver.patch added to -mm tree |
| |
On Wed, Sep 21, 2005 at 03:20:55AM -0700, akpm@osdl.org wrote: > Cleanup for CS5535 audio driver
> --- devel/sound/pci/cs5535audio/cs5535audio.c > +++ devel-akpm/sound/pci/cs5535audio/cs5535audio.c
> +static void wait_till_cmd_acked(cs5535audio_t *cs5535au, unsigned long timeout) > +{ > + unsigned long tmp; > + do { > + tmp = cs_readl(cs5535au, ACC_CODEC_CNTL); > + if (!(tmp & CMD_NEW)) > + break; > + msleep(10); > + } while (--timeout); > + if (!timeout) > + snd_printk(KERN_ERR "Failure writing to cs5535 codec\n"); > +}
Looks wrong. Should be something like
unsigned long end_jiffies = jiffies + timeout;
while (1) { if (!(cs_readl(cs5535au, ACC_CODEC_CNTL) & CMD_NEW)) break; if (time_after(end_jiffies, jiffies)) break; msleep(10); } and printk somewhere
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |