aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/cdrom/cdrom.c4
-rw-r--r--drivers/ide/Kconfig10
-rw-r--r--drivers/ide/arm/palm_bk3710.c2
-rw-r--r--drivers/ide/ide-cd.c30
-rw-r--r--drivers/ide/ide-disk.c11
-rw-r--r--drivers/ide/ide-dma.c6
-rw-r--r--drivers/ide/ide-floppy.c11
-rw-r--r--drivers/ide/ide-iops.c6
-rw-r--r--drivers/ide/ide-tape.c11
-rw-r--r--drivers/ide/pci/aec62xx.c2
-rw-r--r--drivers/ide/pci/alim15x3.c2
-rw-r--r--drivers/ide/pci/amd74xx.c2
-rw-r--r--drivers/ide/pci/atiixp.c2
-rw-r--r--drivers/ide/pci/cmd64x.c2
-rw-r--r--drivers/ide/pci/cs5520.c1
-rw-r--r--drivers/ide/pci/cs5535.c2
-rw-r--r--drivers/ide/pci/hpt366.c2
-rw-r--r--drivers/ide/pci/it8213.c2
-rw-r--r--drivers/ide/pci/it821x.c4
-rw-r--r--drivers/ide/pci/jmicron.c2
-rw-r--r--drivers/ide/pci/pdc202xx_new.c2
-rw-r--r--drivers/ide/pci/pdc202xx_old.c2
-rw-r--r--drivers/ide/pci/piix.c2
-rw-r--r--drivers/ide/pci/scc_pata.c2
-rw-r--r--drivers/ide/pci/serverworks.c8
-rw-r--r--drivers/ide/pci/siimage.c4
-rw-r--r--drivers/ide/pci/sis5513.c2
-rw-r--r--drivers/ide/pci/slc90e66.c2
-rw-r--r--drivers/ide/pci/tc86c001.c2
-rw-r--r--drivers/ide/pci/via82cxxx.c2
-rw-r--r--drivers/macintosh/mediabay.c1
-rw-r--r--drivers/scsi/hptiop.c1
-rw-r--r--drivers/scsi/ide-scsi.c11
-rw-r--r--drivers/usb/storage/freecom.c2
34 files changed, 72 insertions, 85 deletions
diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
index a5da35632651..d9d1b65d206c 100644
--- a/drivers/cdrom/cdrom.c
+++ b/drivers/cdrom/cdrom.c
@@ -1436,10 +1436,6 @@ static void cdrom_count_tracks(struct cdrom_device_info *cdi, tracktype* tracks)
1436 tracks->xa=0; 1436 tracks->xa=0;
1437 tracks->error=0; 1437 tracks->error=0;
1438 cdinfo(CD_COUNT_TRACKS, "entering cdrom_count_tracks\n"); 1438 cdinfo(CD_COUNT_TRACKS, "entering cdrom_count_tracks\n");
1439 if (!CDROM_CAN(CDC_PLAY_AUDIO)) {
1440 tracks->error=CDS_NO_INFO;
1441 return;
1442 }
1443 /* Grab the TOC header so we can see how many tracks there are */ 1439 /* Grab the TOC header so we can see how many tracks there are */
1444 if ((ret = cdi->ops->audio_ioctl(cdi, CDROMREADTOCHDR, &header))) { 1440 if ((ret = cdi->ops->audio_ioctl(cdi, CDROMREADTOCHDR, &header))) {
1445 if (ret == -ENOMEDIUM) 1441 if (ret == -ENOMEDIUM)
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
index 130ef64b44f7..a34758d29516 100644
--- a/drivers/ide/Kconfig
+++ b/drivers/ide/Kconfig
@@ -54,16 +54,6 @@ menuconfig IDE
54 54
55if IDE 55if IDE
56 56
57config IDE_MAX_HWIFS
58 int "Max IDE interfaces"
59 depends on ALPHA || SUPERH || IA64 || EMBEDDED
60 range 1 10
61 default 4
62 help
63 This is the maximum number of IDE hardware interfaces that will
64 be supported by the driver. Make sure it is at least as high as
65 the number of IDE interfaces in your system.
66
67config BLK_DEV_IDE 57config BLK_DEV_IDE
68 tristate "Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support" 58 tristate "Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support"
69 ---help--- 59 ---help---
diff --git a/drivers/ide/arm/palm_bk3710.c b/drivers/ide/arm/palm_bk3710.c
index 3e842d60eae9..f788fa5a977b 100644
--- a/drivers/ide/arm/palm_bk3710.c
+++ b/drivers/ide/arm/palm_bk3710.c
@@ -309,7 +309,7 @@ static void __devinit palm_bk3710_chipinit(void __iomem *base)
309 palm_bk3710_setpiomode(base, NULL, 1, 600, 0); 309 palm_bk3710_setpiomode(base, NULL, 1, 600, 0);
310} 310}
311 311
312static u8 __devinit palm_bk3710_cable_detect(ide_hwif_t *hwif) 312static u8 palm_bk3710_cable_detect(ide_hwif_t *hwif)
313{ 313{
314 return ATA_CBL_PATA80; 314 return ATA_CBL_PATA80;
315} 315}
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index e617cf08aef6..89a112d513ad 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -66,11 +66,11 @@ static struct cdrom_info *ide_cd_get(struct gendisk *disk)
66 mutex_lock(&idecd_ref_mutex); 66 mutex_lock(&idecd_ref_mutex);
67 cd = ide_cd_g(disk); 67 cd = ide_cd_g(disk);
68 if (cd) { 68 if (cd) {
69 kref_get(&cd->kref); 69 if (ide_device_get(cd->drive))
70 if (ide_device_get(cd->drive)) {
71 kref_put(&cd->kref, ide_cd_release);
72 cd = NULL; 70 cd = NULL;
73 } 71 else
72 kref_get(&cd->kref);
73
74 } 74 }
75 mutex_unlock(&idecd_ref_mutex); 75 mutex_unlock(&idecd_ref_mutex);
76 return cd; 76 return cd;
@@ -78,9 +78,11 @@ static struct cdrom_info *ide_cd_get(struct gendisk *disk)
78 78
79static void ide_cd_put(struct cdrom_info *cd) 79static void ide_cd_put(struct cdrom_info *cd)
80{ 80{
81 ide_drive_t *drive = cd->drive;
82
81 mutex_lock(&idecd_ref_mutex); 83 mutex_lock(&idecd_ref_mutex);
82 ide_device_put(cd->drive);
83 kref_put(&cd->kref, ide_cd_release); 84 kref_put(&cd->kref, ide_cd_release);
85 ide_device_put(drive);
84 mutex_unlock(&idecd_ref_mutex); 86 mutex_unlock(&idecd_ref_mutex);
85} 87}
86 88
@@ -1305,6 +1307,7 @@ static int cdrom_read_capacity(ide_drive_t *drive, unsigned long *capacity,
1305 int stat; 1307 int stat;
1306 unsigned char cmd[BLK_MAX_CDB]; 1308 unsigned char cmd[BLK_MAX_CDB];
1307 unsigned len = sizeof(capbuf); 1309 unsigned len = sizeof(capbuf);
1310 u32 blocklen;
1308 1311
1309 memset(cmd, 0, BLK_MAX_CDB); 1312 memset(cmd, 0, BLK_MAX_CDB);
1310 cmd[0] = GPCMD_READ_CDVD_CAPACITY; 1313 cmd[0] = GPCMD_READ_CDVD_CAPACITY;
@@ -1317,23 +1320,24 @@ static int cdrom_read_capacity(ide_drive_t *drive, unsigned long *capacity,
1317 /* 1320 /*
1318 * Sanity check the given block size 1321 * Sanity check the given block size
1319 */ 1322 */
1320 switch (capbuf.blocklen) { 1323 blocklen = be32_to_cpu(capbuf.blocklen);
1321 case __constant_cpu_to_be32(512): 1324 switch (blocklen) {
1322 case __constant_cpu_to_be32(1024): 1325 case 512:
1323 case __constant_cpu_to_be32(2048): 1326 case 1024:
1324 case __constant_cpu_to_be32(4096): 1327 case 2048:
1328 case 4096:
1325 break; 1329 break;
1326 default: 1330 default:
1327 printk(KERN_ERR "%s: weird block size %u\n", 1331 printk(KERN_ERR "%s: weird block size %u\n",
1328 drive->name, capbuf.blocklen); 1332 drive->name, blocklen);
1329 printk(KERN_ERR "%s: default to 2kb block size\n", 1333 printk(KERN_ERR "%s: default to 2kb block size\n",
1330 drive->name); 1334 drive->name);
1331 capbuf.blocklen = __constant_cpu_to_be32(2048); 1335 blocklen = 2048;
1332 break; 1336 break;
1333 } 1337 }
1334 1338
1335 *capacity = 1 + be32_to_cpu(capbuf.lba); 1339 *capacity = 1 + be32_to_cpu(capbuf.lba);
1336 *sectors_per_frame = be32_to_cpu(capbuf.blocklen) >> SECTOR_BITS; 1340 *sectors_per_frame = blocklen >> SECTOR_BITS;
1337 return 0; 1341 return 0;
1338} 1342}
1339 1343
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index 28d85b410f7c..68b9cf0138b0 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -65,11 +65,10 @@ static struct ide_disk_obj *ide_disk_get(struct gendisk *disk)
65 mutex_lock(&idedisk_ref_mutex); 65 mutex_lock(&idedisk_ref_mutex);
66 idkp = ide_disk_g(disk); 66 idkp = ide_disk_g(disk);
67 if (idkp) { 67 if (idkp) {
68 kref_get(&idkp->kref); 68 if (ide_device_get(idkp->drive))
69 if (ide_device_get(idkp->drive)) {
70 kref_put(&idkp->kref, ide_disk_release);
71 idkp = NULL; 69 idkp = NULL;
72 } 70 else
71 kref_get(&idkp->kref);
73 } 72 }
74 mutex_unlock(&idedisk_ref_mutex); 73 mutex_unlock(&idedisk_ref_mutex);
75 return idkp; 74 return idkp;
@@ -77,9 +76,11 @@ static struct ide_disk_obj *ide_disk_get(struct gendisk *disk)
77 76
78static void ide_disk_put(struct ide_disk_obj *idkp) 77static void ide_disk_put(struct ide_disk_obj *idkp)
79{ 78{
79 ide_drive_t *drive = idkp->drive;
80
80 mutex_lock(&idedisk_ref_mutex); 81 mutex_lock(&idedisk_ref_mutex);
81 ide_device_put(idkp->drive);
82 kref_put(&idkp->kref, ide_disk_release); 82 kref_put(&idkp->kref, ide_disk_release);
83 ide_device_put(drive);
83 mutex_unlock(&idedisk_ref_mutex); 84 mutex_unlock(&idedisk_ref_mutex);
84} 85}
85 86
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index 71c377a7bcf2..adc682755857 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -649,11 +649,7 @@ static unsigned int ide_get_mode_mask(ide_drive_t *drive, u8 base, u8 req_mode)
649 if (id->field_valid & 2) { 649 if (id->field_valid & 2) {
650 mask = id->dma_1word & hwif->swdma_mask; 650 mask = id->dma_1word & hwif->swdma_mask;
651 } else if (id->tDMA) { 651 } else if (id->tDMA) {
652 /* 652 u8 mode = id->tDMA;
653 * ide_fix_driveid() doesn't convert ->tDMA to the
654 * CPU endianness so we need to do it here
655 */
656 u8 mode = le16_to_cpu(id->tDMA);
657 653
658 /* 654 /*
659 * if the mode is valid convert it to the mask 655 * if the mode is valid convert it to the mask
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index ca11a26746f1..e9034c0125f3 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -167,11 +167,10 @@ static struct ide_floppy_obj *ide_floppy_get(struct gendisk *disk)
167 mutex_lock(&idefloppy_ref_mutex); 167 mutex_lock(&idefloppy_ref_mutex);
168 floppy = ide_floppy_g(disk); 168 floppy = ide_floppy_g(disk);
169 if (floppy) { 169 if (floppy) {
170 kref_get(&floppy->kref); 170 if (ide_device_get(floppy->drive))
171 if (ide_device_get(floppy->drive)) {
172 kref_put(&floppy->kref, idefloppy_cleanup_obj);
173 floppy = NULL; 171 floppy = NULL;
174 } 172 else
173 kref_get(&floppy->kref);
175 } 174 }
176 mutex_unlock(&idefloppy_ref_mutex); 175 mutex_unlock(&idefloppy_ref_mutex);
177 return floppy; 176 return floppy;
@@ -179,9 +178,11 @@ static struct ide_floppy_obj *ide_floppy_get(struct gendisk *disk)
179 178
180static void ide_floppy_put(struct ide_floppy_obj *floppy) 179static void ide_floppy_put(struct ide_floppy_obj *floppy)
181{ 180{
181 ide_drive_t *drive = floppy->drive;
182
182 mutex_lock(&idefloppy_ref_mutex); 183 mutex_lock(&idefloppy_ref_mutex);
183 ide_device_put(floppy->drive);
184 kref_put(&floppy->kref, idefloppy_cleanup_obj); 184 kref_put(&floppy->kref, idefloppy_cleanup_obj);
185 ide_device_put(drive);
185 mutex_unlock(&idefloppy_ref_mutex); 186 mutex_unlock(&idefloppy_ref_mutex);
186} 187}
187 188
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index 8aae91764513..2cbadffe922e 100644
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -484,11 +484,11 @@ void ide_fix_driveid (struct hd_driveid *id)
484 for (i = 0; i < 3; i++) 484 for (i = 0; i < 3; i++)
485 id->words157_159[i] = __le16_to_cpu(id->words157_159[i]); 485 id->words157_159[i] = __le16_to_cpu(id->words157_159[i]);
486 id->cfa_power = __le16_to_cpu(id->cfa_power); 486 id->cfa_power = __le16_to_cpu(id->cfa_power);
487 for (i = 0; i < 14; i++) 487 for (i = 0; i < 15; i++)
488 id->words161_175[i] = __le16_to_cpu(id->words161_175[i]); 488 id->words161_175[i] = __le16_to_cpu(id->words161_175[i]);
489 for (i = 0; i < 31; i++) 489 for (i = 0; i < 30; i++)
490 id->words176_205[i] = __le16_to_cpu(id->words176_205[i]); 490 id->words176_205[i] = __le16_to_cpu(id->words176_205[i]);
491 for (i = 0; i < 48; i++) 491 for (i = 0; i < 49; i++)
492 id->words206_254[i] = __le16_to_cpu(id->words206_254[i]); 492 id->words206_254[i] = __le16_to_cpu(id->words206_254[i]);
493 id->integrity_word = __le16_to_cpu(id->integrity_word); 493 id->integrity_word = __le16_to_cpu(id->integrity_word);
494# else 494# else
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 82c2afe4d28a..1bce84b56630 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -331,11 +331,10 @@ static struct ide_tape_obj *ide_tape_get(struct gendisk *disk)
331 mutex_lock(&idetape_ref_mutex); 331 mutex_lock(&idetape_ref_mutex);
332 tape = ide_tape_g(disk); 332 tape = ide_tape_g(disk);
333 if (tape) { 333 if (tape) {
334 kref_get(&tape->kref); 334 if (ide_device_get(tape->drive))
335 if (ide_device_get(tape->drive)) {
336 kref_put(&tape->kref, ide_tape_release);
337 tape = NULL; 335 tape = NULL;
338 } 336 else
337 kref_get(&tape->kref);
339 } 338 }
340 mutex_unlock(&idetape_ref_mutex); 339 mutex_unlock(&idetape_ref_mutex);
341 return tape; 340 return tape;
@@ -343,9 +342,11 @@ static struct ide_tape_obj *ide_tape_get(struct gendisk *disk)
343 342
344static void ide_tape_put(struct ide_tape_obj *tape) 343static void ide_tape_put(struct ide_tape_obj *tape)
345{ 344{
345 ide_drive_t *drive = tape->drive;
346
346 mutex_lock(&idetape_ref_mutex); 347 mutex_lock(&idetape_ref_mutex);
347 ide_device_put(tape->drive);
348 kref_put(&tape->kref, ide_tape_release); 348 kref_put(&tape->kref, ide_tape_release);
349 ide_device_put(drive);
349 mutex_unlock(&idetape_ref_mutex); 350 mutex_unlock(&idetape_ref_mutex);
350} 351}
351 352
diff --git a/drivers/ide/pci/aec62xx.c b/drivers/ide/pci/aec62xx.c
index e0c8fe7d9fea..40644b6f1c00 100644
--- a/drivers/ide/pci/aec62xx.c
+++ b/drivers/ide/pci/aec62xx.c
@@ -160,7 +160,7 @@ static unsigned int __devinit init_chipset_aec62xx(struct pci_dev *dev)
160 return dev->irq; 160 return dev->irq;
161} 161}
162 162
163static u8 __devinit atp86x_cable_detect(ide_hwif_t *hwif) 163static u8 atp86x_cable_detect(ide_hwif_t *hwif)
164{ 164{
165 struct pci_dev *dev = to_pci_dev(hwif->dev); 165 struct pci_dev *dev = to_pci_dev(hwif->dev);
166 u8 ata66 = 0, mask = hwif->channel ? 0x02 : 0x01; 166 u8 ata66 = 0, mask = hwif->channel ? 0x02 : 0x01;
diff --git a/drivers/ide/pci/alim15x3.c b/drivers/ide/pci/alim15x3.c
index b582687e0cd4..d647526af557 100644
--- a/drivers/ide/pci/alim15x3.c
+++ b/drivers/ide/pci/alim15x3.c
@@ -371,7 +371,7 @@ static int ali_cable_override(struct pci_dev *pdev)
371 * FIXME: frobs bits that are not defined on newer ALi devicea 371 * FIXME: frobs bits that are not defined on newer ALi devicea
372 */ 372 */
373 373
374static u8 __devinit ali_cable_detect(ide_hwif_t *hwif) 374static u8 ali_cable_detect(ide_hwif_t *hwif)
375{ 375{
376 struct pci_dev *dev = to_pci_dev(hwif->dev); 376 struct pci_dev *dev = to_pci_dev(hwif->dev);
377 unsigned long flags; 377 unsigned long flags;
diff --git a/drivers/ide/pci/amd74xx.c b/drivers/ide/pci/amd74xx.c
index 2cea7bf51a0f..1e66a960a96a 100644
--- a/drivers/ide/pci/amd74xx.c
+++ b/drivers/ide/pci/amd74xx.c
@@ -175,7 +175,7 @@ static unsigned int __devinit init_chipset_amd74xx(struct pci_dev *dev)
175 return dev->irq; 175 return dev->irq;
176} 176}
177 177
178static u8 __devinit amd_cable_detect(ide_hwif_t *hwif) 178static u8 amd_cable_detect(ide_hwif_t *hwif)
179{ 179{
180 if ((amd_80w >> hwif->channel) & 1) 180 if ((amd_80w >> hwif->channel) & 1)
181 return ATA_CBL_PATA80; 181 return ATA_CBL_PATA80;
diff --git a/drivers/ide/pci/atiixp.c b/drivers/ide/pci/atiixp.c
index 332f08f43b56..41f6cb6c163a 100644
--- a/drivers/ide/pci/atiixp.c
+++ b/drivers/ide/pci/atiixp.c
@@ -119,7 +119,7 @@ static void atiixp_set_dma_mode(ide_drive_t *drive, const u8 speed)
119 spin_unlock_irqrestore(&atiixp_lock, flags); 119 spin_unlock_irqrestore(&atiixp_lock, flags);
120} 120}
121 121
122static u8 __devinit atiixp_cable_detect(ide_hwif_t *hwif) 122static u8 atiixp_cable_detect(ide_hwif_t *hwif)
123{ 123{
124 struct pci_dev *pdev = to_pci_dev(hwif->dev); 124 struct pci_dev *pdev = to_pci_dev(hwif->dev);
125 u8 udma_mode = 0, ch = hwif->channel; 125 u8 udma_mode = 0, ch = hwif->channel;
diff --git a/drivers/ide/pci/cmd64x.c b/drivers/ide/pci/cmd64x.c
index 1360b4fa9fd3..e064398e03b4 100644
--- a/drivers/ide/pci/cmd64x.c
+++ b/drivers/ide/pci/cmd64x.c
@@ -354,7 +354,7 @@ static unsigned int __devinit init_chipset_cmd64x(struct pci_dev *dev)
354 return 0; 354 return 0;
355} 355}
356 356
357static u8 __devinit cmd64x_cable_detect(ide_hwif_t *hwif) 357static u8 cmd64x_cable_detect(ide_hwif_t *hwif)
358{ 358{
359 struct pci_dev *dev = to_pci_dev(hwif->dev); 359 struct pci_dev *dev = to_pci_dev(hwif->dev);
360 u8 bmidecsr = 0, mask = hwif->channel ? 0x02 : 0x01; 360 u8 bmidecsr = 0, mask = hwif->channel ? 0x02 : 0x01;
diff --git a/drivers/ide/pci/cs5520.c b/drivers/ide/pci/cs5520.c
index c0364b287f17..151844fcbb07 100644
--- a/drivers/ide/pci/cs5520.c
+++ b/drivers/ide/pci/cs5520.c
@@ -96,6 +96,7 @@ static const struct ide_port_ops cs5520_port_ops = {
96 96
97static const struct ide_port_info cyrix_chipset __devinitdata = { 97static const struct ide_port_info cyrix_chipset __devinitdata = {
98 .name = DRV_NAME, 98 .name = DRV_NAME,
99 .enablebits = { { 0x60, 0x01, 0x01 }, { 0x60, 0x02, 0x02 } },
99 .port_ops = &cs5520_port_ops, 100 .port_ops = &cs5520_port_ops,
100 .host_flags = IDE_HFLAG_ISA_PORTS | IDE_HFLAG_CS5520, 101 .host_flags = IDE_HFLAG_ISA_PORTS | IDE_HFLAG_CS5520,
101 .pio_mask = ATA_PIO4, 102 .pio_mask = ATA_PIO4,
diff --git a/drivers/ide/pci/cs5535.c b/drivers/ide/pci/cs5535.c
index f7b50cdeefa6..dd3dc23af995 100644
--- a/drivers/ide/pci/cs5535.c
+++ b/drivers/ide/pci/cs5535.c
@@ -153,7 +153,7 @@ static void cs5535_set_pio_mode(ide_drive_t *drive, const u8 pio)
153 cs5535_set_speed(drive, XFER_PIO_0 + pio); 153 cs5535_set_speed(drive, XFER_PIO_0 + pio);
154} 154}
155 155
156static u8 __devinit cs5535_cable_detect(ide_hwif_t *hwif) 156static u8 cs5535_cable_detect(ide_hwif_t *hwif)
157{ 157{
158 struct pci_dev *dev = to_pci_dev(hwif->dev); 158 struct pci_dev *dev = to_pci_dev(hwif->dev);
159 u8 bit; 159 u8 bit;
diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c
index 5271b246b88c..748793a413ab 100644
--- a/drivers/ide/pci/hpt366.c
+++ b/drivers/ide/pci/hpt366.c
@@ -1214,7 +1214,7 @@ static unsigned int __devinit init_chipset_hpt366(struct pci_dev *dev)
1214 return dev->irq; 1214 return dev->irq;
1215} 1215}
1216 1216
1217static u8 __devinit hpt3xx_cable_detect(ide_hwif_t *hwif) 1217static u8 hpt3xx_cable_detect(ide_hwif_t *hwif)
1218{ 1218{
1219 struct pci_dev *dev = to_pci_dev(hwif->dev); 1219 struct pci_dev *dev = to_pci_dev(hwif->dev);
1220 struct ide_host *host = pci_get_drvdata(dev); 1220 struct ide_host *host = pci_get_drvdata(dev);
diff --git a/drivers/ide/pci/it8213.c b/drivers/ide/pci/it8213.c
index 6eba8f188264..652e47dd7e89 100644
--- a/drivers/ide/pci/it8213.c
+++ b/drivers/ide/pci/it8213.c
@@ -141,7 +141,7 @@ static void it8213_set_dma_mode(ide_drive_t *drive, const u8 speed)
141 } 141 }
142} 142}
143 143
144static u8 __devinit it8213_cable_detect(ide_hwif_t *hwif) 144static u8 it8213_cable_detect(ide_hwif_t *hwif)
145{ 145{
146 struct pci_dev *dev = to_pci_dev(hwif->dev); 146 struct pci_dev *dev = to_pci_dev(hwif->dev);
147 u8 reg42h = 0; 147 u8 reg42h = 0;
diff --git a/drivers/ide/pci/it821x.c b/drivers/ide/pci/it821x.c
index e16a1d113a2a..b6dc723de702 100644
--- a/drivers/ide/pci/it821x.c
+++ b/drivers/ide/pci/it821x.c
@@ -428,7 +428,7 @@ static void it821x_set_dma_mode(ide_drive_t *drive, const u8 speed)
428 * the needed logic onboard. 428 * the needed logic onboard.
429 */ 429 */
430 430
431static u8 __devinit it821x_cable_detect(ide_hwif_t *hwif) 431static u8 it821x_cable_detect(ide_hwif_t *hwif)
432{ 432{
433 /* The reference driver also only does disk side */ 433 /* The reference driver also only does disk side */
434 return ATA_CBL_PATA80; 434 return ATA_CBL_PATA80;
@@ -443,7 +443,7 @@ static u8 __devinit it821x_cable_detect(ide_hwif_t *hwif)
443 * final tuning that is needed, or fixups to work around bugs. 443 * final tuning that is needed, or fixups to work around bugs.
444 */ 444 */
445 445
446static void __devinit it821x_quirkproc(ide_drive_t *drive) 446static void it821x_quirkproc(ide_drive_t *drive)
447{ 447{
448 struct it821x_dev *itdev = ide_get_hwifdata(drive->hwif); 448 struct it821x_dev *itdev = ide_get_hwifdata(drive->hwif);
449 struct hd_driveid *id = drive->id; 449 struct hd_driveid *id = drive->id;
diff --git a/drivers/ide/pci/jmicron.c b/drivers/ide/pci/jmicron.c
index 545b6e172d9b..bb9d09d8f196 100644
--- a/drivers/ide/pci/jmicron.c
+++ b/drivers/ide/pci/jmicron.c
@@ -27,7 +27,7 @@ typedef enum {
27 * Returns the cable type. 27 * Returns the cable type.
28 */ 28 */
29 29
30static u8 __devinit jmicron_cable_detect(ide_hwif_t *hwif) 30static u8 jmicron_cable_detect(ide_hwif_t *hwif)
31{ 31{
32 struct pci_dev *pdev = to_pci_dev(hwif->dev); 32 struct pci_dev *pdev = to_pci_dev(hwif->dev);
33 33
diff --git a/drivers/ide/pci/pdc202xx_new.c b/drivers/ide/pci/pdc202xx_new.c
index 998615fa285f..0f609b72f470 100644
--- a/drivers/ide/pci/pdc202xx_new.c
+++ b/drivers/ide/pci/pdc202xx_new.c
@@ -193,7 +193,7 @@ static void pdcnew_set_pio_mode(ide_drive_t *drive, const u8 pio)
193 } 193 }
194} 194}
195 195
196static u8 __devinit pdcnew_cable_detect(ide_hwif_t *hwif) 196static u8 pdcnew_cable_detect(ide_hwif_t *hwif)
197{ 197{
198 if (get_indexed_reg(hwif, 0x0b) & 0x04) 198 if (get_indexed_reg(hwif, 0x0b) & 0x04)
199 return ATA_CBL_PATA40; 199 return ATA_CBL_PATA40;
diff --git a/drivers/ide/pci/pdc202xx_old.c b/drivers/ide/pci/pdc202xx_old.c
index 6ff2def58da0..de9a27400462 100644
--- a/drivers/ide/pci/pdc202xx_old.c
+++ b/drivers/ide/pci/pdc202xx_old.c
@@ -117,7 +117,7 @@ static void pdc202xx_set_pio_mode(ide_drive_t *drive, const u8 pio)
117 pdc202xx_set_mode(drive, XFER_PIO_0 + pio); 117 pdc202xx_set_mode(drive, XFER_PIO_0 + pio);
118} 118}
119 119
120static u8 __devinit pdc2026x_cable_detect(ide_hwif_t *hwif) 120static u8 pdc2026x_cable_detect(ide_hwif_t *hwif)
121{ 121{
122 struct pci_dev *dev = to_pci_dev(hwif->dev); 122 struct pci_dev *dev = to_pci_dev(hwif->dev);
123 u16 CIS, mask = hwif->channel ? (1 << 11) : (1 << 10); 123 u16 CIS, mask = hwif->channel ? (1 << 11) : (1 << 10);
diff --git a/drivers/ide/pci/piix.c b/drivers/ide/pci/piix.c
index 7fc3022dcf68..30cfc815fe31 100644
--- a/drivers/ide/pci/piix.c
+++ b/drivers/ide/pci/piix.c
@@ -256,7 +256,7 @@ static const struct ich_laptop ich_laptop[] = {
256 { 0, } 256 { 0, }
257}; 257};
258 258
259static u8 __devinit piix_cable_detect(ide_hwif_t *hwif) 259static u8 piix_cable_detect(ide_hwif_t *hwif)
260{ 260{
261 struct pci_dev *pdev = to_pci_dev(hwif->dev); 261 struct pci_dev *pdev = to_pci_dev(hwif->dev);
262 const struct ich_laptop *lap = &ich_laptop[0]; 262 const struct ich_laptop *lap = &ich_laptop[0];
diff --git a/drivers/ide/pci/scc_pata.c b/drivers/ide/pci/scc_pata.c
index 94a7ab864236..6cde48bba6f8 100644
--- a/drivers/ide/pci/scc_pata.c
+++ b/drivers/ide/pci/scc_pata.c
@@ -827,7 +827,7 @@ static void __devinit init_iops_scc(ide_hwif_t *hwif)
827 init_mmio_iops_scc(hwif); 827 init_mmio_iops_scc(hwif);
828} 828}
829 829
830static u8 __devinit scc_cable_detect(ide_hwif_t *hwif) 830static u8 scc_cable_detect(ide_hwif_t *hwif)
831{ 831{
832 return ATA_CBL_PATA80; 832 return ATA_CBL_PATA80;
833} 833}
diff --git a/drivers/ide/pci/serverworks.c b/drivers/ide/pci/serverworks.c
index d173f2937722..c3bdc6e51a48 100644
--- a/drivers/ide/pci/serverworks.c
+++ b/drivers/ide/pci/serverworks.c
@@ -272,7 +272,7 @@ static unsigned int __devinit init_chipset_svwks(struct pci_dev *dev)
272 return dev->irq; 272 return dev->irq;
273} 273}
274 274
275static u8 __devinit ata66_svwks_svwks(ide_hwif_t *hwif) 275static u8 ata66_svwks_svwks(ide_hwif_t *hwif)
276{ 276{
277 return ATA_CBL_PATA80; 277 return ATA_CBL_PATA80;
278} 278}
@@ -284,7 +284,7 @@ static u8 __devinit ata66_svwks_svwks(ide_hwif_t *hwif)
284 * Bit 14 clear = primary IDE channel does not have 80-pin cable. 284 * Bit 14 clear = primary IDE channel does not have 80-pin cable.
285 * Bit 14 set = primary IDE channel has 80-pin cable. 285 * Bit 14 set = primary IDE channel has 80-pin cable.
286 */ 286 */
287static u8 __devinit ata66_svwks_dell(ide_hwif_t *hwif) 287static u8 ata66_svwks_dell(ide_hwif_t *hwif)
288{ 288{
289 struct pci_dev *dev = to_pci_dev(hwif->dev); 289 struct pci_dev *dev = to_pci_dev(hwif->dev);
290 290
@@ -303,7 +303,7 @@ static u8 __devinit ata66_svwks_dell(ide_hwif_t *hwif)
303 * 303 *
304 * WARNING: this only works on Alpine hardware! 304 * WARNING: this only works on Alpine hardware!
305 */ 305 */
306static u8 __devinit ata66_svwks_cobalt(ide_hwif_t *hwif) 306static u8 ata66_svwks_cobalt(ide_hwif_t *hwif)
307{ 307{
308 struct pci_dev *dev = to_pci_dev(hwif->dev); 308 struct pci_dev *dev = to_pci_dev(hwif->dev);
309 309
@@ -315,7 +315,7 @@ static u8 __devinit ata66_svwks_cobalt(ide_hwif_t *hwif)
315 return ATA_CBL_PATA40; 315 return ATA_CBL_PATA40;
316} 316}
317 317
318static u8 __devinit svwks_cable_detect(ide_hwif_t *hwif) 318static u8 svwks_cable_detect(ide_hwif_t *hwif)
319{ 319{
320 struct pci_dev *dev = to_pci_dev(hwif->dev); 320 struct pci_dev *dev = to_pci_dev(hwif->dev);
321 321
diff --git a/drivers/ide/pci/siimage.c b/drivers/ide/pci/siimage.c
index b8ad9ad6cf0d..445ce6fbea33 100644
--- a/drivers/ide/pci/siimage.c
+++ b/drivers/ide/pci/siimage.c
@@ -639,7 +639,7 @@ static int is_dev_seagate_sata(ide_drive_t *drive)
639 * that can occur before we know what drives are present. 639 * that can occur before we know what drives are present.
640 */ 640 */
641 641
642static void __devinit sil_quirkproc(ide_drive_t *drive) 642static void sil_quirkproc(ide_drive_t *drive)
643{ 643{
644 ide_hwif_t *hwif = drive->hwif; 644 ide_hwif_t *hwif = drive->hwif;
645 645
@@ -679,7 +679,7 @@ static void __devinit init_iops_siimage(ide_hwif_t *hwif)
679 * Check for the presence of an ATA66 capable cable on the interface. 679 * Check for the presence of an ATA66 capable cable on the interface.
680 */ 680 */
681 681
682static u8 __devinit sil_cable_detect(ide_hwif_t *hwif) 682static u8 sil_cable_detect(ide_hwif_t *hwif)
683{ 683{
684 struct pci_dev *dev = to_pci_dev(hwif->dev); 684 struct pci_dev *dev = to_pci_dev(hwif->dev);
685 unsigned long addr = siimage_selreg(hwif, 0); 685 unsigned long addr = siimage_selreg(hwif, 0);
diff --git a/drivers/ide/pci/sis5513.c b/drivers/ide/pci/sis5513.c
index cc95f90b53b7..e5a4b42b4e33 100644
--- a/drivers/ide/pci/sis5513.c
+++ b/drivers/ide/pci/sis5513.c
@@ -518,7 +518,7 @@ static const struct sis_laptop sis_laptop[] = {
518 { 0, } 518 { 0, }
519}; 519};
520 520
521static u8 __devinit sis_cable_detect(ide_hwif_t *hwif) 521static u8 sis_cable_detect(ide_hwif_t *hwif)
522{ 522{
523 struct pci_dev *pdev = to_pci_dev(hwif->dev); 523 struct pci_dev *pdev = to_pci_dev(hwif->dev);
524 const struct sis_laptop *lap = &sis_laptop[0]; 524 const struct sis_laptop *lap = &sis_laptop[0];
diff --git a/drivers/ide/pci/slc90e66.c b/drivers/ide/pci/slc90e66.c
index 13d1fa491f26..866d6c65e3a0 100644
--- a/drivers/ide/pci/slc90e66.c
+++ b/drivers/ide/pci/slc90e66.c
@@ -116,7 +116,7 @@ static void slc90e66_set_dma_mode(ide_drive_t *drive, const u8 speed)
116 } 116 }
117} 117}
118 118
119static u8 __devinit slc90e66_cable_detect(ide_hwif_t *hwif) 119static u8 slc90e66_cable_detect(ide_hwif_t *hwif)
120{ 120{
121 struct pci_dev *dev = to_pci_dev(hwif->dev); 121 struct pci_dev *dev = to_pci_dev(hwif->dev);
122 u8 reg47 = 0, mask = hwif->channel ? 0x01 : 0x02; 122 u8 reg47 = 0, mask = hwif->channel ? 0x01 : 0x02;
diff --git a/drivers/ide/pci/tc86c001.c b/drivers/ide/pci/tc86c001.c
index b1cb8a9ce5a9..7fc88c375e5d 100644
--- a/drivers/ide/pci/tc86c001.c
+++ b/drivers/ide/pci/tc86c001.c
@@ -131,7 +131,7 @@ static void tc86c001_dma_start(ide_drive_t *drive)
131 ide_dma_start(drive); 131 ide_dma_start(drive);
132} 132}
133 133
134static u8 __devinit tc86c001_cable_detect(ide_hwif_t *hwif) 134static u8 tc86c001_cable_detect(ide_hwif_t *hwif)
135{ 135{
136 struct pci_dev *dev = to_pci_dev(hwif->dev); 136 struct pci_dev *dev = to_pci_dev(hwif->dev);
137 unsigned long sc_base = pci_resource_start(dev, 5); 137 unsigned long sc_base = pci_resource_start(dev, 5);
diff --git a/drivers/ide/pci/via82cxxx.c b/drivers/ide/pci/via82cxxx.c
index 454d2bf62dce..a6b2cc83f293 100644
--- a/drivers/ide/pci/via82cxxx.c
+++ b/drivers/ide/pci/via82cxxx.c
@@ -352,7 +352,7 @@ static int via_cable_override(struct pci_dev *pdev)
352 return 0; 352 return 0;
353} 353}
354 354
355static u8 __devinit via82cxxx_cable_detect(ide_hwif_t *hwif) 355static u8 via82cxxx_cable_detect(ide_hwif_t *hwif)
356{ 356{
357 struct pci_dev *pdev = to_pci_dev(hwif->dev); 357 struct pci_dev *pdev = to_pci_dev(hwif->dev);
358 struct ide_host *host = pci_get_drvdata(pdev); 358 struct ide_host *host = pci_get_drvdata(pdev);
diff --git a/drivers/macintosh/mediabay.c b/drivers/macintosh/mediabay.c
index b1e5b4705250..d7e46d345d9e 100644
--- a/drivers/macintosh/mediabay.c
+++ b/drivers/macintosh/mediabay.c
@@ -16,7 +16,6 @@
16#include <linux/delay.h> 16#include <linux/delay.h>
17#include <linux/sched.h> 17#include <linux/sched.h>
18#include <linux/timer.h> 18#include <linux/timer.h>
19#include <linux/hdreg.h>
20#include <linux/stddef.h> 19#include <linux/stddef.h>
21#include <linux/init.h> 20#include <linux/init.h>
22#include <linux/ide.h> 21#include <linux/ide.h>
diff --git a/drivers/scsi/hptiop.c b/drivers/scsi/hptiop.c
index 74d12b58a263..a48e4990fe12 100644
--- a/drivers/scsi/hptiop.c
+++ b/drivers/scsi/hptiop.c
@@ -25,7 +25,6 @@
25#include <linux/delay.h> 25#include <linux/delay.h>
26#include <linux/timer.h> 26#include <linux/timer.h>
27#include <linux/spinlock.h> 27#include <linux/spinlock.h>
28#include <linux/hdreg.h>
29#include <asm/uaccess.h> 28#include <asm/uaccess.h>
30#include <asm/io.h> 29#include <asm/io.h>
31#include <asm/div64.h> 30#include <asm/div64.h>
diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c
index b40a673985aa..461331d3dc45 100644
--- a/drivers/scsi/ide-scsi.c
+++ b/drivers/scsi/ide-scsi.c
@@ -102,11 +102,10 @@ static struct ide_scsi_obj *ide_scsi_get(struct gendisk *disk)
102 mutex_lock(&idescsi_ref_mutex); 102 mutex_lock(&idescsi_ref_mutex);
103 scsi = ide_scsi_g(disk); 103 scsi = ide_scsi_g(disk);
104 if (scsi) { 104 if (scsi) {
105 scsi_host_get(scsi->host); 105 if (ide_device_get(scsi->drive))
106 if (ide_device_get(scsi->drive)) {
107 scsi_host_put(scsi->host);
108 scsi = NULL; 106 scsi = NULL;
109 } 107 else
108 scsi_host_get(scsi->host);
110 } 109 }
111 mutex_unlock(&idescsi_ref_mutex); 110 mutex_unlock(&idescsi_ref_mutex);
112 return scsi; 111 return scsi;
@@ -114,9 +113,11 @@ static struct ide_scsi_obj *ide_scsi_get(struct gendisk *disk)
114 113
115static void ide_scsi_put(struct ide_scsi_obj *scsi) 114static void ide_scsi_put(struct ide_scsi_obj *scsi)
116{ 115{
116 ide_drive_t *drive = scsi->drive;
117
117 mutex_lock(&idescsi_ref_mutex); 118 mutex_lock(&idescsi_ref_mutex);
118 ide_device_put(scsi->drive);
119 scsi_host_put(scsi->host); 119 scsi_host_put(scsi->host);
120 ide_device_put(drive);
120 mutex_unlock(&idescsi_ref_mutex); 121 mutex_unlock(&idescsi_ref_mutex);
121} 122}
122 123
diff --git a/drivers/usb/storage/freecom.c b/drivers/usb/storage/freecom.c
index 7a4d45677227..73ac7262239e 100644
--- a/drivers/usb/storage/freecom.c
+++ b/drivers/usb/storage/freecom.c
@@ -26,8 +26,6 @@
26 * (http://www.freecom.de/) 26 * (http://www.freecom.de/)
27 */ 27 */
28 28
29#include <linux/hdreg.h>
30
31#include <scsi/scsi.h> 29#include <scsi/scsi.h>
32#include <scsi/scsi_cmnd.h> 30#include <scsi/scsi_cmnd.h>
33 31