[PATCH] serverworks: Switch to pci refcounted interfaces
As we don't support hotplug we end up leaking an isa_dev reference which if unload was ever added we would drop at the end of unloading. This is fine because we do genuinely need the isa_dev pointer until unload. Signed-off-by: Alan Cox <alan@redhat.com> Cc: Greg KH <greg@kroah.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Родитель
1424e50448
Коммит
970a61363b
|
@ -359,7 +359,7 @@ static unsigned int __devinit init_chipset_svwks (struct pci_dev *dev, const cha
|
||||||
|
|
||||||
/* OSB4 : South Bridge and IDE */
|
/* OSB4 : South Bridge and IDE */
|
||||||
if (dev->device == PCI_DEVICE_ID_SERVERWORKS_OSB4IDE) {
|
if (dev->device == PCI_DEVICE_ID_SERVERWORKS_OSB4IDE) {
|
||||||
isa_dev = pci_find_device(PCI_VENDOR_ID_SERVERWORKS,
|
isa_dev = pci_get_device(PCI_VENDOR_ID_SERVERWORKS,
|
||||||
PCI_DEVICE_ID_SERVERWORKS_OSB4, NULL);
|
PCI_DEVICE_ID_SERVERWORKS_OSB4, NULL);
|
||||||
if (isa_dev) {
|
if (isa_dev) {
|
||||||
pci_read_config_dword(isa_dev, 0x64, ®);
|
pci_read_config_dword(isa_dev, 0x64, ®);
|
||||||
|
@ -380,7 +380,7 @@ static unsigned int __devinit init_chipset_svwks (struct pci_dev *dev, const cha
|
||||||
if (!(PCI_FUNC(dev->devfn) & 1)) {
|
if (!(PCI_FUNC(dev->devfn) & 1)) {
|
||||||
struct pci_dev * findev = NULL;
|
struct pci_dev * findev = NULL;
|
||||||
u32 reg4c = 0;
|
u32 reg4c = 0;
|
||||||
findev = pci_find_device(PCI_VENDOR_ID_SERVERWORKS,
|
findev = pci_get_device(PCI_VENDOR_ID_SERVERWORKS,
|
||||||
PCI_DEVICE_ID_SERVERWORKS_CSB5, NULL);
|
PCI_DEVICE_ID_SERVERWORKS_CSB5, NULL);
|
||||||
if (findev) {
|
if (findev) {
|
||||||
pci_read_config_dword(findev, 0x4C, ®4c);
|
pci_read_config_dword(findev, 0x4C, ®4c);
|
||||||
|
@ -388,6 +388,7 @@ static unsigned int __devinit init_chipset_svwks (struct pci_dev *dev, const cha
|
||||||
reg4c |= 0x00000040;
|
reg4c |= 0x00000040;
|
||||||
reg4c |= 0x00000020;
|
reg4c |= 0x00000020;
|
||||||
pci_write_config_dword(findev, 0x4C, reg4c);
|
pci_write_config_dword(findev, 0x4C, reg4c);
|
||||||
|
pci_dev_put(findev);
|
||||||
}
|
}
|
||||||
outb_p(0x06, 0x0c00);
|
outb_p(0x06, 0x0c00);
|
||||||
dev->irq = inb_p(0x0c01);
|
dev->irq = inb_p(0x0c01);
|
||||||
|
@ -395,12 +396,13 @@ static unsigned int __devinit init_chipset_svwks (struct pci_dev *dev, const cha
|
||||||
struct pci_dev * findev = NULL;
|
struct pci_dev * findev = NULL;
|
||||||
u8 reg41 = 0;
|
u8 reg41 = 0;
|
||||||
|
|
||||||
findev = pci_find_device(PCI_VENDOR_ID_SERVERWORKS,
|
findev = pci_get_device(PCI_VENDOR_ID_SERVERWORKS,
|
||||||
PCI_DEVICE_ID_SERVERWORKS_CSB6, NULL);
|
PCI_DEVICE_ID_SERVERWORKS_CSB6, NULL);
|
||||||
if (findev) {
|
if (findev) {
|
||||||
pci_read_config_byte(findev, 0x41, ®41);
|
pci_read_config_byte(findev, 0x41, ®41);
|
||||||
reg41 &= ~0x40;
|
reg41 &= ~0x40;
|
||||||
pci_write_config_byte(findev, 0x41, reg41);
|
pci_write_config_byte(findev, 0x41, reg41);
|
||||||
|
pci_dev_put(findev);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* This is a device pin issue on CSB6.
|
* This is a device pin issue on CSB6.
|
||||||
|
|
Загрузка…
Ссылка в новой задаче