ALSA: mpu401: Fix assignment in if condition
[linux-2.6-microblaze.git] / sound / drivers / mpu401 / mpu401_uart.c
index 65982d6..f435b9b 100644 (file)
@@ -271,8 +271,11 @@ static int snd_mpu401_uart_input_open(struct snd_rawmidi_substream *substream)
        int err;
 
        mpu = substream->rmidi->private_data;
-       if (mpu->open_input && (err = mpu->open_input(mpu)) < 0)
-               return err;
+       if (mpu->open_input) {
+               err = mpu->open_input(mpu);
+               if (err < 0)
+                       return err;
+       }
        if (! test_bit(MPU401_MODE_BIT_OUTPUT, &mpu->mode)) {
                if (snd_mpu401_do_reset(mpu) < 0)
                        goto error_out;
@@ -293,8 +296,11 @@ static int snd_mpu401_uart_output_open(struct snd_rawmidi_substream *substream)
        int err;
 
        mpu = substream->rmidi->private_data;
-       if (mpu->open_output && (err = mpu->open_output(mpu)) < 0)
-               return err;
+       if (mpu->open_output) {
+               err = mpu->open_output(mpu);
+               if (err < 0)
+                       return err;
+       }
        if (! test_bit(MPU401_MODE_BIT_INPUT, &mpu->mode)) {
                if (snd_mpu401_do_reset(mpu) < 0)
                        goto error_out;
@@ -524,8 +530,9 @@ int snd_mpu401_uart_new(struct snd_card *card, int device,
                info_flags |= MPU401_INFO_INPUT | MPU401_INFO_OUTPUT;
        in_enable = (info_flags & MPU401_INFO_INPUT) ? 1 : 0;
        out_enable = (info_flags & MPU401_INFO_OUTPUT) ? 1 : 0;
-       if ((err = snd_rawmidi_new(card, "MPU-401U", device,
-                                  out_enable, in_enable, &rmidi)) < 0)
+       err = snd_rawmidi_new(card, "MPU-401U", device,
+                             out_enable, in_enable, &rmidi);
+       if (err < 0)
                return err;
        mpu = kzalloc(sizeof(*mpu), GFP_KERNEL);
        if (!mpu) {