aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2007-04-23 09:51:29 -0400
committerDave Jones <davej@redhat.com>2007-04-26 14:22:51 -0400
commit881ba59d4685b28433bf313b6db51672a02696a3 (patch)
tree7ea69d1749ac8880dfeca70cbb40b733473f6401 /drivers/char
parent1e415732834991c8335da39832ee7a91f2a65602 (diff)
[AGPGART] sworks-agp: Switch to PCI ref counting APIs
Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/agp/sworks-agp.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/char/agp/sworks-agp.c b/drivers/char/agp/sworks-agp.c
index 55212a3811fd..551ef25063ef 100644
--- a/drivers/char/agp/sworks-agp.c
+++ b/drivers/char/agp/sworks-agp.c
@@ -455,15 +455,6 @@ static int __devinit agp_serverworks_probe(struct pci_dev *pdev,
455 u32 temp, temp2; 455 u32 temp, temp2;
456 u8 cap_ptr = 0; 456 u8 cap_ptr = 0;
457 457
458 /* Everything is on func 1 here so we are hardcoding function one */
459 bridge_dev = pci_find_slot((unsigned int)pdev->bus->number,
460 PCI_DEVFN(0, 1));
461 if (!bridge_dev) {
462 printk(KERN_INFO PFX "Detected a Serverworks chipset "
463 "but could not find the secondary device.\n");
464 return -ENODEV;
465 }
466
467 cap_ptr = pci_find_capability(pdev, PCI_CAP_ID_AGP); 458 cap_ptr = pci_find_capability(pdev, PCI_CAP_ID_AGP);
468 459
469 switch (pdev->device) { 460 switch (pdev->device) {
@@ -483,6 +474,15 @@ static int __devinit agp_serverworks_probe(struct pci_dev *pdev,
483 return -ENODEV; 474 return -ENODEV;
484 } 475 }
485 476
477 /* Everything is on func 1 here so we are hardcoding function one */
478 bridge_dev = pci_get_bus_and_slot((unsigned int)pdev->bus->number,
479 PCI_DEVFN(0, 1));
480 if (!bridge_dev) {
481 printk(KERN_INFO PFX "Detected a Serverworks chipset "
482 "but could not find the secondary device.\n");
483 return -ENODEV;
484 }
485
486 serverworks_private.svrwrks_dev = bridge_dev; 486 serverworks_private.svrwrks_dev = bridge_dev;
487 serverworks_private.gart_addr_ofs = 0x10; 487 serverworks_private.gart_addr_ofs = 0x10;
488 488
@@ -515,7 +515,7 @@ static int __devinit agp_serverworks_probe(struct pci_dev *pdev,
515 515
516 bridge->driver = &sworks_driver; 516 bridge->driver = &sworks_driver;
517 bridge->dev_private_data = &serverworks_private, 517 bridge->dev_private_data = &serverworks_private,
518 bridge->dev = pdev; 518 bridge->dev = pci_dev_get(pdev);
519 519
520 pci_set_drvdata(pdev, bridge); 520 pci_set_drvdata(pdev, bridge);
521 return agp_add_bridge(bridge); 521 return agp_add_bridge(bridge);
@@ -525,8 +525,11 @@ static void __devexit agp_serverworks_remove(struct pci_dev *pdev)
525{ 525{
526 struct agp_bridge_data *bridge = pci_get_drvdata(pdev); 526 struct agp_bridge_data *bridge = pci_get_drvdata(pdev);
527 527
528 pci_dev_put(bridge->dev);
528 agp_remove_bridge(bridge); 529 agp_remove_bridge(bridge);
529 agp_put_bridge(bridge); 530 agp_put_bridge(bridge);
531 pci_dev_put(serverworks_private.svrwrks_dev);
532 serverworks_private.svrwrks_dev = NULL;
530} 533}
531 534
532static struct pci_device_id agp_serverworks_pci_table[] = { 535static struct pci_device_id agp_serverworks_pci_table[] = {