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>
This commit is contained in:
parent
09125ea617
commit
960627b7ad
|
@ -202,43 +202,13 @@ static int jmicron_init_one (struct pci_dev *pdev, const struct pci_device_id *i
|
||||||
};
|
};
|
||||||
struct ata_port_info *port_info[2] = { &info, &info };
|
struct ata_port_info *port_info[2] = { &info, &info };
|
||||||
|
|
||||||
u32 reg;
|
|
||||||
|
|
||||||
/* PATA controller is fn 1, AHCI is fn 0 */
|
/* PATA controller is fn 1, AHCI is fn 0 */
|
||||||
if (id->driver_data != 368 && PCI_FUNC(pdev->devfn) != 1)
|
if (id->driver_data != 368 && PCI_FUNC(pdev->devfn) != 1)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
/* The 365/66 have two PATA channels, redirect the second */
|
|
||||||
if (id->driver_data == 365 || id->driver_data == 366) {
|
|
||||||
pci_read_config_dword(pdev, 0x80, ®);
|
|
||||||
reg |= (1 << 24); /* IDE1 to PATA IDE secondary */
|
|
||||||
pci_write_config_dword(pdev, 0x80, reg);
|
|
||||||
}
|
|
||||||
|
|
||||||
return ata_pci_init_one(pdev, port_info, 2);
|
return ata_pci_init_one(pdev, port_info, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int jmicron_reinit_one(struct pci_dev *pdev)
|
|
||||||
{
|
|
||||||
u32 reg;
|
|
||||||
|
|
||||||
switch(pdev->device) {
|
|
||||||
case PCI_DEVICE_ID_JMICRON_JMB368:
|
|
||||||
break;
|
|
||||||
case PCI_DEVICE_ID_JMICRON_JMB365:
|
|
||||||
case PCI_DEVICE_ID_JMICRON_JMB366:
|
|
||||||
/* Restore mapping or disks swap and boy does it get ugly */
|
|
||||||
pci_read_config_dword(pdev, 0x80, ®);
|
|
||||||
reg |= (1 << 24); /* IDE1 to PATA IDE secondary */
|
|
||||||
pci_write_config_dword(pdev, 0x80, reg);
|
|
||||||
/* Fall through */
|
|
||||||
default:
|
|
||||||
/* Make sure AHCI is turned back on */
|
|
||||||
pci_write_config_byte(pdev, 0x41, 0xa1);
|
|
||||||
}
|
|
||||||
return ata_pci_device_resume(pdev);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const struct pci_device_id jmicron_pci_tbl[] = {
|
static const struct pci_device_id jmicron_pci_tbl[] = {
|
||||||
{ PCI_VDEVICE(JMICRON, PCI_DEVICE_ID_JMICRON_JMB361), 361},
|
{ PCI_VDEVICE(JMICRON, PCI_DEVICE_ID_JMICRON_JMB361), 361},
|
||||||
{ PCI_VDEVICE(JMICRON, PCI_DEVICE_ID_JMICRON_JMB363), 363},
|
{ PCI_VDEVICE(JMICRON, PCI_DEVICE_ID_JMICRON_JMB363), 363},
|
||||||
|
@ -255,7 +225,7 @@ static struct pci_driver jmicron_pci_driver = {
|
||||||
.probe = jmicron_init_one,
|
.probe = jmicron_init_one,
|
||||||
.remove = ata_pci_remove_one,
|
.remove = ata_pci_remove_one,
|
||||||
.suspend = ata_pci_device_suspend,
|
.suspend = ata_pci_device_suspend,
|
||||||
.resume = jmicron_reinit_one,
|
.resume = ata_pci_device_resume,
|
||||||
};
|
};
|
||||||
|
|
||||||
static int __init jmicron_init(void)
|
static int __init jmicron_init(void)
|
||||||
|
|
Loading…
Reference in New Issue