Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=881ba59d4685b28433bf313b6db51672a02696a3
Commit:     881ba59d4685b28433bf313b6db51672a02696a3
Parent:     1e415732834991c8335da39832ee7a91f2a65602
Author:     Alan Cox <[EMAIL PROTECTED]>
AuthorDate: Mon Apr 23 14:51:29 2007 +0100
Committer:  Dave Jones <[EMAIL PROTECTED]>
CommitDate: Thu Apr 26 14:22:51 2007 -0400

    [AGPGART] sworks-agp: Switch to PCI ref counting APIs
    
    Signed-off-by: Alan Cox <[EMAIL PROTECTED]>
    Signed-off-by: Dave Jones <[EMAIL PROTECTED]>
---
 drivers/char/agp/sworks-agp.c |   23 +++++++++++++----------
 1 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/drivers/char/agp/sworks-agp.c b/drivers/char/agp/sworks-agp.c
index 55212a3..551ef25 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,
        u32 temp, temp2;
        u8 cap_ptr = 0;
 
-       /* Everything is on func 1 here so we are hardcoding function one */
-       bridge_dev = pci_find_slot((unsigned int)pdev->bus->number,
-                       PCI_DEVFN(0, 1));
-       if (!bridge_dev) {
-               printk(KERN_INFO PFX "Detected a Serverworks chipset "
-                      "but could not find the secondary device.\n");
-               return -ENODEV;
-       }
-
        cap_ptr = pci_find_capability(pdev, PCI_CAP_ID_AGP);
 
        switch (pdev->device) {
@@ -483,6 +474,15 @@ static int __devinit agp_serverworks_probe(struct pci_dev 
*pdev,
                return -ENODEV;
        }
 
+       /* Everything is on func 1 here so we are hardcoding function one */
+       bridge_dev = pci_get_bus_and_slot((unsigned int)pdev->bus->number,
+                       PCI_DEVFN(0, 1));
+       if (!bridge_dev) {
+               printk(KERN_INFO PFX "Detected a Serverworks chipset "
+                      "but could not find the secondary device.\n");
+               return -ENODEV;
+       }
+
        serverworks_private.svrwrks_dev = bridge_dev;
        serverworks_private.gart_addr_ofs = 0x10;
 
@@ -515,7 +515,7 @@ static int __devinit agp_serverworks_probe(struct pci_dev 
*pdev,
 
        bridge->driver = &sworks_driver;
        bridge->dev_private_data = &serverworks_private,
-       bridge->dev = pdev;
+       bridge->dev = pci_dev_get(pdev);
 
        pci_set_drvdata(pdev, bridge);
        return agp_add_bridge(bridge);
@@ -525,8 +525,11 @@ static void __devexit agp_serverworks_remove(struct 
pci_dev *pdev)
 {
        struct agp_bridge_data *bridge = pci_get_drvdata(pdev);
 
+       pci_dev_put(bridge->dev);
        agp_remove_bridge(bridge);
        agp_put_bridge(bridge);
+       pci_dev_put(serverworks_private.svrwrks_dev);
+       serverworks_private.svrwrks_dev = NULL;
 }
 
 static struct pci_device_id agp_serverworks_pci_table[] = {
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to