aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide')
-rw-r--r--drivers/ide/Kconfig9
-rw-r--r--drivers/ide/arm/icside.c1
-rw-r--r--drivers/ide/cris/ide-cris.c1
-rw-r--r--drivers/ide/h8300/ide-h8300.c1
-rw-r--r--drivers/ide/ide-cd.c3
-rw-r--r--drivers/ide/ide-disk.c3
-rw-r--r--drivers/ide/ide-dma.c1
-rw-r--r--drivers/ide/ide-floppy.c2
-rw-r--r--drivers/ide/ide-io.c1
-rw-r--r--drivers/ide/ide-iops.c1
-rw-r--r--drivers/ide/ide-lib.c1
-rw-r--r--drivers/ide/ide-probe.c22
-rw-r--r--drivers/ide/ide-proc.c1
-rw-r--r--drivers/ide/ide-tape.c13
-rw-r--r--drivers/ide/ide-taskfile.c1
-rw-r--r--drivers/ide/ide.c11
-rw-r--r--drivers/ide/legacy/ali14xx.c1
-rw-r--r--drivers/ide/legacy/dtc2278.c1
-rw-r--r--drivers/ide/legacy/gayle.c1
-rw-r--r--drivers/ide/legacy/hd.c4
-rw-r--r--drivers/ide/legacy/ht6560b.c1
-rw-r--r--drivers/ide/legacy/ide-cs.c81
-rw-r--r--drivers/ide/legacy/macide.c1
-rw-r--r--drivers/ide/legacy/qd65xx.c1
-rw-r--r--drivers/ide/legacy/umc8672.c1
-rw-r--r--drivers/ide/pci/aec62xx.c4
-rw-r--r--drivers/ide/pci/alim15x3.c1
-rw-r--r--drivers/ide/pci/amd74xx.c1
-rw-r--r--drivers/ide/pci/atiixp.c1
-rw-r--r--drivers/ide/pci/cmd640.c1
-rw-r--r--drivers/ide/pci/cmd64x.c1
-rw-r--r--drivers/ide/pci/cs5520.c1
-rw-r--r--drivers/ide/pci/cs5530.c1
-rw-r--r--drivers/ide/pci/cs5535.c1
-rw-r--r--drivers/ide/pci/cy82c693.c1
-rw-r--r--drivers/ide/pci/hpt34x.c3
-rw-r--r--drivers/ide/pci/hpt366.c1
-rw-r--r--drivers/ide/pci/it8172.c1
-rw-r--r--drivers/ide/pci/it821x.c3
-rw-r--r--drivers/ide/pci/ns87415.c1
-rw-r--r--drivers/ide/pci/pdc202xx_new.c5
-rw-r--r--drivers/ide/pci/pdc202xx_old.c5
-rw-r--r--drivers/ide/pci/piix.c1
-rw-r--r--drivers/ide/pci/sc1200.c1
-rw-r--r--drivers/ide/pci/serverworks.c1
-rw-r--r--drivers/ide/pci/siimage.c1
-rw-r--r--drivers/ide/pci/sis5513.c1
-rw-r--r--drivers/ide/pci/sl82c105.c1
-rw-r--r--drivers/ide/pci/slc90e66.c1
-rw-r--r--drivers/ide/pci/triflex.c1
-rw-r--r--drivers/ide/pci/trm290.c1
-rw-r--r--drivers/ide/pci/via82cxxx.c1
-rw-r--r--drivers/ide/ppc/mpc8xx.c1
-rw-r--r--drivers/ide/ppc/pmac.c126
-rw-r--r--drivers/ide/setup-pci.c1
55 files changed, 96 insertions, 238 deletions
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
index d633081fa4c5..d1266fe2d1ab 100644
--- a/drivers/ide/Kconfig
+++ b/drivers/ide/Kconfig
@@ -774,11 +774,18 @@ config BLK_DEV_IDEDMA_PMAC
774 performance. 774 performance.
775 775
776config BLK_DEV_IDE_PMAC_BLINK 776config BLK_DEV_IDE_PMAC_BLINK
777 bool "Blink laptop LED on drive activity" 777 bool "Blink laptop LED on drive activity (DEPRECATED)"
778 depends on BLK_DEV_IDE_PMAC && ADB_PMU 778 depends on BLK_DEV_IDE_PMAC && ADB_PMU
779 select ADB_PMU_LED
780 select LEDS_TRIGGERS
781 select LEDS_TRIGGER_IDE_DISK
779 help 782 help
780 This option enables the use of the sleep LED as a hard drive 783 This option enables the use of the sleep LED as a hard drive
781 activity LED. 784 activity LED.
785 This option is deprecated, it only selects ADB_PMU_LED and
786 LEDS_TRIGGER_IDE_DISK and changes the code in the new led class
787 device to default to the ide-disk trigger (which should be set
788 from userspace via sysfs).
782 789
783config BLK_DEV_IDE_SWARM 790config BLK_DEV_IDE_SWARM
784 tristate "IDE for Sibyte evaluation boards" 791 tristate "IDE for Sibyte evaluation boards"
diff --git a/drivers/ide/arm/icside.c b/drivers/ide/arm/icside.c
index 308897e57e4d..8a1c27f28692 100644
--- a/drivers/ide/arm/icside.c
+++ b/drivers/ide/arm/icside.c
@@ -6,7 +6,6 @@
6 * Please note that this platform does not support 32-bit IDE IO. 6 * Please note that this platform does not support 32-bit IDE IO.
7 */ 7 */
8 8
9#include <linux/config.h>
10#include <linux/string.h> 9#include <linux/string.h>
11#include <linux/module.h> 10#include <linux/module.h>
12#include <linux/ioport.h> 11#include <linux/ioport.h>
diff --git a/drivers/ide/cris/ide-cris.c b/drivers/ide/cris/ide-cris.c
index cd15e6260510..5797e0b5a132 100644
--- a/drivers/ide/cris/ide-cris.c
+++ b/drivers/ide/cris/ide-cris.c
@@ -19,7 +19,6 @@
19 19
20#undef REALLY_SLOW_IO /* most systems can safely undef this */ 20#undef REALLY_SLOW_IO /* most systems can safely undef this */
21 21
22#include <linux/config.h>
23#include <linux/types.h> 22#include <linux/types.h>
24#include <linux/kernel.h> 23#include <linux/kernel.h>
25#include <linux/timer.h> 24#include <linux/timer.h>
diff --git a/drivers/ide/h8300/ide-h8300.c b/drivers/ide/h8300/ide-h8300.c
index fb91cb8bf2d2..15955996a1f3 100644
--- a/drivers/ide/h8300/ide-h8300.c
+++ b/drivers/ide/h8300/ide-h8300.c
@@ -5,7 +5,6 @@
5 5
6#include <linux/init.h> 6#include <linux/init.h>
7#include <linux/ide.h> 7#include <linux/ide.h>
8#include <linux/config.h>
9 8
10#include <asm/io.h> 9#include <asm/io.h>
11#include <asm/irq.h> 10#include <asm/irq.h>
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 99fa42402e71..654d4cd09847 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -301,7 +301,6 @@
301 301
302#define IDECD_VERSION "4.61" 302#define IDECD_VERSION "4.61"
303 303
304#include <linux/config.h>
305#include <linux/module.h> 304#include <linux/module.h>
306#include <linux/types.h> 305#include <linux/types.h>
307#include <linux/kernel.h> 306#include <linux/kernel.h>
@@ -3527,8 +3526,6 @@ static int ide_cd_probe(ide_drive_t *drive)
3527 drive->driver_data = info; 3526 drive->driver_data = info;
3528 3527
3529 g->minors = 1; 3528 g->minors = 1;
3530 snprintf(g->devfs_name, sizeof(g->devfs_name),
3531 "%s/cd", drive->devfs_name);
3532 g->driverfs_dev = &drive->gendev; 3529 g->driverfs_dev = &drive->gendev;
3533 g->flags = GENHD_FL_CD | GENHD_FL_REMOVABLE; 3530 g->flags = GENHD_FL_CD | GENHD_FL_REMOVABLE;
3534 if (ide_cdrom_setup(drive)) { 3531 if (ide_cdrom_setup(drive)) {
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index f033d732f387..f712e4cfd9dc 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -47,7 +47,6 @@
47 47
48//#define DEBUG 48//#define DEBUG
49 49
50#include <linux/config.h>
51#include <linux/module.h> 50#include <linux/module.h>
52#include <linux/types.h> 51#include <linux/types.h>
53#include <linux/string.h> 52#include <linux/string.h>
@@ -1018,7 +1017,6 @@ static void ide_disk_release(struct kref *kref)
1018 struct gendisk *g = idkp->disk; 1017 struct gendisk *g = idkp->disk;
1019 1018
1020 drive->driver_data = NULL; 1019 drive->driver_data = NULL;
1021 drive->devfs_name[0] = '\0';
1022 g->private_data = NULL; 1020 g->private_data = NULL;
1023 put_disk(g); 1021 put_disk(g);
1024 kfree(idkp); 1022 kfree(idkp);
@@ -1222,7 +1220,6 @@ static int ide_disk_probe(ide_drive_t *drive)
1222 drive->attach = 1; 1220 drive->attach = 1;
1223 1221
1224 g->minors = 1 << PARTN_BITS; 1222 g->minors = 1 << PARTN_BITS;
1225 strcpy(g->devfs_name, drive->devfs_name);
1226 g->driverfs_dev = &drive->gendev; 1223 g->driverfs_dev = &drive->gendev;
1227 g->flags = drive->removable ? GENHD_FL_REMOVABLE : 0; 1224 g->flags = drive->removable ? GENHD_FL_REMOVABLE : 0;
1228 set_capacity(g, idedisk_capacity(drive)); 1225 set_capacity(g, idedisk_capacity(drive));
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index 783a2475ee8b..98918fb6b2ce 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -74,7 +74,6 @@
74 * 74 *
75 */ 75 */
76 76
77#include <linux/config.h>
78#include <linux/module.h> 77#include <linux/module.h>
79#include <linux/types.h> 78#include <linux/types.h>
80#include <linux/kernel.h> 79#include <linux/kernel.h>
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index 4656587aa2f7..6ca3476d02c7 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -82,7 +82,6 @@
82 82
83#define IDEFLOPPY_VERSION "0.99.newide" 83#define IDEFLOPPY_VERSION "0.99.newide"
84 84
85#include <linux/config.h>
86#include <linux/module.h> 85#include <linux/module.h>
87#include <linux/types.h> 86#include <linux/types.h>
88#include <linux/string.h> 87#include <linux/string.h>
@@ -2176,7 +2175,6 @@ static int ide_floppy_probe(ide_drive_t *drive)
2176 2175
2177 g->minors = 1 << PARTN_BITS; 2176 g->minors = 1 << PARTN_BITS;
2178 g->driverfs_dev = &drive->gendev; 2177 g->driverfs_dev = &drive->gendev;
2179 strcpy(g->devfs_name, drive->devfs_name);
2180 g->flags = drive->removable ? GENHD_FL_REMOVABLE : 0; 2178 g->flags = drive->removable ? GENHD_FL_REMOVABLE : 0;
2181 g->fops = &idefloppy_ops; 2179 g->fops = &idefloppy_ops;
2182 drive->attach = 1; 2180 drive->attach = 1;
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 26ceab1e90bb..7dba9992ad30 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -24,7 +24,6 @@
24 */ 24 */
25 25
26 26
27#include <linux/config.h>
28#include <linux/module.h> 27#include <linux/module.h>
29#include <linux/types.h> 28#include <linux/types.h>
30#include <linux/string.h> 29#include <linux/string.h>
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index 32117f0ec5c0..657165297dc7 100644
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -6,7 +6,6 @@
6 * 6 *
7 */ 7 */
8 8
9#include <linux/config.h>
10#include <linux/module.h> 9#include <linux/module.h>
11#include <linux/types.h> 10#include <linux/types.h>
12#include <linux/string.h> 11#include <linux/string.h>
diff --git a/drivers/ide/ide-lib.c b/drivers/ide/ide-lib.c
index 7ddb11828731..1feff23487d4 100644
--- a/drivers/ide/ide-lib.c
+++ b/drivers/ide/ide-lib.c
@@ -1,4 +1,3 @@
1#include <linux/config.h>
2#include <linux/module.h> 1#include <linux/module.h>
3#include <linux/types.h> 2#include <linux/types.h>
4#include <linux/string.h> 3#include <linux/string.h>
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 9ebf8ae2a5e3..9cadf0106c6c 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -33,7 +33,6 @@
33 33
34#undef REALLY_SLOW_IO /* most systems can safely undef this */ 34#undef REALLY_SLOW_IO /* most systems can safely undef this */
35 35
36#include <linux/config.h>
37#include <linux/module.h> 36#include <linux/module.h>
38#include <linux/types.h> 37#include <linux/types.h>
39#include <linux/string.h> 38#include <linux/string.h>
@@ -47,7 +46,6 @@
47#include <linux/slab.h> 46#include <linux/slab.h>
48#include <linux/delay.h> 47#include <linux/delay.h>
49#include <linux/ide.h> 48#include <linux/ide.h>
50#include <linux/devfs_fs_kernel.h>
51#include <linux/spinlock.h> 49#include <linux/spinlock.h>
52#include <linux/kmod.h> 50#include <linux/kmod.h>
53#include <linux/pci.h> 51#include <linux/pci.h>
@@ -1006,7 +1004,7 @@ static int ide_init_queue(ide_drive_t *drive)
1006 * and irq serialization situations. This is somewhat complex because 1004 * and irq serialization situations. This is somewhat complex because
1007 * it handles static as well as dynamic (PCMCIA) IDE interfaces. 1005 * it handles static as well as dynamic (PCMCIA) IDE interfaces.
1008 * 1006 *
1009 * The SA_INTERRUPT in sa_flags means ide_intr() is always entered with 1007 * The IRQF_DISABLED in sa_flags means ide_intr() is always entered with
1010 * interrupts completely disabled. This can be bad for interrupt latency, 1008 * interrupts completely disabled. This can be bad for interrupt latency,
1011 * but anything else has led to problems on some machines. We re-enable 1009 * but anything else has led to problems on some machines. We re-enable
1012 * interrupts as much as we can safely do in most places. 1010 * interrupts as much as we can safely do in most places.
@@ -1092,15 +1090,15 @@ static int init_irq (ide_hwif_t *hwif)
1092 * Allocate the irq, if not already obtained for another hwif 1090 * Allocate the irq, if not already obtained for another hwif
1093 */ 1091 */
1094 if (!match || match->irq != hwif->irq) { 1092 if (!match || match->irq != hwif->irq) {
1095 int sa = SA_INTERRUPT; 1093 int sa = IRQF_DISABLED;
1096#if defined(__mc68000__) || defined(CONFIG_APUS) 1094#if defined(__mc68000__) || defined(CONFIG_APUS)
1097 sa = SA_SHIRQ; 1095 sa = IRQF_SHARED;
1098#endif /* __mc68000__ || CONFIG_APUS */ 1096#endif /* __mc68000__ || CONFIG_APUS */
1099 1097
1100 if (IDE_CHIPSET_IS_PCI(hwif->chipset)) { 1098 if (IDE_CHIPSET_IS_PCI(hwif->chipset)) {
1101 sa = SA_SHIRQ; 1099 sa = IRQF_SHARED;
1102#ifndef CONFIG_IDEPCI_SHARE_IRQ 1100#ifndef CONFIG_IDEPCI_SHARE_IRQ
1103 sa |= SA_INTERRUPT; 1101 sa |= IRQF_DISABLED;
1104#endif /* CONFIG_IDEPCI_SHARE_IRQ */ 1102#endif /* CONFIG_IDEPCI_SHARE_IRQ */
1105 } 1103 }
1106 1104
@@ -1279,10 +1277,6 @@ static void drive_release_dev (struct device *dev)
1279 ide_drive_t *drive = container_of(dev, ide_drive_t, gendev); 1277 ide_drive_t *drive = container_of(dev, ide_drive_t, gendev);
1280 1278
1281 spin_lock_irq(&ide_lock); 1279 spin_lock_irq(&ide_lock);
1282 if (drive->devfs_name[0] != '\0') {
1283 devfs_remove(drive->devfs_name);
1284 drive->devfs_name[0] = '\0';
1285 }
1286 ide_remove_drive_from_hwgroup(drive); 1280 ide_remove_drive_from_hwgroup(drive);
1287 kfree(drive->id); 1281 kfree(drive->id);
1288 drive->id = NULL; 1282 drive->id = NULL;
@@ -1316,12 +1310,6 @@ static void init_gendisk (ide_hwif_t *hwif)
1316 drive->gendev.bus = &ide_bus_type; 1310 drive->gendev.bus = &ide_bus_type;
1317 drive->gendev.driver_data = drive; 1311 drive->gendev.driver_data = drive;
1318 drive->gendev.release = drive_release_dev; 1312 drive->gendev.release = drive_release_dev;
1319 if (drive->present) {
1320 sprintf(drive->devfs_name, "ide/host%d/bus%d/target%d/lun%d",
1321 (hwif->channel && hwif->mate) ?
1322 hwif->mate->index : hwif->index,
1323 hwif->channel, unit, drive->lun);
1324 }
1325 } 1313 }
1326 blk_register_region(MKDEV(hwif->major, 0), MAX_DRIVES << PARTN_BITS, 1314 blk_register_region(MKDEV(hwif->major, 0), MAX_DRIVES << PARTN_BITS,
1327 THIS_MODULE, ata_probe, ata_lock, hwif); 1315 THIS_MODULE, ata_probe, ata_lock, hwif);
diff --git a/drivers/ide/ide-proc.c b/drivers/ide/ide-proc.c
index 84665e2ba3c8..c12f1b71e934 100644
--- a/drivers/ide/ide-proc.c
+++ b/drivers/ide/ide-proc.c
@@ -22,7 +22,6 @@
22 * 22 *
23 */ 23 */
24 24
25#include <linux/config.h>
26#include <linux/module.h> 25#include <linux/module.h>
27 26
28#include <asm/uaccess.h> 27#include <asm/uaccess.h>
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 09f3a7dab28a..7067ab997927 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -424,7 +424,6 @@
424 424
425#define IDETAPE_VERSION "1.19" 425#define IDETAPE_VERSION "1.19"
426 426
427#include <linux/config.h>
428#include <linux/module.h> 427#include <linux/module.h>
429#include <linux/types.h> 428#include <linux/types.h>
430#include <linux/string.h> 429#include <linux/string.h>
@@ -435,7 +434,6 @@
435#include <linux/interrupt.h> 434#include <linux/interrupt.h>
436#include <linux/jiffies.h> 435#include <linux/jiffies.h>
437#include <linux/major.h> 436#include <linux/major.h>
438#include <linux/devfs_fs_kernel.h>
439#include <linux/errno.h> 437#include <linux/errno.h>
440#include <linux/genhd.h> 438#include <linux/genhd.h>
441#include <linux/slab.h> 439#include <linux/slab.h>
@@ -4726,9 +4724,6 @@ static void ide_tape_release(struct kref *kref)
4726 MKDEV(IDETAPE_MAJOR, tape->minor)); 4724 MKDEV(IDETAPE_MAJOR, tape->minor));
4727 class_device_destroy(idetape_sysfs_class, 4725 class_device_destroy(idetape_sysfs_class,
4728 MKDEV(IDETAPE_MAJOR, tape->minor + 128)); 4726 MKDEV(IDETAPE_MAJOR, tape->minor + 128));
4729 devfs_remove("%s/mt", drive->devfs_name);
4730 devfs_remove("%s/mtn", drive->devfs_name);
4731 devfs_unregister_tape(g->number);
4732 idetape_devs[tape->minor] = NULL; 4727 idetape_devs[tape->minor] = NULL;
4733 g->private_data = NULL; 4728 g->private_data = NULL;
4734 put_disk(g); 4729 put_disk(g);
@@ -4902,14 +4897,6 @@ static int ide_tape_probe(ide_drive_t *drive)
4902 class_device_create(idetape_sysfs_class, NULL, 4897 class_device_create(idetape_sysfs_class, NULL,
4903 MKDEV(IDETAPE_MAJOR, minor + 128), &drive->gendev, "n%s", tape->name); 4898 MKDEV(IDETAPE_MAJOR, minor + 128), &drive->gendev, "n%s", tape->name);
4904 4899
4905 devfs_mk_cdev(MKDEV(HWIF(drive)->major, minor),
4906 S_IFCHR | S_IRUGO | S_IWUGO,
4907 "%s/mt", drive->devfs_name);
4908 devfs_mk_cdev(MKDEV(HWIF(drive)->major, minor + 128),
4909 S_IFCHR | S_IRUGO | S_IWUGO,
4910 "%s/mtn", drive->devfs_name);
4911
4912 g->number = devfs_register_tape(drive->devfs_name);
4913 g->fops = &idetape_block_ops; 4900 g->fops = &idetape_block_ops;
4914 ide_register_region(g); 4901 ide_register_region(g);
4915 4902
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index a839b2a8f6f4..04547eb0833f 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -27,7 +27,6 @@
27 * request. 27 * request.
28 */ 28 */
29 29
30#include <linux/config.h>
31#include <linux/module.h> 30#include <linux/module.h>
32#include <linux/types.h> 31#include <linux/types.h>
33#include <linux/string.h> 32#include <linux/string.h>
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 59fe358048b3..05fbd9298db7 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -130,7 +130,6 @@
130 130
131#define _IDE_C /* Tell ide.h it's really us */ 131#define _IDE_C /* Tell ide.h it's really us */
132 132
133#include <linux/config.h>
134#include <linux/module.h> 133#include <linux/module.h>
135#include <linux/types.h> 134#include <linux/types.h>
136#include <linux/string.h> 135#include <linux/string.h>
@@ -147,7 +146,6 @@
147#include <linux/pci.h> 146#include <linux/pci.h>
148#include <linux/delay.h> 147#include <linux/delay.h>
149#include <linux/ide.h> 148#include <linux/ide.h>
150#include <linux/devfs_fs_kernel.h>
151#include <linux/completion.h> 149#include <linux/completion.h>
152#include <linux/reboot.h> 150#include <linux/reboot.h>
153#include <linux/cdrom.h> 151#include <linux/cdrom.h>
@@ -592,13 +590,8 @@ void ide_unregister(unsigned int index)
592 goto abort; 590 goto abort;
593 for (unit = 0; unit < MAX_DRIVES; ++unit) { 591 for (unit = 0; unit < MAX_DRIVES; ++unit) {
594 drive = &hwif->drives[unit]; 592 drive = &hwif->drives[unit];
595 if (!drive->present) { 593 if (!drive->present)
596 if (drive->devfs_name[0] != '\0') {
597 devfs_remove(drive->devfs_name);
598 drive->devfs_name[0] = '\0';
599 }
600 continue; 594 continue;
601 }
602 spin_unlock_irq(&ide_lock); 595 spin_unlock_irq(&ide_lock);
603 device_unregister(&drive->gendev); 596 device_unregister(&drive->gendev);
604 wait_for_completion(&drive->gendev_rel_comp); 597 wait_for_completion(&drive->gendev_rel_comp);
@@ -1996,7 +1989,6 @@ EXPORT_SYMBOL_GPL(ide_bus_type);
1996static int __init ide_init(void) 1989static int __init ide_init(void)
1997{ 1990{
1998 printk(KERN_INFO "Uniform Multi-Platform E-IDE driver " REVISION "\n"); 1991 printk(KERN_INFO "Uniform Multi-Platform E-IDE driver " REVISION "\n");
1999 devfs_mk_dir("ide");
2000 system_bus_speed = ide_system_bus_speed(); 1992 system_bus_speed = ide_system_bus_speed();
2001 1993
2002 bus_register(&ide_bus_type); 1994 bus_register(&ide_bus_type);
@@ -2074,7 +2066,6 @@ void cleanup_module (void)
2074#ifdef CONFIG_PROC_FS 2066#ifdef CONFIG_PROC_FS
2075 proc_ide_destroy(); 2067 proc_ide_destroy();
2076#endif 2068#endif
2077 devfs_remove("ide");
2078 2069
2079 bus_unregister(&ide_bus_type); 2070 bus_unregister(&ide_bus_type);
2080} 2071}
diff --git a/drivers/ide/legacy/ali14xx.c b/drivers/ide/legacy/ali14xx.c
index fb88711812e6..9c544467cb74 100644
--- a/drivers/ide/legacy/ali14xx.c
+++ b/drivers/ide/legacy/ali14xx.c
@@ -40,7 +40,6 @@
40#undef REALLY_SLOW_IO /* most systems can safely undef this */ 40#undef REALLY_SLOW_IO /* most systems can safely undef this */
41 41
42#include <linux/module.h> 42#include <linux/module.h>
43#include <linux/config.h>
44#include <linux/types.h> 43#include <linux/types.h>
45#include <linux/kernel.h> 44#include <linux/kernel.h>
46#include <linux/delay.h> 45#include <linux/delay.h>
diff --git a/drivers/ide/legacy/dtc2278.c b/drivers/ide/legacy/dtc2278.c
index 20eb5b872ca9..3b1d33baaa2f 100644
--- a/drivers/ide/legacy/dtc2278.c
+++ b/drivers/ide/legacy/dtc2278.c
@@ -7,7 +7,6 @@
7#undef REALLY_SLOW_IO /* most systems can safely undef this */ 7#undef REALLY_SLOW_IO /* most systems can safely undef this */
8 8
9#include <linux/module.h> 9#include <linux/module.h>
10#include <linux/config.h>
11#include <linux/types.h> 10#include <linux/types.h>
12#include <linux/kernel.h> 11#include <linux/kernel.h>
13#include <linux/delay.h> 12#include <linux/delay.h>
diff --git a/drivers/ide/legacy/gayle.c b/drivers/ide/legacy/gayle.c
index 3fac3e9ec47d..64d42619ab06 100644
--- a/drivers/ide/legacy/gayle.c
+++ b/drivers/ide/legacy/gayle.c
@@ -8,7 +8,6 @@
8 * more details. 8 * more details.
9 */ 9 */
10 10
11#include <linux/config.h>
12#include <linux/types.h> 11#include <linux/types.h>
13#include <linux/mm.h> 12#include <linux/mm.h>
14#include <linux/interrupt.h> 13#include <linux/interrupt.h>
diff --git a/drivers/ide/legacy/hd.c b/drivers/ide/legacy/hd.c
index 6439dec66881..aebecd8f51cc 100644
--- a/drivers/ide/legacy/hd.c
+++ b/drivers/ide/legacy/hd.c
@@ -691,7 +691,7 @@ static struct block_device_operations hd_fops = {
691}; 691};
692 692
693/* 693/*
694 * This is the hard disk IRQ description. The SA_INTERRUPT in sa_flags 694 * This is the hard disk IRQ description. The IRQF_DISABLED in sa_flags
695 * means we run the IRQ-handler with interrupts disabled: this is bad for 695 * means we run the IRQ-handler with interrupts disabled: this is bad for
696 * interrupt latency, but anything else has led to problems on some 696 * interrupt latency, but anything else has led to problems on some
697 * machines. 697 * machines.
@@ -806,7 +806,7 @@ static int __init hd_init(void)
806 p->cyl, p->head, p->sect); 806 p->cyl, p->head, p->sect);
807 } 807 }
808 808
809 if (request_irq(HD_IRQ, hd_interrupt, SA_INTERRUPT, "hd", NULL)) { 809 if (request_irq(HD_IRQ, hd_interrupt, IRQF_DISABLED, "hd", NULL)) {
810 printk("hd: unable to get IRQ%d for the hard disk driver\n", 810 printk("hd: unable to get IRQ%d for the hard disk driver\n",
811 HD_IRQ); 811 HD_IRQ);
812 goto out1; 812 goto out1;
diff --git a/drivers/ide/legacy/ht6560b.c b/drivers/ide/legacy/ht6560b.c
index a77fb249d5cf..c48e87e512d3 100644
--- a/drivers/ide/legacy/ht6560b.c
+++ b/drivers/ide/legacy/ht6560b.c
@@ -39,7 +39,6 @@
39#undef REALLY_SLOW_IO /* most systems can safely undef this */ 39#undef REALLY_SLOW_IO /* most systems can safely undef this */
40 40
41#include <linux/module.h> 41#include <linux/module.h>
42#include <linux/config.h>
43#include <linux/types.h> 42#include <linux/types.h>
44#include <linux/kernel.h> 43#include <linux/kernel.h>
45#include <linux/delay.h> 44#include <linux/delay.h>
diff --git a/drivers/ide/legacy/ide-cs.c b/drivers/ide/legacy/ide-cs.c
index 602797a44208..b7e459e4f284 100644
--- a/drivers/ide/legacy/ide-cs.c
+++ b/drivers/ide/legacy/ide-cs.c
@@ -146,7 +146,16 @@ static void ide_detach(struct pcmcia_device *link)
146 kfree(link->priv); 146 kfree(link->priv);
147} /* ide_detach */ 147} /* ide_detach */
148 148
149static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq, struct pcmcia_device *handle) 149static void idecs_mmio_fixup(ide_hwif_t *hwif)
150{
151 default_hwif_mmiops(hwif);
152 hwif->mmio = 2;
153
154 ide_undecoded_slave(hwif);
155}
156
157static int idecs_register(unsigned long io, unsigned long ctl,
158 unsigned long irq, struct pcmcia_device *handle, int is_mmio)
150{ 159{
151 hw_regs_t hw; 160 hw_regs_t hw;
152 memset(&hw, 0, sizeof(hw)); 161 memset(&hw, 0, sizeof(hw));
@@ -154,7 +163,19 @@ static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq
154 hw.irq = irq; 163 hw.irq = irq;
155 hw.chipset = ide_pci; 164 hw.chipset = ide_pci;
156 hw.dev = &handle->dev; 165 hw.dev = &handle->dev;
157 return ide_register_hw_with_fixup(&hw, NULL, ide_undecoded_slave); 166
167 if(is_mmio)
168 return ide_register_hw_with_fixup(&hw, NULL, idecs_mmio_fixup);
169 else
170 return ide_register_hw_with_fixup(&hw, NULL, ide_undecoded_slave);
171}
172
173void outb_io(unsigned char value, unsigned long port) {
174 outb(value, port);
175}
176
177void outb_mem(unsigned char value, unsigned long port) {
178 writeb(value, (void __iomem *) port);
158} 179}
159 180
160/*====================================================================== 181/*======================================================================
@@ -180,7 +201,8 @@ static int ide_config(struct pcmcia_device *link)
180 } *stk = NULL; 201 } *stk = NULL;
181 cistpl_cftable_entry_t *cfg; 202 cistpl_cftable_entry_t *cfg;
182 int i, pass, last_ret = 0, last_fn = 0, hd, is_kme = 0; 203 int i, pass, last_ret = 0, last_fn = 0, hd, is_kme = 0;
183 unsigned long io_base, ctl_base; 204 unsigned long io_base, ctl_base, is_mmio, try_slave;
205 void (*my_outb)(unsigned char, unsigned long);
184 206
185 DEBUG(0, "ide_config(0x%p)\n", link); 207 DEBUG(0, "ide_config(0x%p)\n", link);
186 208
@@ -210,7 +232,7 @@ static int ide_config(struct pcmcia_device *link)
210 /* Not sure if this is right... look up the current Vcc */ 232 /* Not sure if this is right... look up the current Vcc */
211 CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(link, &stk->conf)); 233 CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(link, &stk->conf));
212 234
213 pass = io_base = ctl_base = 0; 235 pass = io_base = ctl_base = is_mmio = try_slave = 0;
214 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; 236 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
215 tuple.Attributes = 0; 237 tuple.Attributes = 0;
216 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); 238 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
@@ -258,11 +280,45 @@ static int ide_config(struct pcmcia_device *link)
258 goto next_entry; 280 goto next_entry;
259 io_base = link->io.BasePort1; 281 io_base = link->io.BasePort1;
260 ctl_base = link->io.BasePort1 + 0x0e; 282 ctl_base = link->io.BasePort1 + 0x0e;
283
284 if (io->win[0].len >= 0x20)
285 try_slave = 1;
286
261 } else goto next_entry; 287 } else goto next_entry;
262 /* If we've got this far, we're done */ 288 /* If we've got this far, we're done */
263 break; 289 break;
264 } 290 }
265 291
292 if ((cfg->mem.nwin > 0) || (stk->dflt.mem.nwin > 0)) {
293 win_req_t req;
294 memreq_t map;
295 cistpl_mem_t *mem = (cfg->mem.nwin) ? &cfg->mem : &stk->dflt.mem;
296
297 if (mem->win[0].len < 16)
298 goto next_entry;
299
300 req.Attributes = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM;
301 req.Attributes |= WIN_ENABLE;
302 req.Base = mem->win[0].host_addr;
303 req.Size = 0;
304
305 req.AccessSpeed = 0;
306 if (pcmcia_request_window(&link, &req, &link->win) != 0)
307 goto next_entry;
308 map.Page = 0; map.CardOffset = mem->win[0].card_addr;
309 if (pcmcia_map_mem_page(link->win, &map) != 0)
310 goto next_entry;
311
312 io_base = (unsigned long) ioremap(req.Base, req.Size);
313 ctl_base = io_base + 0x0e;
314 is_mmio = 1;
315
316 if (mem->win[0].len >= 0x20)
317 try_slave = 1;
318
319 break;
320 }
321
266 next_entry: 322 next_entry:
267 if (cfg->flags & CISTPL_CFTABLE_DEFAULT) 323 if (cfg->flags & CISTPL_CFTABLE_DEFAULT)
268 memcpy(&stk->dflt, cfg, sizeof(stk->dflt)); 324 memcpy(&stk->dflt, cfg, sizeof(stk->dflt));
@@ -278,21 +334,26 @@ static int ide_config(struct pcmcia_device *link)
278 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); 334 CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
279 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); 335 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));
280 336
337 if(is_mmio)
338 my_outb = outb_mem;
339 else
340 my_outb = outb_io;
341
281 /* disable drive interrupts during IDE probe */ 342 /* disable drive interrupts during IDE probe */
282 outb(0x02, ctl_base); 343 my_outb(0x02, ctl_base);
283 344
284 /* special setup for KXLC005 card */ 345 /* special setup for KXLC005 card */
285 if (is_kme) 346 if (is_kme)
286 outb(0x81, ctl_base+1); 347 my_outb(0x81, ctl_base+1);
287 348
288 /* retry registration in case device is still spinning up */ 349 /* retry registration in case device is still spinning up */
289 for (hd = -1, i = 0; i < 10; i++) { 350 for (hd = -1, i = 0; i < 10; i++) {
290 hd = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ, link); 351 hd = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ, link, is_mmio);
291 if (hd >= 0) break; 352 if (hd >= 0) break;
292 if (link->io.NumPorts1 == 0x20) { 353 if (try_slave) {
293 outb(0x02, ctl_base + 0x10); 354 my_outb(0x02, ctl_base + 0x10);
294 hd = idecs_register(io_base + 0x10, ctl_base + 0x10, 355 hd = idecs_register(io_base + 0x10, ctl_base + 0x10,
295 link->irq.AssignedIRQ, link); 356 link->irq.AssignedIRQ, link, is_mmio);
296 if (hd >= 0) { 357 if (hd >= 0) {
297 io_base += 0x10; 358 io_base += 0x10;
298 ctl_base += 0x10; 359 ctl_base += 0x10;
diff --git a/drivers/ide/legacy/macide.c b/drivers/ide/legacy/macide.c
index 90cac609d9cf..d655da749144 100644
--- a/drivers/ide/legacy/macide.c
+++ b/drivers/ide/legacy/macide.c
@@ -11,7 +11,6 @@
11 * more details. 11 * more details.
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <linux/types.h> 14#include <linux/types.h>
16#include <linux/mm.h> 15#include <linux/mm.h>
17#include <linux/interrupt.h> 16#include <linux/interrupt.h>
diff --git a/drivers/ide/legacy/qd65xx.c b/drivers/ide/legacy/qd65xx.c
index 563fab0098be..d3c3bc2640e7 100644
--- a/drivers/ide/legacy/qd65xx.c
+++ b/drivers/ide/legacy/qd65xx.c
@@ -28,7 +28,6 @@
28#undef REALLY_SLOW_IO /* most systems can safely undef this */ 28#undef REALLY_SLOW_IO /* most systems can safely undef this */
29 29
30#include <linux/module.h> 30#include <linux/module.h>
31#include <linux/config.h>
32#include <linux/types.h> 31#include <linux/types.h>
33#include <linux/kernel.h> 32#include <linux/kernel.h>
34#include <linux/delay.h> 33#include <linux/delay.h>
diff --git a/drivers/ide/legacy/umc8672.c b/drivers/ide/legacy/umc8672.c
index cdbdb2ff9f15..6e2c58c5f6a2 100644
--- a/drivers/ide/legacy/umc8672.c
+++ b/drivers/ide/legacy/umc8672.c
@@ -40,7 +40,6 @@
40#define REALLY_SLOW_IO /* some systems can safely undef this */ 40#define REALLY_SLOW_IO /* some systems can safely undef this */
41 41
42#include <linux/module.h> 42#include <linux/module.h>
43#include <linux/config.h>
44#include <linux/types.h> 43#include <linux/types.h>
45#include <linux/kernel.h> 44#include <linux/kernel.h>
46#include <linux/delay.h> 45#include <linux/delay.h>
diff --git a/drivers/ide/pci/aec62xx.c b/drivers/ide/pci/aec62xx.c
index ff0cdc142f17..a7c725f8bf64 100644
--- a/drivers/ide/pci/aec62xx.c
+++ b/drivers/ide/pci/aec62xx.c
@@ -6,7 +6,6 @@
6 */ 6 */
7 7
8#include <linux/module.h> 8#include <linux/module.h>
9#include <linux/config.h>
10#include <linux/types.h> 9#include <linux/types.h>
11#include <linux/pci.h> 10#include <linux/pci.h>
12#include <linux/delay.h> 11#include <linux/delay.h>
@@ -254,7 +253,8 @@ static unsigned int __devinit init_chipset_aec62xx(struct pci_dev *dev, const ch
254 253
255 if (dev->resource[PCI_ROM_RESOURCE].start) { 254 if (dev->resource[PCI_ROM_RESOURCE].start) {
256 pci_write_config_dword(dev, PCI_ROM_ADDRESS, dev->resource[PCI_ROM_RESOURCE].start | PCI_ROM_ADDRESS_ENABLE); 255 pci_write_config_dword(dev, PCI_ROM_ADDRESS, dev->resource[PCI_ROM_RESOURCE].start | PCI_ROM_ADDRESS_ENABLE);
257 printk(KERN_INFO "%s: ROM enabled at 0x%08lx\n", name, dev->resource[PCI_ROM_RESOURCE].start); 256 printk(KERN_INFO "%s: ROM enabled at 0x%08lx\n", name,
257 (unsigned long)dev->resource[PCI_ROM_RESOURCE].start);
258 } 258 }
259 259
260 if (bus_speed <= 33) 260 if (bus_speed <= 33)
diff --git a/drivers/ide/pci/alim15x3.c b/drivers/ide/pci/alim15x3.c
index 8b24b4f2a839..351dab2fcacf 100644
--- a/drivers/ide/pci/alim15x3.c
+++ b/drivers/ide/pci/alim15x3.c
@@ -27,7 +27,6 @@
27 * 27 *
28 */ 28 */
29 29
30#include <linux/config.h>
31#include <linux/module.h> 30#include <linux/module.h>
32#include <linux/types.h> 31#include <linux/types.h>
33#include <linux/kernel.h> 32#include <linux/kernel.h>
diff --git a/drivers/ide/pci/amd74xx.c b/drivers/ide/pci/amd74xx.c
index 85007cb12c52..2b0ea8b6608d 100644
--- a/drivers/ide/pci/amd74xx.c
+++ b/drivers/ide/pci/amd74xx.c
@@ -16,7 +16,6 @@
16 * the Free Software Foundation. 16 * the Free Software Foundation.
17 */ 17 */
18 18
19#include <linux/config.h>
20#include <linux/module.h> 19#include <linux/module.h>
21#include <linux/kernel.h> 20#include <linux/kernel.h>
22#include <linux/ioport.h> 21#include <linux/ioport.h>
diff --git a/drivers/ide/pci/atiixp.c b/drivers/ide/pci/atiixp.c
index 900efd1da587..a574de5f0835 100644
--- a/drivers/ide/pci/atiixp.c
+++ b/drivers/ide/pci/atiixp.c
@@ -6,7 +6,6 @@
6 * 6 *
7 */ 7 */
8 8
9#include <linux/config.h>
10#include <linux/types.h> 9#include <linux/types.h>
11#include <linux/module.h> 10#include <linux/module.h>
12#include <linux/kernel.h> 11#include <linux/kernel.h>
diff --git a/drivers/ide/pci/cmd640.c b/drivers/ide/pci/cmd640.c
index 11d035f1983d..61b5f9c0b2f4 100644
--- a/drivers/ide/pci/cmd640.c
+++ b/drivers/ide/pci/cmd640.c
@@ -103,7 +103,6 @@
103 103
104//#define CMD640_DUMP_REGS 104//#define CMD640_DUMP_REGS
105 105
106#include <linux/config.h>
107#include <linux/types.h> 106#include <linux/types.h>
108#include <linux/kernel.h> 107#include <linux/kernel.h>
109#include <linux/delay.h> 108#include <linux/delay.h>
diff --git a/drivers/ide/pci/cmd64x.c b/drivers/ide/pci/cmd64x.c
index 92b7b1549b16..20c32716bbc4 100644
--- a/drivers/ide/pci/cmd64x.c
+++ b/drivers/ide/pci/cmd64x.c
@@ -14,7 +14,6 @@
14 * Copyright (C) 1999-2002 Andre Hedrick <andre@linux-ide.org> 14 * Copyright (C) 1999-2002 Andre Hedrick <andre@linux-ide.org>
15 */ 15 */
16 16
17#include <linux/config.h>
18#include <linux/module.h> 17#include <linux/module.h>
19#include <linux/types.h> 18#include <linux/types.h>
20#include <linux/pci.h> 19#include <linux/pci.h>
diff --git a/drivers/ide/pci/cs5520.c b/drivers/ide/pci/cs5520.c
index ea3c52cc8ac1..079f7c86726b 100644
--- a/drivers/ide/pci/cs5520.c
+++ b/drivers/ide/pci/cs5520.c
@@ -32,7 +32,6 @@
32 * 32 *
33 */ 33 */
34 34
35#include <linux/config.h>
36#include <linux/module.h> 35#include <linux/module.h>
37#include <linux/types.h> 36#include <linux/types.h>
38#include <linux/kernel.h> 37#include <linux/kernel.h>
diff --git a/drivers/ide/pci/cs5530.c b/drivers/ide/pci/cs5530.c
index 09269e574b3e..380bb28c7c54 100644
--- a/drivers/ide/pci/cs5530.c
+++ b/drivers/ide/pci/cs5530.c
@@ -14,7 +14,6 @@
14 * CS5530 documentation available from National Semiconductor. 14 * CS5530 documentation available from National Semiconductor.
15 */ 15 */
16 16
17#include <linux/config.h>
18#include <linux/module.h> 17#include <linux/module.h>
19#include <linux/types.h> 18#include <linux/types.h>
20#include <linux/kernel.h> 19#include <linux/kernel.h>
diff --git a/drivers/ide/pci/cs5535.c b/drivers/ide/pci/cs5535.c
index 6eb305197f3c..5c5aec28e671 100644
--- a/drivers/ide/pci/cs5535.c
+++ b/drivers/ide/pci/cs5535.c
@@ -23,7 +23,6 @@
23 * CS5535 documentation available from AMD 23 * CS5535 documentation available from AMD
24 */ 24 */
25 25
26#include <linux/config.h>
27#include <linux/module.h> 26#include <linux/module.h>
28#include <linux/pci.h> 27#include <linux/pci.h>
29#include <linux/ide.h> 28#include <linux/ide.h>
diff --git a/drivers/ide/pci/cy82c693.c b/drivers/ide/pci/cy82c693.c
index 9f41ecd56338..120929fbe7a3 100644
--- a/drivers/ide/pci/cy82c693.c
+++ b/drivers/ide/pci/cy82c693.c
@@ -44,7 +44,6 @@
44 * 44 *
45 */ 45 */
46 46
47#include <linux/config.h>
48#include <linux/module.h> 47#include <linux/module.h>
49#include <linux/types.h> 48#include <linux/types.h>
50#include <linux/pci.h> 49#include <linux/pci.h>
diff --git a/drivers/ide/pci/hpt34x.c b/drivers/ide/pci/hpt34x.c
index be334da7a754..b46cb042290a 100644
--- a/drivers/ide/pci/hpt34x.c
+++ b/drivers/ide/pci/hpt34x.c
@@ -24,7 +24,6 @@
24 * Non-bootable card or HPT343 :: pcicmd == 0x05 24 * Non-bootable card or HPT343 :: pcicmd == 0x05
25 */ 25 */
26 26
27#include <linux/config.h>
28#include <linux/module.h> 27#include <linux/module.h>
29#include <linux/types.h> 28#include <linux/types.h>
30#include <linux/kernel.h> 29#include <linux/kernel.h>
@@ -176,7 +175,7 @@ static unsigned int __devinit init_chipset_hpt34x(struct pci_dev *dev, const cha
176 pci_write_config_dword(dev, PCI_ROM_ADDRESS, 175 pci_write_config_dword(dev, PCI_ROM_ADDRESS,
177 dev->resource[PCI_ROM_RESOURCE].start | PCI_ROM_ADDRESS_ENABLE); 176 dev->resource[PCI_ROM_RESOURCE].start | PCI_ROM_ADDRESS_ENABLE);
178 printk(KERN_INFO "HPT345: ROM enabled at 0x%08lx\n", 177 printk(KERN_INFO "HPT345: ROM enabled at 0x%08lx\n",
179 dev->resource[PCI_ROM_RESOURCE].start); 178 (unsigned long)dev->resource[PCI_ROM_RESOURCE].start);
180 } 179 }
181 pci_write_config_byte(dev, PCI_LATENCY_TIMER, 0xF0); 180 pci_write_config_byte(dev, PCI_LATENCY_TIMER, 0xF0);
182 } else { 181 } else {
diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c
index 940bdd4c5784..e993a51f250e 100644
--- a/drivers/ide/pci/hpt366.c
+++ b/drivers/ide/pci/hpt366.c
@@ -55,7 +55,6 @@
55 */ 55 */
56 56
57 57
58#include <linux/config.h>
59#include <linux/types.h> 58#include <linux/types.h>
60#include <linux/module.h> 59#include <linux/module.h>
61#include <linux/kernel.h> 60#include <linux/kernel.h>
diff --git a/drivers/ide/pci/it8172.c b/drivers/ide/pci/it8172.c
index 93462926b9d5..0fc89fafad65 100644
--- a/drivers/ide/pci/it8172.c
+++ b/drivers/ide/pci/it8172.c
@@ -28,7 +28,6 @@
28 * 675 Mass Ave, Cambridge, MA 02139, USA. 28 * 675 Mass Ave, Cambridge, MA 02139, USA.
29 */ 29 */
30 30
31#include <linux/config.h>
32#include <linux/module.h> 31#include <linux/module.h>
33#include <linux/types.h> 32#include <linux/types.h>
34#include <linux/kernel.h> 33#include <linux/kernel.h>
diff --git a/drivers/ide/pci/it821x.c b/drivers/ide/pci/it821x.c
index 38f41b377ff6..3cb04424d351 100644
--- a/drivers/ide/pci/it821x.c
+++ b/drivers/ide/pci/it821x.c
@@ -62,7 +62,6 @@
62 * - Move to libata once it grows up 62 * - Move to libata once it grows up
63 */ 63 */
64 64
65#include <linux/config.h>
66#include <linux/types.h> 65#include <linux/types.h>
67#include <linux/module.h> 66#include <linux/module.h>
68#include <linux/pci.h> 67#include <linux/pci.h>
@@ -651,6 +650,8 @@ static void __devinit init_hwif_it821x(ide_hwif_t *hwif)
651 } 650 }
652 ide_set_hwifdata(hwif, idev); 651 ide_set_hwifdata(hwif, idev);
653 652
653 hwif->atapi_dma = 1;
654
654 pci_read_config_byte(hwif->pci_dev, 0x50, &conf); 655 pci_read_config_byte(hwif->pci_dev, 0x50, &conf);
655 if(conf & 1) { 656 if(conf & 1) {
656 idev->smart = 1; 657 idev->smart = 1;
diff --git a/drivers/ide/pci/ns87415.c b/drivers/ide/pci/ns87415.c
index fcd5142f5cfe..d95714bcee4e 100644
--- a/drivers/ide/pci/ns87415.c
+++ b/drivers/ide/pci/ns87415.c
@@ -9,7 +9,6 @@
9 * Inspired by an earlier effort from David S. Miller <davem@redhat.com> 9 * Inspired by an earlier effort from David S. Miller <davem@redhat.com>
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/module.h> 12#include <linux/module.h>
14#include <linux/types.h> 13#include <linux/types.h>
15#include <linux/kernel.h> 14#include <linux/kernel.h>
diff --git a/drivers/ide/pci/pdc202xx_new.c b/drivers/ide/pci/pdc202xx_new.c
index 2c9e938dd1cd..6c097e80b4df 100644
--- a/drivers/ide/pci/pdc202xx_new.c
+++ b/drivers/ide/pci/pdc202xx_new.c
@@ -14,7 +14,6 @@
14 * Released under terms of General Public License 14 * Released under terms of General Public License
15 */ 15 */
16 16
17#include <linux/config.h>
18#include <linux/module.h> 17#include <linux/module.h>
19#include <linux/types.h> 18#include <linux/types.h>
20#include <linux/kernel.h> 19#include <linux/kernel.h>
@@ -313,8 +312,8 @@ static unsigned int __devinit init_chipset_pdcnew(struct pci_dev *dev, const cha
313 if (dev->resource[PCI_ROM_RESOURCE].start) { 312 if (dev->resource[PCI_ROM_RESOURCE].start) {
314 pci_write_config_dword(dev, PCI_ROM_ADDRESS, 313 pci_write_config_dword(dev, PCI_ROM_ADDRESS,
315 dev->resource[PCI_ROM_RESOURCE].start | PCI_ROM_ADDRESS_ENABLE); 314 dev->resource[PCI_ROM_RESOURCE].start | PCI_ROM_ADDRESS_ENABLE);
316 printk(KERN_INFO "%s: ROM enabled at 0x%08lx\n", 315 printk(KERN_INFO "%s: ROM enabled at 0x%08lx\n", name,
317 name, dev->resource[PCI_ROM_RESOURCE].start); 316 (unsigned long)dev->resource[PCI_ROM_RESOURCE].start);
318 } 317 }
319 318
320#ifdef CONFIG_PPC_PMAC 319#ifdef CONFIG_PPC_PMAC
diff --git a/drivers/ide/pci/pdc202xx_old.c b/drivers/ide/pci/pdc202xx_old.c
index 26bc688a1821..b46022a11bef 100644
--- a/drivers/ide/pci/pdc202xx_old.c
+++ b/drivers/ide/pci/pdc202xx_old.c
@@ -28,7 +28,6 @@
28 * Released under terms of General Public License 28 * Released under terms of General Public License
29 */ 29 */
30 30
31#include <linux/config.h>
32#include <linux/types.h> 31#include <linux/types.h>
33#include <linux/module.h> 32#include <linux/module.h>
34#include <linux/kernel.h> 33#include <linux/kernel.h>
@@ -490,8 +489,8 @@ static unsigned int __devinit init_chipset_pdc202xx(struct pci_dev *dev,
490 if (dev->resource[PCI_ROM_RESOURCE].start) { 489 if (dev->resource[PCI_ROM_RESOURCE].start) {
491 pci_write_config_dword(dev, PCI_ROM_ADDRESS, 490 pci_write_config_dword(dev, PCI_ROM_ADDRESS,
492 dev->resource[PCI_ROM_RESOURCE].start | PCI_ROM_ADDRESS_ENABLE); 491 dev->resource[PCI_ROM_RESOURCE].start | PCI_ROM_ADDRESS_ENABLE);
493 printk(KERN_INFO "%s: ROM enabled at 0x%08lx\n", 492 printk(KERN_INFO "%s: ROM enabled at 0x%08lx\n", name,
494 name, dev->resource[PCI_ROM_RESOURCE].start); 493 (unsigned long)dev->resource[PCI_ROM_RESOURCE].start);
495 } 494 }
496 495
497 return dev->irq; 496 return dev->irq;
diff --git a/drivers/ide/pci/piix.c b/drivers/ide/pci/piix.c
index 7fac6f57b5d6..50332ddd5ddb 100644
--- a/drivers/ide/pci/piix.c
+++ b/drivers/ide/pci/piix.c
@@ -90,7 +90,6 @@
90 * ICH3 errata #18 - Don't use native mode 90 * ICH3 errata #18 - Don't use native mode
91 */ 91 */
92 92
93#include <linux/config.h>
94#include <linux/types.h> 93#include <linux/types.h>
95#include <linux/module.h> 94#include <linux/module.h>
96#include <linux/kernel.h> 95#include <linux/kernel.h>
diff --git a/drivers/ide/pci/sc1200.c b/drivers/ide/pci/sc1200.c
index 778b82ae964d..fc2b5496b6d2 100644
--- a/drivers/ide/pci/sc1200.c
+++ b/drivers/ide/pci/sc1200.c
@@ -11,7 +11,6 @@
11 * Available from National Semiconductor 11 * Available from National Semiconductor
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <linux/module.h> 14#include <linux/module.h>
16#include <linux/types.h> 15#include <linux/types.h>
17#include <linux/kernel.h> 16#include <linux/kernel.h>
diff --git a/drivers/ide/pci/serverworks.c b/drivers/ide/pci/serverworks.c
index 5100b827a935..03677bff0d72 100644
--- a/drivers/ide/pci/serverworks.c
+++ b/drivers/ide/pci/serverworks.c
@@ -29,7 +29,6 @@
29 * 29 *
30 */ 30 */
31 31
32#include <linux/config.h>
33#include <linux/types.h> 32#include <linux/types.h>
34#include <linux/module.h> 33#include <linux/module.h>
35#include <linux/kernel.h> 34#include <linux/kernel.h>
diff --git a/drivers/ide/pci/siimage.c b/drivers/ide/pci/siimage.c
index 72dade14c725..25ceb4a39ed2 100644
--- a/drivers/ide/pci/siimage.c
+++ b/drivers/ide/pci/siimage.c
@@ -27,7 +27,6 @@
27 * if neccessary 27 * if neccessary
28 */ 28 */
29 29
30#include <linux/config.h>
31#include <linux/types.h> 30#include <linux/types.h>
32#include <linux/module.h> 31#include <linux/module.h>
33#include <linux/pci.h> 32#include <linux/pci.h>
diff --git a/drivers/ide/pci/sis5513.c b/drivers/ide/pci/sis5513.c
index 8e9d87701ce2..8a6c23ac8cc1 100644
--- a/drivers/ide/pci/sis5513.c
+++ b/drivers/ide/pci/sis5513.c
@@ -44,7 +44,6 @@
44 * 962/963. 44 * 962/963.
45 */ 45 */
46 46
47#include <linux/config.h>
48#include <linux/types.h> 47#include <linux/types.h>
49#include <linux/module.h> 48#include <linux/module.h>
50#include <linux/kernel.h> 49#include <linux/kernel.h>
diff --git a/drivers/ide/pci/sl82c105.c b/drivers/ide/pci/sl82c105.c
index 900301e43818..0b4b60498515 100644
--- a/drivers/ide/pci/sl82c105.c
+++ b/drivers/ide/pci/sl82c105.c
@@ -13,7 +13,6 @@
13 * -- Benjamin Herrenschmidt (01/11/03) benh@kernel.crashing.org 13 * -- Benjamin Herrenschmidt (01/11/03) benh@kernel.crashing.org
14 */ 14 */
15 15
16#include <linux/config.h>
17#include <linux/types.h> 16#include <linux/types.h>
18#include <linux/module.h> 17#include <linux/module.h>
19#include <linux/kernel.h> 18#include <linux/kernel.h>
diff --git a/drivers/ide/pci/slc90e66.c b/drivers/ide/pci/slc90e66.c
index 0968f6bc669a..4a1853af3bbb 100644
--- a/drivers/ide/pci/slc90e66.c
+++ b/drivers/ide/pci/slc90e66.c
@@ -8,7 +8,6 @@
8 * 8 *
9 */ 9 */
10 10
11#include <linux/config.h>
12#include <linux/types.h> 11#include <linux/types.h>
13#include <linux/module.h> 12#include <linux/module.h>
14#include <linux/kernel.h> 13#include <linux/kernel.h>
diff --git a/drivers/ide/pci/triflex.c b/drivers/ide/pci/triflex.c
index f96b56838f33..56d84931d6de 100644
--- a/drivers/ide/pci/triflex.c
+++ b/drivers/ide/pci/triflex.c
@@ -27,7 +27,6 @@
27 * Not publically available. 27 * Not publically available.
28 */ 28 */
29 29
30#include <linux/config.h>
31#include <linux/types.h> 30#include <linux/types.h>
32#include <linux/module.h> 31#include <linux/module.h>
33#include <linux/kernel.h> 32#include <linux/kernel.h>
diff --git a/drivers/ide/pci/trm290.c b/drivers/ide/pci/trm290.c
index fe80295974e1..2a282529bfc1 100644
--- a/drivers/ide/pci/trm290.c
+++ b/drivers/ide/pci/trm290.c
@@ -128,7 +128,6 @@
128 * 128 *
129 */ 129 */
130 130
131#include <linux/config.h>
132#include <linux/types.h> 131#include <linux/types.h>
133#include <linux/module.h> 132#include <linux/module.h>
134#include <linux/kernel.h> 133#include <linux/kernel.h>
diff --git a/drivers/ide/pci/via82cxxx.c b/drivers/ide/pci/via82cxxx.c
index 3e677c4f8c28..afdaee3c15c9 100644
--- a/drivers/ide/pci/via82cxxx.c
+++ b/drivers/ide/pci/via82cxxx.c
@@ -26,7 +26,6 @@
26 * the Free Software Foundation. 26 * the Free Software Foundation.
27 */ 27 */
28 28
29#include <linux/config.h>
30#include <linux/module.h> 29#include <linux/module.h>
31#include <linux/kernel.h> 30#include <linux/kernel.h>
32#include <linux/ioport.h> 31#include <linux/ioport.h>
diff --git a/drivers/ide/ppc/mpc8xx.c b/drivers/ide/ppc/mpc8xx.c
index b80c6135ae93..0ac9da3a7378 100644
--- a/drivers/ide/ppc/mpc8xx.c
+++ b/drivers/ide/ppc/mpc8xx.c
@@ -11,7 +11,6 @@
11 * by Mathew Locke <mattl@mvista.com> 11 * by Mathew Locke <mattl@mvista.com>
12 */ 12 */
13 13
14#include <linux/config.h>
15#include <linux/errno.h> 14#include <linux/errno.h>
16#include <linux/sched.h> 15#include <linux/sched.h>
17#include <linux/kernel.h> 16#include <linux/kernel.h>
diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c
index ffca8b63ee79..ebf961f1718d 100644
--- a/drivers/ide/ppc/pmac.c
+++ b/drivers/ide/ppc/pmac.c
@@ -22,7 +22,6 @@
22 * big table 22 * big table
23 * 23 *
24 */ 24 */
25#include <linux/config.h>
26#include <linux/types.h> 25#include <linux/types.h>
27#include <linux/kernel.h> 26#include <linux/kernel.h>
28#include <linux/sched.h> 27#include <linux/sched.h>
@@ -421,107 +420,6 @@ static void pmac_ide_kauai_selectproc(ide_drive_t *drive);
421#endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */ 420#endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */
422 421
423/* 422/*
424 * Below is the code for blinking the laptop LED along with hard
425 * disk activity.
426 */
427
428#ifdef CONFIG_BLK_DEV_IDE_PMAC_BLINK
429
430/* Set to 50ms minimum led-on time (also used to limit frequency
431 * of requests sent to the PMU
432 */
433#define PMU_HD_BLINK_TIME (HZ/50)
434
435static struct adb_request pmu_blink_on, pmu_blink_off;
436static spinlock_t pmu_blink_lock;
437static unsigned long pmu_blink_stoptime;
438static int pmu_blink_ledstate;
439static struct timer_list pmu_blink_timer;
440static int pmu_ide_blink_enabled;
441
442
443static void
444pmu_hd_blink_timeout(unsigned long data)
445{
446 unsigned long flags;
447
448 spin_lock_irqsave(&pmu_blink_lock, flags);
449
450 /* We may have been triggered again in a racy way, check
451 * that we really want to switch it off
452 */
453 if (time_after(pmu_blink_stoptime, jiffies))
454 goto done;
455
456 /* Previous req. not complete, try 100ms more */
457 if (pmu_blink_off.complete == 0)
458 mod_timer(&pmu_blink_timer, jiffies + PMU_HD_BLINK_TIME);
459 else if (pmu_blink_ledstate) {
460 pmu_request(&pmu_blink_off, NULL, 4, 0xee, 4, 0, 0);
461 pmu_blink_ledstate = 0;
462 }
463done:
464 spin_unlock_irqrestore(&pmu_blink_lock, flags);
465}
466
467static void
468pmu_hd_kick_blink(void *data, int rw)
469{
470 unsigned long flags;
471
472 pmu_blink_stoptime = jiffies + PMU_HD_BLINK_TIME;
473 wmb();
474 mod_timer(&pmu_blink_timer, pmu_blink_stoptime);
475 /* Fast path when LED is already ON */
476 if (pmu_blink_ledstate == 1)
477 return;
478 spin_lock_irqsave(&pmu_blink_lock, flags);
479 if (pmu_blink_on.complete && !pmu_blink_ledstate) {
480 pmu_request(&pmu_blink_on, NULL, 4, 0xee, 4, 0, 1);
481 pmu_blink_ledstate = 1;
482 }
483 spin_unlock_irqrestore(&pmu_blink_lock, flags);
484}
485
486static int
487pmu_hd_blink_init(void)
488{
489 struct device_node *dt;
490 const char *model;
491
492 /* Currently, I only enable this feature on KeyLargo based laptops,
493 * older laptops may support it (at least heathrow/paddington) but
494 * I don't feel like loading those venerable old machines with so
495 * much additional interrupt & PMU activity...
496 */
497 if (pmu_get_model() != PMU_KEYLARGO_BASED)
498 return 0;
499
500 dt = of_find_node_by_path("/");
501 if (dt == NULL)
502 return 0;
503 model = (const char *)get_property(dt, "model", NULL);
504 if (model == NULL)
505 return 0;
506 if (strncmp(model, "PowerBook", strlen("PowerBook")) != 0 &&
507 strncmp(model, "iBook", strlen("iBook")) != 0) {
508 of_node_put(dt);
509 return 0;
510 }
511 of_node_put(dt);
512
513 pmu_blink_on.complete = 1;
514 pmu_blink_off.complete = 1;
515 spin_lock_init(&pmu_blink_lock);
516 init_timer(&pmu_blink_timer);
517 pmu_blink_timer.function = pmu_hd_blink_timeout;
518
519 return 1;
520}
521
522#endif /* CONFIG_BLK_DEV_IDE_PMAC_BLINK */
523
524/*
525 * N.B. this can't be an initfunc, because the media-bay task can 423 * N.B. this can't be an initfunc, because the media-bay task can
526 * call ide_[un]register at any time. 424 * call ide_[un]register at any time.
527 */ 425 */
@@ -1192,23 +1090,6 @@ pmac_ide_do_suspend(ide_hwif_t *hwif)
1192 pmif->timings[0] = 0; 1090 pmif->timings[0] = 0;
1193 pmif->timings[1] = 0; 1091 pmif->timings[1] = 0;
1194 1092
1195#ifdef CONFIG_BLK_DEV_IDE_PMAC_BLINK
1196 /* Note: This code will be called for every hwif, thus we'll
1197 * try several time to stop the LED blinker timer, but that
1198 * should be harmless
1199 */
1200 if (pmu_ide_blink_enabled) {
1201 unsigned long flags;
1202
1203 /* Make sure we don't hit the PMU blink */
1204 spin_lock_irqsave(&pmu_blink_lock, flags);
1205 if (pmu_blink_ledstate)
1206 del_timer(&pmu_blink_timer);
1207 pmu_blink_ledstate = 0;
1208 spin_unlock_irqrestore(&pmu_blink_lock, flags);
1209 }
1210#endif /* CONFIG_BLK_DEV_IDE_PMAC_BLINK */
1211
1212 disable_irq(pmif->irq); 1093 disable_irq(pmif->irq);
1213 1094
1214 /* The media bay will handle itself just fine */ 1095 /* The media bay will handle itself just fine */
@@ -1376,13 +1257,6 @@ pmac_ide_setup_device(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif)
1376 hwif->selectproc = pmac_ide_selectproc; 1257 hwif->selectproc = pmac_ide_selectproc;
1377 hwif->speedproc = pmac_ide_tune_chipset; 1258 hwif->speedproc = pmac_ide_tune_chipset;
1378 1259
1379#ifdef CONFIG_BLK_DEV_IDE_PMAC_BLINK
1380 pmu_ide_blink_enabled = pmu_hd_blink_init();
1381
1382 if (pmu_ide_blink_enabled)
1383 hwif->led_act = pmu_hd_kick_blink;
1384#endif
1385
1386 printk(KERN_INFO "ide%d: Found Apple %s controller, bus ID %d%s, irq %d\n", 1260 printk(KERN_INFO "ide%d: Found Apple %s controller, bus ID %d%s, irq %d\n",
1387 hwif->index, model_name[pmif->kind], pmif->aapl_bus_id, 1261 hwif->index, model_name[pmif->kind], pmif->aapl_bus_id,
1388 pmif->mediabay ? " (mediabay)" : "", hwif->irq); 1262 pmif->mediabay ? " (mediabay)" : "", hwif->irq);
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c
index c11e3b2e67a6..eb0945284acc 100644
--- a/drivers/ide/setup-pci.c
+++ b/drivers/ide/setup-pci.c
@@ -18,7 +18,6 @@
18 * configuration of all PCI IDE interfaces present in a system. 18 * configuration of all PCI IDE interfaces present in a system.
19 */ 19 */
20 20
21#include <linux/config.h>
22#include <linux/module.h> 21#include <linux/module.h>
23#include <linux/types.h> 22#include <linux/types.h>
24#include <linux/kernel.h> 23#include <linux/kernel.h>