cs5535: check ide_config_drive_speed() return value

Acked-by: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 3b4024d4
...@@ -141,7 +141,9 @@ static void cs5535_set_speed(ide_drive_t *drive, const u8 speed) ...@@ -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) 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); cs5535_set_speed(drive, speed);
return 0; return 0;
...@@ -157,7 +159,9 @@ static int cs5535_set_drive(ide_drive_t *drive, u8 speed) ...@@ -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) 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); cs5535_set_speed(drive, XFER_PIO_0 + pio);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment