patch-2.2.18 linux/drivers/sound/emu10k1/cardmo.c

Next file: linux/drivers/sound/emu10k1/cardwi.c
Previous file: linux/drivers/sound/emu10k1/cardmi.c
Back to the patch index
Back to the overall index

diff -u --new-file --recursive --exclude-from /usr/src/exclude v2.2.17/drivers/sound/emu10k1/cardmo.c linux/drivers/sound/emu10k1/cardmo.c
@@ -48,7 +48,7 @@
 	DPF(2, "emu10k1_mpuout_open()\n");
 
 	if (!(card_mpuout->status & FLAGS_AVAILABLE))
-		return CTSTATUS_INUSE;
+		return -1;
 
 	/* Copy open info and mark channel as in use */
 	card_mpuout->intr = 0;
@@ -61,7 +61,7 @@
 	emu10k1_mpu_reset(card);
 	emu10k1_mpu_acquire(card);
 
-	return CTSTATUS_SUCCESS;
+	return 0;
 }
 
 int emu10k1_mpuout_close(struct emu10k1_card *card)
@@ -96,7 +96,7 @@
 
 	spin_unlock_irqrestore(&card_mpuout->lock, flags);
 
-	return CTSTATUS_SUCCESS;
+	return 0;
 }
 
 /* If there isn't enough buffer space, reject Midi Buffer.     *
@@ -113,14 +113,14 @@
 	DPF(2, "emu10k1_mpuout_add_buffer()\n");
 
 	if (card_mpuout->state == CARDMIDIOUT_STATE_SUSPEND)
-		return CTSTATUS_SUCCESS;
+		return 0;
 
 	midihdr->flags |= MIDIBUF_INQUEUE;
 	midihdr->flags &= ~MIDIBUF_DONE;
 
 	if ((midiq = (struct midi_queue *) kmalloc(sizeof(struct midi_queue), GFP_KERNEL)) == NULL) {
 		/* Message lost */
-		return CTSTATUS_NOMEMORY;
+		return -1;
 	}
 
 	midiq->next = NULL;
@@ -147,7 +147,7 @@
 
 	spin_unlock_irqrestore(&card_mpuout->lock, flags);
 
-	return CTSTATUS_SUCCESS;
+	return 0;
 }
 
 void emu10k1_mpuout_bh(unsigned long refdata)
@@ -155,7 +155,6 @@
 	struct emu10k1_card *card = (struct emu10k1_card *) refdata;
 	struct emu10k1_mpuout *card_mpuout = card->mpuout;
 	int cByteSent = 0;
-	int status;
 	struct midi_queue *midiq;
 	struct midi_queue *doneq = NULL;
 	unsigned long flags;
@@ -166,14 +165,12 @@
 		midiq = card_mpuout->firstmidiq;
 
 		while (cByteSent < 4 && midiq->sizeLeft) {
-			status = emu10k1_mpu_write_data(card, *midiq->midibyte);
-
-			if (status == CTSTATUS_SUCCESS) {
+			if (emu10k1_mpu_write_data(card, *midiq->midibyte) < 0) {
+				DPF(2, "emu10k1_mpuoutDpcCallback error!!\n");
+			} else {
 				++cByteSent;
 				--midiq->sizeLeft;
 				++midiq->midibyte;
-			} else {
-				DPF(2, "emu10k1_mpuoutDpcCallback error!!\n");
 			}
 		}
 
@@ -229,5 +226,5 @@
 
 	tasklet_hi_schedule(&card_mpuout->tasklet);
 
-	return CTSTATUS_SUCCESS;
+	return 0;
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)