From: Andrew Morton Cc: Jon Masters Cc: Jaroslav Kysela Cc: Takashi Iwai Signed-off-by: Andrew Morton --- sound/drivers/mpu401/mpu401_uart.c | 26 +++++++++++++------------- 1 files changed, 13 insertions(+), 13 deletions(-) diff -puN sound/drivers/mpu401/mpu401_uart.c~sound-fix-hang-in-mpu401_uartc-tidy sound/drivers/mpu401/mpu401_uart.c --- devel/sound/drivers/mpu401/mpu401_uart.c~sound-fix-hang-in-mpu401_uartc-tidy 2006-04-16 18:18:19.000000000 -0700 +++ devel-akpm/sound/drivers/mpu401/mpu401_uart.c 2006-04-16 18:18:19.000000000 -0700 @@ -183,7 +183,8 @@ static void snd_mpu401_uart_remove_timer */ -static int snd_mpu401_uart_cmd(struct snd_mpu401 * mpu, unsigned char cmd, int ack) +static int snd_mpu401_uart_cmd(struct snd_mpu401 *mpu, unsigned char cmd, + int ack) { unsigned long flags; int timeout, ok; @@ -218,12 +219,14 @@ static int snd_mpu401_uart_cmd(struct sn ok = 1; } spin_unlock_irqrestore(&mpu->input_lock, flags); - if (ok) - return 0; - else { - snd_printk("cmd: 0x%x failed at 0x%lx (status = 0x%x, data = 0x%x)\n", cmd, mpu->port, mpu->read(mpu, MPU401C(mpu)), mpu->read(mpu, MPU401D(mpu))); + if (!ok) { + snd_printk("cmd: 0x%x failed at 0x%lx (status = 0x%x, data = " + "0x%x)\n", + cmd, mpu->port, mpu->read(mpu, MPU401C(mpu)), + mpu->read(mpu, MPU401D(mpu))); return 1; } + return 0; } /* @@ -238,12 +241,10 @@ static int snd_mpu401_uart_input_open(st if (mpu->open_input && (err = mpu->open_input(mpu)) < 0) return err; if (! test_bit(MPU401_MODE_BIT_OUTPUT, &mpu->mode)) { - if ((err = snd_mpu401_uart_cmd(mpu, MPU401_RESET, 1))) { + if (snd_mpu401_uart_cmd(mpu, MPU401_RESET, 1)) return -EFAULT; - } - if ((err = snd_mpu401_uart_cmd(mpu, MPU401_ENTER_UART, 1))) { + if (snd_mpu401_uart_cmd(mpu, MPU401_ENTER_UART, 1)) return -EFAULT; - } } mpu->substream_input = substream; set_bit(MPU401_MODE_BIT_INPUT, &mpu->mode); @@ -258,10 +259,10 @@ static int snd_mpu401_uart_output_open(s mpu = substream->rmidi->private_data; if (mpu->open_output && (err = mpu->open_output(mpu)) < 0) return err; - if (! test_bit(MPU401_MODE_BIT_INPUT, &mpu->mode)) { - if ((err = snd_mpu401_uart_cmd(mpu, MPU401_RESET, 1))) + if (!test_bit(MPU401_MODE_BIT_INPUT, &mpu->mode)) { + if (snd_mpu401_uart_cmd(mpu, MPU401_RESET, 1)) return -EFAULT; - if ((err = snd_mpu401_uart_cmd(mpu, MPU401_ENTER_UART, 1))) + if (snd_mpu401_uart_cmd(mpu, MPU401_ENTER_UART, 1)) return -EFAULT; } mpu->substream_output = substream; @@ -331,7 +332,6 @@ static void snd_mpu401_uart_input_trigge snd_mpu401_uart_remove_timer(mpu, 1); clear_bit(MPU401_MODE_BIT_INPUT_TRIGGER, &mpu->mode); } - } /* _