aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-02-26 06:09:02 -0500
committerJeff Garzik <jeff@garzik.org>2007-03-01 20:19:45 -0500
commit960627b7adf3645e4969b4bfaf03360caabbe76a (patch)
treee922681ace09b5027653a1fddd742a6509698e4b /drivers/ata
parent09125ea6179b28790950b7ddb4daba112f6c2b73 (diff)
pata_jmicron: drop unnecessary device programming in [re]init
Channel redirect and AHCI mode enable programmings are done via PCI quirk for both probe and resume paths. Drop duplicate and possibly unsafe device programming from pata_jmicron(). Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/pata_jmicron.c32
1 files changed, 1 insertions, 31 deletions
diff --git a/drivers/ata/pata_jmicron.c b/drivers/ata/pata_jmicron.c
index 7a635dd326f8..c40d09206e45 100644
--- a/drivers/ata/pata_jmicron.c
+++ b/drivers/ata/pata_jmicron.c
@@ -202,43 +202,13 @@ static int jmicron_init_one (struct pci_dev *pdev, const struct pci_device_id *i
202 }; 202 };
203 struct ata_port_info *port_info[2] = { &info, &info }; 203 struct ata_port_info *port_info[2] = { &info, &info };
204 204
205 u32 reg;
206
207 /* PATA controller is fn 1, AHCI is fn 0 */ 205 /* PATA controller is fn 1, AHCI is fn 0 */
208 if (id->driver_data != 368 && PCI_FUNC(pdev->devfn) != 1) 206 if (id->driver_data != 368 && PCI_FUNC(pdev->devfn) != 1)
209 return -ENODEV; 207 return -ENODEV;
210 208
211 /* The 365/66 have two PATA channels, redirect the second */
212 if (id->driver_data == 365 || id->driver_data == 366) {
213 pci_read_config_dword(pdev, 0x80, &reg);
214 reg |= (1 << 24); /* IDE1 to PATA IDE secondary */
215 pci_write_config_dword(pdev, 0x80, reg);
216 }
217
218 return ata_pci_init_one(pdev, port_info, 2); 209 return ata_pci_init_one(pdev, port_info, 2);
219} 210}
220 211
221static int jmicron_reinit_one(struct pci_dev *pdev)
222{
223 u32 reg;
224
225 switch(pdev->device) {
226 case PCI_DEVICE_ID_JMICRON_JMB368:
227 break;
228 case PCI_DEVICE_ID_JMICRON_JMB365:
229 case PCI_DEVICE_ID_JMICRON_JMB366:
230 /* Restore mapping or disks swap and boy does it get ugly */
231 pci_read_config_dword(pdev, 0x80, &reg);
232 reg |= (1 << 24); /* IDE1 to PATA IDE secondary */
233 pci_write_config_dword(pdev, 0x80, reg);
234 /* Fall through */
235 default:
236 /* Make sure AHCI is turned back on */
237 pci_write_config_byte(pdev, 0x41, 0xa1);
238 }
239 return ata_pci_device_resume(pdev);
240}
241
242static const struct pci_device_id jmicron_pci_tbl[] = { 212static const struct pci_device_id jmicron_pci_tbl[] = {
243 { PCI_VDEVICE(JMICRON, PCI_DEVICE_ID_JMICRON_JMB361), 361}, 213 { PCI_VDEVICE(JMICRON, PCI_DEVICE_ID_JMICRON_JMB361), 361},
244 { PCI_VDEVICE(JMICRON, PCI_DEVICE_ID_JMICRON_JMB363), 363}, 214 { PCI_VDEVICE(JMICRON, PCI_DEVICE_ID_JMICRON_JMB363), 363},
@@ -255,7 +225,7 @@ static struct pci_driver jmicron_pci_driver = {
255 .probe = jmicron_init_one, 225 .probe = jmicron_init_one,
256 .remove = ata_pci_remove_one, 226 .remove = ata_pci_remove_one,
257 .suspend = ata_pci_device_suspend, 227 .suspend = ata_pci_device_suspend,
258 .resume = jmicron_reinit_one, 228 .resume = ata_pci_device_resume,
259}; 229};
260 230
261static int __init jmicron_init(void) 231static int __init jmicron_init(void)