]> err.no Git - linux-2.6/commitdiff
cs5535: check ide_config_drive_speed() return value
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Sat, 13 Oct 2007 15:47:51 +0000 (17:47 +0200)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Sat, 13 Oct 2007 15:47:51 +0000 (17:47 +0200)
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
drivers/ide/pci/cs5535.c

index 383b7eccbcbbc63ccb25392f5d1175862b4588c5..5d1be657adca763fc04c13ea20d92b1006744ccb 100644 (file)
@@ -141,7 +141,9 @@ static void cs5535_set_speed(ide_drive_t *drive, const u8 speed)
  */
 static int cs5535_set_drive(ide_drive_t *drive, u8 speed)
 {
-       ide_config_drive_speed(drive, speed);
+       if (ide_config_drive_speed(drive, speed))
+               return 1;
+
        cs5535_set_speed(drive, speed);
 
        return 0;
@@ -157,7 +159,9 @@ static int cs5535_set_drive(ide_drive_t *drive, u8 speed)
 
 static void cs5535_set_pio_mode(ide_drive_t *drive, const u8 pio)
 {
-       ide_config_drive_speed(drive, XFER_PIO_0 + pio);
+       if (ide_config_drive_speed(drive, XFER_PIO_0 + pio))
+               return;
+
        cs5535_set_speed(drive, XFER_PIO_0 + pio);
 }