Merge branch 'linus' into cont_syslog
[safe/jmp/linux-2.6] / drivers / ide / ide-ioctls.c
index d3440b5..9965ecd 100644 (file)
@@ -4,6 +4,7 @@
 
 #include <linux/hdreg.h>
 #include <linux/ide.h>
+#include <linux/slab.h>
 
 static const struct ide_ioctl_devset ide_ioctl_settings[] = {
 { HDIO_GET_32BIT,       HDIO_SET_32BIT,        &ide_devset_io_32bit  },
@@ -162,7 +163,7 @@ static int ide_cmd_ioctl(ide_drive_t *drive, unsigned long arg)
        if (tf->command == ATA_CMD_SET_FEATURES &&
            tf->feature == SETFEATURES_XFER &&
            tf->nsect >= XFER_SW_DMA_0) {
-               xfer_rate = ide_find_dma_mode(drive, XFER_UDMA_6);
+               xfer_rate = ide_find_dma_mode(drive, tf->nsect);
                if (xfer_rate != tf->nsect) {
                        err = -EINVAL;
                        goto abort;