Re: + cleanup-for-cs5535-audio-driver.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Sep 21, 2005 at 03:20:55AM -0700, [email protected] 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux