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>

authored by Tejun Heo and committed by Jeff Garzik 960627b7 09125ea6

+1 -31
+1 -31
drivers/ata/pata_jmicron.c
··· 202 }; 203 struct ata_port_info *port_info[2] = { &info, &info }; 204 205 - u32 reg; 206 - 207 /* PATA controller is fn 1, AHCI is fn 0 */ 208 if (id->driver_data != 368 && PCI_FUNC(pdev->devfn) != 1) 209 return -ENODEV; 210 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); 219 - } 220 - 221 - static 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 242 static const struct pci_device_id jmicron_pci_tbl[] = { ··· 225 .probe = jmicron_init_one, 226 .remove = ata_pci_remove_one, 227 .suspend = ata_pci_device_suspend, 228 - .resume = jmicron_reinit_one, 229 }; 230 231 static int __init jmicron_init(void)
··· 202 }; 203 struct ata_port_info *port_info[2] = { &info, &info }; 204 205 /* PATA controller is fn 1, AHCI is fn 0 */ 206 if (id->driver_data != 368 && PCI_FUNC(pdev->devfn) != 1) 207 return -ENODEV; 208 209 return ata_pci_init_one(pdev, port_info, 2); 210 } 211 212 static const struct pci_device_id jmicron_pci_tbl[] = { ··· 255 .probe = jmicron_init_one, 256 .remove = ata_pci_remove_one, 257 .suspend = ata_pci_device_suspend, 258 + .resume = ata_pci_device_resume, 259 }; 260 261 static int __init jmicron_init(void)