lkml.org 
[lkml]   [2005]   [Sep]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: + 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/

\
 
 \ /
  Last update: 2005-09-21 17:26    [W:0.034 / U:0.760 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site