diff options
Diffstat (limited to 'include/linux/ide.h')
-rw-r--r-- | include/linux/ide.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h index f00086b10be3..4cecd923fc79 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -753,7 +753,7 @@ typedef struct hwif_s { | |||
753 | 753 | ||
754 | unsigned long sata_scr[SATA_NR_PORTS]; | 754 | unsigned long sata_scr[SATA_NR_PORTS]; |
755 | 755 | ||
756 | ide_drive_t *devices[MAX_DRIVES]; | 756 | ide_drive_t *devices[MAX_DRIVES + 1]; |
757 | 757 | ||
758 | u8 major; /* our major number */ | 758 | u8 major; /* our major number */ |
759 | u8 index; /* 0 for ide0; 1 for ide1; ... */ | 759 | u8 index; /* 0 for ide0; 1 for ide1; ... */ |
@@ -861,7 +861,7 @@ typedef struct hwif_s { | |||
861 | #define MAX_HOST_PORTS 4 | 861 | #define MAX_HOST_PORTS 4 |
862 | 862 | ||
863 | struct ide_host { | 863 | struct ide_host { |
864 | ide_hwif_t *ports[MAX_HOST_PORTS]; | 864 | ide_hwif_t *ports[MAX_HOST_PORTS + 1]; |
865 | unsigned int n_ports; | 865 | unsigned int n_ports; |
866 | struct device *dev[2]; | 866 | struct device *dev[2]; |
867 | unsigned int (*init_chipset)(struct pci_dev *); | 867 | unsigned int (*init_chipset)(struct pci_dev *); |
@@ -1604,4 +1604,11 @@ static inline ide_drive_t *ide_get_pair_dev(ide_drive_t *drive) | |||
1604 | 1604 | ||
1605 | return (peer->dev_flags & IDE_DFLAG_PRESENT) ? peer : NULL; | 1605 | return (peer->dev_flags & IDE_DFLAG_PRESENT) ? peer : NULL; |
1606 | } | 1606 | } |
1607 | |||
1608 | #define ide_port_for_each_dev(i, dev, port) \ | ||
1609 | for ((i) = 0; ((dev) = (port)->devices[i]) || (i) < MAX_DRIVES; (i)++) | ||
1610 | |||
1611 | #define ide_host_for_each_port(i, port, host) \ | ||
1612 | for ((i) = 0; ((port) = (host)->ports[i]) || (i) < MAX_HOST_PORTS; (i)++) | ||
1613 | |||
1607 | #endif /* _IDE_H */ | 1614 | #endif /* _IDE_H */ |