diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-10-10 03:25:29 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-10-10 03:25:29 -0400 |
commit | 8eb95f28f66b1a5461fdbcc9a1ee9068fb2cf2b6 (patch) | |
tree | e42d0e004b07f86d38de930fc163f3ca7d121f9c /drivers/ide | |
parent | d7451fca18e2ec62641ae4bbfe946069f13765a3 (diff) | |
parent | 3fa8749e584b55f1180411ab1b51117190bac1e5 (diff) |
Merge commit 'v2.6.27' into timers/hpet
Diffstat (limited to 'drivers/ide')
-rw-r--r-- | drivers/ide/Kconfig | 18 | ||||
-rw-r--r-- | drivers/ide/ide-cd.c | 8 | ||||
-rw-r--r-- | drivers/ide/ide-dma.c | 2 | ||||
-rw-r--r-- | drivers/ide/ide-probe.c | 2 | ||||
-rw-r--r-- | drivers/ide/ide-tape.c | 10 | ||||
-rw-r--r-- | drivers/ide/mips/Makefile | 1 | ||||
-rw-r--r-- | drivers/ide/mips/swarm.c | 196 | ||||
-rw-r--r-- | drivers/ide/pci/hpt366.c | 31 |
8 files changed, 41 insertions, 227 deletions
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig index fc735ab08ff4..052879a6f853 100644 --- a/drivers/ide/Kconfig +++ b/drivers/ide/Kconfig | |||
@@ -292,6 +292,20 @@ config IDE_GENERIC | |||
292 | tristate "generic/default IDE chipset support" | 292 | tristate "generic/default IDE chipset support" |
293 | depends on ALPHA || X86 || IA64 || M32R || MIPS | 293 | depends on ALPHA || X86 || IA64 || M32R || MIPS |
294 | help | 294 | help |
295 | This is the generic IDE driver. This driver attaches to the | ||
296 | fixed legacy ports (e.g. on PCs 0x1f0/0x170, 0x1e8/0x168 and | ||
297 | so on). Please note that if this driver is built into the | ||
298 | kernel or loaded before other ATA (IDE or libata) drivers | ||
299 | and the controller is located at legacy ports, this driver | ||
300 | may grab those ports and thus can prevent the controller | ||
301 | specific driver from attaching. | ||
302 | |||
303 | Also, currently, IDE generic doesn't allow IRQ sharing | ||
304 | meaning that the IRQs it grabs won't be available to other | ||
305 | controllers sharing those IRQs which usually makes drivers | ||
306 | for those controllers fail. Generally, it's not a good idea | ||
307 | to load IDE generic driver on modern systems. | ||
308 | |||
295 | If unsure, say N. | 309 | If unsure, say N. |
296 | 310 | ||
297 | config BLK_DEV_PLATFORM | 311 | config BLK_DEV_PLATFORM |
@@ -766,10 +780,6 @@ config BLK_DEV_IDEDMA_PMAC | |||
766 | to transfer data to and from memory. Saying Y is safe and improves | 780 | to transfer data to and from memory. Saying Y is safe and improves |
767 | performance. | 781 | performance. |
768 | 782 | ||
769 | config BLK_DEV_IDE_SWARM | ||
770 | tristate "IDE for Sibyte evaluation boards" | ||
771 | depends on SIBYTE_SB1xxx_SOC | ||
772 | |||
773 | config BLK_DEV_IDE_AU1XXX | 783 | config BLK_DEV_IDE_AU1XXX |
774 | bool "IDE for AMD Alchemy Au1200" | 784 | bool "IDE for AMD Alchemy Au1200" |
775 | depends on SOC_AU1200 | 785 | depends on SOC_AU1200 |
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index f1489999cf91..f16bb4667238 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c | |||
@@ -1661,7 +1661,9 @@ static int ide_cdrom_probe_capabilities(ide_drive_t *drive) | |||
1661 | cdi->mask &= ~CDC_PLAY_AUDIO; | 1661 | cdi->mask &= ~CDC_PLAY_AUDIO; |
1662 | 1662 | ||
1663 | mechtype = buf[8 + 6] >> 5; | 1663 | mechtype = buf[8 + 6] >> 5; |
1664 | if (mechtype == mechtype_caddy || mechtype == mechtype_popup) | 1664 | if (mechtype == mechtype_caddy || |
1665 | mechtype == mechtype_popup || | ||
1666 | (drive->atapi_flags & IDE_AFLAG_NO_AUTOCLOSE)) | ||
1665 | cdi->mask |= CDC_CLOSE_TRAY; | 1667 | cdi->mask |= CDC_CLOSE_TRAY; |
1666 | 1668 | ||
1667 | if (cdi->sanyo_slot > 0) { | 1669 | if (cdi->sanyo_slot > 0) { |
@@ -1859,6 +1861,8 @@ static const struct cd_list_entry ide_cd_quirks_list[] = { | |||
1859 | { "MATSHITADVD-ROM SR-8176", NULL, IDE_AFLAG_PLAY_AUDIO_OK }, | 1861 | { "MATSHITADVD-ROM SR-8176", NULL, IDE_AFLAG_PLAY_AUDIO_OK }, |
1860 | { "MATSHITADVD-ROM SR-8174", NULL, IDE_AFLAG_PLAY_AUDIO_OK }, | 1862 | { "MATSHITADVD-ROM SR-8174", NULL, IDE_AFLAG_PLAY_AUDIO_OK }, |
1861 | { "Optiarc DVD RW AD-5200A", NULL, IDE_AFLAG_PLAY_AUDIO_OK }, | 1863 | { "Optiarc DVD RW AD-5200A", NULL, IDE_AFLAG_PLAY_AUDIO_OK }, |
1864 | { "Optiarc DVD RW AD-7200A", NULL, IDE_AFLAG_PLAY_AUDIO_OK }, | ||
1865 | { "Optiarc DVD RW AD-7543A", NULL, IDE_AFLAG_NO_AUTOCLOSE }, | ||
1862 | { NULL, NULL, 0 } | 1866 | { NULL, NULL, 0 } |
1863 | }; | 1867 | }; |
1864 | 1868 | ||
@@ -1933,7 +1937,6 @@ static void ide_cd_remove(ide_drive_t *drive) | |||
1933 | 1937 | ||
1934 | ide_proc_unregister_driver(drive, info->driver); | 1938 | ide_proc_unregister_driver(drive, info->driver); |
1935 | 1939 | ||
1936 | blk_unregister_filter(info->disk); | ||
1937 | del_gendisk(info->disk); | 1940 | del_gendisk(info->disk); |
1938 | 1941 | ||
1939 | ide_cd_put(info); | 1942 | ide_cd_put(info); |
@@ -2159,7 +2162,6 @@ static int ide_cd_probe(ide_drive_t *drive) | |||
2159 | g->fops = &idecd_ops; | 2162 | g->fops = &idecd_ops; |
2160 | g->flags |= GENHD_FL_REMOVABLE; | 2163 | g->flags |= GENHD_FL_REMOVABLE; |
2161 | add_disk(g); | 2164 | add_disk(g); |
2162 | blk_register_filter(g); | ||
2163 | return 0; | 2165 | return 0; |
2164 | 2166 | ||
2165 | out_free_cd: | 2167 | out_free_cd: |
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c index adc682755857..3fa07c0aeaa4 100644 --- a/drivers/ide/ide-dma.c +++ b/drivers/ide/ide-dma.c | |||
@@ -211,7 +211,7 @@ int ide_build_dmatable (ide_drive_t *drive, struct request *rq) | |||
211 | xcount = bcount & 0xffff; | 211 | xcount = bcount & 0xffff; |
212 | if (is_trm290) | 212 | if (is_trm290) |
213 | xcount = ((xcount >> 2) - 1) << 16; | 213 | xcount = ((xcount >> 2) - 1) << 16; |
214 | if (xcount == 0x0000) { | 214 | else if (xcount == 0x0000) { |
215 | /* | 215 | /* |
216 | * Most chipsets correctly interpret a length of 0x0000 as 64KB, | 216 | * Most chipsets correctly interpret a length of 0x0000 as 64KB, |
217 | * but at least one (e.g. CS5530) misinterprets it as zero (!). | 217 | * but at least one (e.g. CS5530) misinterprets it as zero (!). |
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index 994e41099b42..a51a30e9eab3 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c | |||
@@ -1492,7 +1492,7 @@ static struct device_attribute *ide_port_attrs[] = { | |||
1492 | 1492 | ||
1493 | static int ide_sysfs_register_port(ide_hwif_t *hwif) | 1493 | static int ide_sysfs_register_port(ide_hwif_t *hwif) |
1494 | { | 1494 | { |
1495 | int i, rc; | 1495 | int i, uninitialized_var(rc); |
1496 | 1496 | ||
1497 | for (i = 0; ide_port_attrs[i]; i++) { | 1497 | for (i = 0; ide_port_attrs[i]; i++) { |
1498 | rc = device_create_file(hwif->portdev, ide_port_attrs[i]); | 1498 | rc = device_create_file(hwif->portdev, ide_port_attrs[i]); |
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c index 1bce84b56630..3833189144ed 100644 --- a/drivers/ide/ide-tape.c +++ b/drivers/ide/ide-tape.c | |||
@@ -2338,7 +2338,7 @@ static void idetape_get_inquiry_results(ide_drive_t *drive) | |||
2338 | { | 2338 | { |
2339 | idetape_tape_t *tape = drive->driver_data; | 2339 | idetape_tape_t *tape = drive->driver_data; |
2340 | struct ide_atapi_pc pc; | 2340 | struct ide_atapi_pc pc; |
2341 | char fw_rev[6], vendor_id[10], product_id[18]; | 2341 | char fw_rev[4], vendor_id[8], product_id[16]; |
2342 | 2342 | ||
2343 | idetape_create_inquiry_cmd(&pc); | 2343 | idetape_create_inquiry_cmd(&pc); |
2344 | if (idetape_queue_pc_tail(drive, &pc)) { | 2344 | if (idetape_queue_pc_tail(drive, &pc)) { |
@@ -2350,11 +2350,11 @@ static void idetape_get_inquiry_results(ide_drive_t *drive) | |||
2350 | memcpy(product_id, &pc.buf[16], 16); | 2350 | memcpy(product_id, &pc.buf[16], 16); |
2351 | memcpy(fw_rev, &pc.buf[32], 4); | 2351 | memcpy(fw_rev, &pc.buf[32], 4); |
2352 | 2352 | ||
2353 | ide_fixstring(vendor_id, 10, 0); | 2353 | ide_fixstring(vendor_id, 8, 0); |
2354 | ide_fixstring(product_id, 18, 0); | 2354 | ide_fixstring(product_id, 16, 0); |
2355 | ide_fixstring(fw_rev, 6, 0); | 2355 | ide_fixstring(fw_rev, 4, 0); |
2356 | 2356 | ||
2357 | printk(KERN_INFO "ide-tape: %s <-> %s: %s %s rev %s\n", | 2357 | printk(KERN_INFO "ide-tape: %s <-> %s: %.8s %.16s rev %.4s\n", |
2358 | drive->name, tape->name, vendor_id, product_id, fw_rev); | 2358 | drive->name, tape->name, vendor_id, product_id, fw_rev); |
2359 | } | 2359 | } |
2360 | 2360 | ||
diff --git a/drivers/ide/mips/Makefile b/drivers/ide/mips/Makefile index 677c7b2bac92..5873fa0b8769 100644 --- a/drivers/ide/mips/Makefile +++ b/drivers/ide/mips/Makefile | |||
@@ -1,4 +1,3 @@ | |||
1 | obj-$(CONFIG_BLK_DEV_IDE_SWARM) += swarm.o | ||
2 | obj-$(CONFIG_BLK_DEV_IDE_AU1XXX) += au1xxx-ide.o | 1 | obj-$(CONFIG_BLK_DEV_IDE_AU1XXX) += au1xxx-ide.o |
3 | 2 | ||
4 | EXTRA_CFLAGS := -Idrivers/ide | 3 | EXTRA_CFLAGS := -Idrivers/ide |
diff --git a/drivers/ide/mips/swarm.c b/drivers/ide/mips/swarm.c deleted file mode 100644 index badf79fc9e3a..000000000000 --- a/drivers/ide/mips/swarm.c +++ /dev/null | |||
@@ -1,196 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2001, 2002, 2003 Broadcom Corporation | ||
3 | * Copyright (C) 2004 MontaVista Software Inc. | ||
4 | * Author: Manish Lachwani, mlachwani@mvista.com | ||
5 | * Copyright (C) 2004 MIPS Technologies, Inc. All rights reserved. | ||
6 | * Author: Maciej W. Rozycki <macro@mips.com> | ||
7 | * Copyright (c) 2006, 2008 Maciej W. Rozycki | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or | ||
10 | * modify it under the terms of the GNU General Public License | ||
11 | * as published by the Free Software Foundation; either version 2 | ||
12 | * of the License, or (at your option) any later version. | ||
13 | * | ||
14 | * This program is distributed in the hope that it will be useful, | ||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
17 | * GNU General Public License for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this program; if not, write to the Free Software | ||
21 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
22 | */ | ||
23 | |||
24 | /* | ||
25 | * Derived loosely from ide-pmac.c, so: | ||
26 | * Copyright (C) 1998 Paul Mackerras. | ||
27 | * Copyright (C) 1995-1998 Mark Lord | ||
28 | */ | ||
29 | |||
30 | /* | ||
31 | * Boards with SiByte processors so far have supported IDE devices via | ||
32 | * the Generic Bus, PCI bus, and built-in PCMCIA interface. In all | ||
33 | * cases, byte-swapping must be avoided for these devices (whereas | ||
34 | * other PCI devices, for example, will require swapping). Any | ||
35 | * SiByte-targetted kernel including IDE support will include this | ||
36 | * file. Probing of a Generic Bus for an IDE device is controlled by | ||
37 | * the definition of "SIBYTE_HAVE_IDE", which is provided by | ||
38 | * <asm/sibyte/board.h> for Broadcom boards. | ||
39 | */ | ||
40 | |||
41 | #include <linux/ide.h> | ||
42 | #include <linux/ioport.h> | ||
43 | #include <linux/kernel.h> | ||
44 | #include <linux/types.h> | ||
45 | #include <linux/platform_device.h> | ||
46 | |||
47 | #include <asm/io.h> | ||
48 | |||
49 | #include <asm/sibyte/board.h> | ||
50 | #include <asm/sibyte/sb1250_genbus.h> | ||
51 | #include <asm/sibyte/sb1250_regs.h> | ||
52 | |||
53 | #define DRV_NAME "ide-swarm" | ||
54 | |||
55 | static char swarm_ide_string[] = DRV_NAME; | ||
56 | |||
57 | static struct resource swarm_ide_resource = { | ||
58 | .name = "SWARM GenBus IDE", | ||
59 | .flags = IORESOURCE_MEM, | ||
60 | }; | ||
61 | |||
62 | static struct platform_device *swarm_ide_dev; | ||
63 | |||
64 | static const struct ide_port_info swarm_port_info = { | ||
65 | .name = DRV_NAME, | ||
66 | .host_flags = IDE_HFLAG_MMIO | IDE_HFLAG_NO_DMA, | ||
67 | }; | ||
68 | |||
69 | /* | ||
70 | * swarm_ide_probe - if the board header indicates the existence of | ||
71 | * Generic Bus IDE, allocate a HWIF for it. | ||
72 | */ | ||
73 | static int __devinit swarm_ide_probe(struct device *dev) | ||
74 | { | ||
75 | u8 __iomem *base; | ||
76 | struct ide_host *host; | ||
77 | phys_t offset, size; | ||
78 | int i, rc; | ||
79 | hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL }; | ||
80 | |||
81 | if (!SIBYTE_HAVE_IDE) | ||
82 | return -ENODEV; | ||
83 | |||
84 | base = ioremap(A_IO_EXT_BASE, 0x800); | ||
85 | offset = __raw_readq(base + R_IO_EXT_REG(R_IO_EXT_START_ADDR, IDE_CS)); | ||
86 | size = __raw_readq(base + R_IO_EXT_REG(R_IO_EXT_MULT_SIZE, IDE_CS)); | ||
87 | iounmap(base); | ||
88 | |||
89 | offset = G_IO_START_ADDR(offset) << S_IO_ADDRBASE; | ||
90 | size = (G_IO_MULT_SIZE(size) + 1) << S_IO_REGSIZE; | ||
91 | if (offset < A_PHYS_GENBUS || offset >= A_PHYS_GENBUS_END) { | ||
92 | printk(KERN_INFO DRV_NAME | ||
93 | ": IDE interface at GenBus disabled\n"); | ||
94 | return -EBUSY; | ||
95 | } | ||
96 | |||
97 | printk(KERN_INFO DRV_NAME ": IDE interface at GenBus slot %i\n", | ||
98 | IDE_CS); | ||
99 | |||
100 | swarm_ide_resource.start = offset; | ||
101 | swarm_ide_resource.end = offset + size - 1; | ||
102 | if (request_resource(&iomem_resource, &swarm_ide_resource)) { | ||
103 | printk(KERN_ERR DRV_NAME | ||
104 | ": can't request I/O memory resource\n"); | ||
105 | return -EBUSY; | ||
106 | } | ||
107 | |||
108 | base = ioremap(offset, size); | ||
109 | |||
110 | for (i = 0; i <= 7; i++) | ||
111 | hw.io_ports_array[i] = | ||
112 | (unsigned long)(base + ((0x1f0 + i) << 5)); | ||
113 | hw.io_ports.ctl_addr = | ||
114 | (unsigned long)(base + (0x3f6 << 5)); | ||
115 | hw.irq = K_INT_GB_IDE; | ||
116 | hw.chipset = ide_generic; | ||
117 | |||
118 | rc = ide_host_add(&swarm_port_info, hws, &host); | ||
119 | if (rc) | ||
120 | goto err; | ||
121 | |||
122 | dev_set_drvdata(dev, host); | ||
123 | |||
124 | return 0; | ||
125 | err: | ||
126 | release_resource(&swarm_ide_resource); | ||
127 | iounmap(base); | ||
128 | return rc; | ||
129 | } | ||
130 | |||
131 | static struct device_driver swarm_ide_driver = { | ||
132 | .name = swarm_ide_string, | ||
133 | .bus = &platform_bus_type, | ||
134 | .probe = swarm_ide_probe, | ||
135 | }; | ||
136 | |||
137 | static void swarm_ide_platform_release(struct device *device) | ||
138 | { | ||
139 | struct platform_device *pldev; | ||
140 | |||
141 | /* free device */ | ||
142 | pldev = to_platform_device(device); | ||
143 | kfree(pldev); | ||
144 | } | ||
145 | |||
146 | static int __devinit swarm_ide_init_module(void) | ||
147 | { | ||
148 | struct platform_device *pldev; | ||
149 | int err; | ||
150 | |||
151 | printk(KERN_INFO "SWARM IDE driver\n"); | ||
152 | |||
153 | if (driver_register(&swarm_ide_driver)) { | ||
154 | printk(KERN_ERR "Driver registration failed\n"); | ||
155 | err = -ENODEV; | ||
156 | goto out; | ||
157 | } | ||
158 | |||
159 | if (!(pldev = kzalloc(sizeof (*pldev), GFP_KERNEL))) { | ||
160 | err = -ENOMEM; | ||
161 | goto out_unregister_driver; | ||
162 | } | ||
163 | |||
164 | pldev->name = swarm_ide_string; | ||
165 | pldev->id = 0; | ||
166 | pldev->dev.release = swarm_ide_platform_release; | ||
167 | |||
168 | if (platform_device_register(pldev)) { | ||
169 | err = -ENODEV; | ||
170 | goto out_free_pldev; | ||
171 | } | ||
172 | |||
173 | if (!pldev->dev.driver) { | ||
174 | /* | ||
175 | * The driver was not bound to this device, there was | ||
176 | * no hardware at this address. Unregister it, as the | ||
177 | * release fuction will take care of freeing the | ||
178 | * allocated structure | ||
179 | */ | ||
180 | platform_device_unregister (pldev); | ||
181 | } | ||
182 | |||
183 | swarm_ide_dev = pldev; | ||
184 | |||
185 | return 0; | ||
186 | |||
187 | out_free_pldev: | ||
188 | kfree(pldev); | ||
189 | |||
190 | out_unregister_driver: | ||
191 | driver_unregister(&swarm_ide_driver); | ||
192 | out: | ||
193 | return err; | ||
194 | } | ||
195 | |||
196 | module_init(swarm_ide_init_module); | ||
diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c index eb107eef0dbc..c37ab1743819 100644 --- a/drivers/ide/pci/hpt366.c +++ b/drivers/ide/pci/hpt366.c | |||
@@ -613,6 +613,14 @@ static int check_in_drive_list(ide_drive_t *drive, const char **list) | |||
613 | return 0; | 613 | return 0; |
614 | } | 614 | } |
615 | 615 | ||
616 | static struct hpt_info *hpt3xx_get_info(struct device *dev) | ||
617 | { | ||
618 | struct ide_host *host = dev_get_drvdata(dev); | ||
619 | struct hpt_info *info = (struct hpt_info *)host->host_priv; | ||
620 | |||
621 | return dev == host->dev[1] ? info + 1 : info; | ||
622 | } | ||
623 | |||
616 | /* | 624 | /* |
617 | * The Marvell bridge chips used on the HighPoint SATA cards do not seem | 625 | * The Marvell bridge chips used on the HighPoint SATA cards do not seem |
618 | * to support the UltraDMA modes 1, 2, and 3 as well as any MWDMA modes... | 626 | * to support the UltraDMA modes 1, 2, and 3 as well as any MWDMA modes... |
@@ -621,9 +629,7 @@ static int check_in_drive_list(ide_drive_t *drive, const char **list) | |||
621 | static u8 hpt3xx_udma_filter(ide_drive_t *drive) | 629 | static u8 hpt3xx_udma_filter(ide_drive_t *drive) |
622 | { | 630 | { |
623 | ide_hwif_t *hwif = HWIF(drive); | 631 | ide_hwif_t *hwif = HWIF(drive); |
624 | struct pci_dev *dev = to_pci_dev(hwif->dev); | 632 | struct hpt_info *info = hpt3xx_get_info(hwif->dev); |
625 | struct ide_host *host = pci_get_drvdata(dev); | ||
626 | struct hpt_info *info = host->host_priv + (hwif->dev == host->dev[1]); | ||
627 | u8 mask = hwif->ultra_mask; | 633 | u8 mask = hwif->ultra_mask; |
628 | 634 | ||
629 | switch (info->chip_type) { | 635 | switch (info->chip_type) { |
@@ -662,9 +668,7 @@ static u8 hpt3xx_udma_filter(ide_drive_t *drive) | |||
662 | static u8 hpt3xx_mdma_filter(ide_drive_t *drive) | 668 | static u8 hpt3xx_mdma_filter(ide_drive_t *drive) |
663 | { | 669 | { |
664 | ide_hwif_t *hwif = HWIF(drive); | 670 | ide_hwif_t *hwif = HWIF(drive); |
665 | struct pci_dev *dev = to_pci_dev(hwif->dev); | 671 | struct hpt_info *info = hpt3xx_get_info(hwif->dev); |
666 | struct ide_host *host = pci_get_drvdata(dev); | ||
667 | struct hpt_info *info = host->host_priv + (hwif->dev == host->dev[1]); | ||
668 | 672 | ||
669 | switch (info->chip_type) { | 673 | switch (info->chip_type) { |
670 | case HPT372 : | 674 | case HPT372 : |
@@ -700,8 +704,7 @@ static void hpt3xx_set_mode(ide_drive_t *drive, const u8 speed) | |||
700 | { | 704 | { |
701 | ide_hwif_t *hwif = drive->hwif; | 705 | ide_hwif_t *hwif = drive->hwif; |
702 | struct pci_dev *dev = to_pci_dev(hwif->dev); | 706 | struct pci_dev *dev = to_pci_dev(hwif->dev); |
703 | struct ide_host *host = pci_get_drvdata(dev); | 707 | struct hpt_info *info = hpt3xx_get_info(hwif->dev); |
704 | struct hpt_info *info = host->host_priv + (hwif->dev == host->dev[1]); | ||
705 | struct hpt_timings *t = info->timings; | 708 | struct hpt_timings *t = info->timings; |
706 | u8 itr_addr = 0x40 + (drive->dn * 4); | 709 | u8 itr_addr = 0x40 + (drive->dn * 4); |
707 | u32 old_itr = 0; | 710 | u32 old_itr = 0; |
@@ -744,8 +747,7 @@ static void hpt3xx_maskproc(ide_drive_t *drive, int mask) | |||
744 | { | 747 | { |
745 | ide_hwif_t *hwif = HWIF(drive); | 748 | ide_hwif_t *hwif = HWIF(drive); |
746 | struct pci_dev *dev = to_pci_dev(hwif->dev); | 749 | struct pci_dev *dev = to_pci_dev(hwif->dev); |
747 | struct ide_host *host = pci_get_drvdata(dev); | 750 | struct hpt_info *info = hpt3xx_get_info(hwif->dev); |
748 | struct hpt_info *info = host->host_priv + (hwif->dev == host->dev[1]); | ||
749 | 751 | ||
750 | if (drive->quirk_list) { | 752 | if (drive->quirk_list) { |
751 | if (info->chip_type >= HPT370) { | 753 | if (info->chip_type >= HPT370) { |
@@ -973,8 +975,7 @@ static int __devinit hpt37x_calibrate_dpll(struct pci_dev *dev, u16 f_low, u16 f | |||
973 | static unsigned int __devinit init_chipset_hpt366(struct pci_dev *dev) | 975 | static unsigned int __devinit init_chipset_hpt366(struct pci_dev *dev) |
974 | { | 976 | { |
975 | unsigned long io_base = pci_resource_start(dev, 4); | 977 | unsigned long io_base = pci_resource_start(dev, 4); |
976 | struct ide_host *host = pci_get_drvdata(dev); | 978 | struct hpt_info *info = hpt3xx_get_info(&dev->dev); |
977 | struct hpt_info *info = host->host_priv + (&dev->dev == host->dev[1]); | ||
978 | const char *name = DRV_NAME; | 979 | const char *name = DRV_NAME; |
979 | u8 pci_clk, dpll_clk = 0; /* PCI and DPLL clock in MHz */ | 980 | u8 pci_clk, dpll_clk = 0; /* PCI and DPLL clock in MHz */ |
980 | u8 chip_type; | 981 | u8 chip_type; |
@@ -1217,8 +1218,7 @@ static unsigned int __devinit init_chipset_hpt366(struct pci_dev *dev) | |||
1217 | static u8 hpt3xx_cable_detect(ide_hwif_t *hwif) | 1218 | static u8 hpt3xx_cable_detect(ide_hwif_t *hwif) |
1218 | { | 1219 | { |
1219 | struct pci_dev *dev = to_pci_dev(hwif->dev); | 1220 | struct pci_dev *dev = to_pci_dev(hwif->dev); |
1220 | struct ide_host *host = pci_get_drvdata(dev); | 1221 | struct hpt_info *info = hpt3xx_get_info(hwif->dev); |
1221 | struct hpt_info *info = host->host_priv + (hwif->dev == host->dev[1]); | ||
1222 | u8 chip_type = info->chip_type; | 1222 | u8 chip_type = info->chip_type; |
1223 | u8 scr1 = 0, ata66 = hwif->channel ? 0x01 : 0x02; | 1223 | u8 scr1 = 0, ata66 = hwif->channel ? 0x01 : 0x02; |
1224 | 1224 | ||
@@ -1262,8 +1262,7 @@ static u8 hpt3xx_cable_detect(ide_hwif_t *hwif) | |||
1262 | static void __devinit init_hwif_hpt366(ide_hwif_t *hwif) | 1262 | static void __devinit init_hwif_hpt366(ide_hwif_t *hwif) |
1263 | { | 1263 | { |
1264 | struct pci_dev *dev = to_pci_dev(hwif->dev); | 1264 | struct pci_dev *dev = to_pci_dev(hwif->dev); |
1265 | struct ide_host *host = pci_get_drvdata(dev); | 1265 | struct hpt_info *info = hpt3xx_get_info(hwif->dev); |
1266 | struct hpt_info *info = host->host_priv + (hwif->dev == host->dev[1]); | ||
1267 | int serialize = HPT_SERIALIZE_IO; | 1266 | int serialize = HPT_SERIALIZE_IO; |
1268 | u8 chip_type = info->chip_type; | 1267 | u8 chip_type = info->chip_type; |
1269 | u8 new_mcr, old_mcr = 0; | 1268 | u8 new_mcr, old_mcr = 0; |