Skip to contentSkip to conversation

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

DISCUSSION Alexey Dobriyan 1 participant 1 message Sep 21, 2005 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 7 lines · On Wed, Sep 21, 2005 at 03:20:55AM -0700, [email protected] wrote:

Cleanup for CS5535 audio driver

sound/pci/cs5535audio/cs5535audio.c +2 -0
 
+static void wait_till_cmd_acked(cs5535audio_t *cs5535au, unsigned long timeout)
+{

sound/pci/cs5535audio/cs5535audio.c

Quoted 10 lines
sound/pci/cs5535audio/cs5535audio.c +10 -0
+	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