Commit 6bc27003 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

[PATCH] PCI: rename pci_get_dev() and pci_put_dev() to pci_dev_get() and pci_dev_put()

This makes things more consistant with the other get and put functions in the
driver code.
parent f26ad85d
...@@ -188,7 +188,7 @@ static void pci_destroy_dev(struct pci_dev *dev) ...@@ -188,7 +188,7 @@ static void pci_destroy_dev(struct pci_dev *dev)
spin_unlock(&pci_bus_lock); spin_unlock(&pci_bus_lock);
pci_free_resources(dev); pci_free_resources(dev);
pci_put_dev(dev); pci_dev_put(dev);
} }
/** /**
......
...@@ -138,10 +138,10 @@ static int pci_device_probe(struct device * dev) ...@@ -138,10 +138,10 @@ static int pci_device_probe(struct device * dev)
drv = to_pci_driver(dev->driver); drv = to_pci_driver(dev->driver);
pci_dev = to_pci_dev(dev); pci_dev = to_pci_dev(dev);
pci_get_dev(pci_dev); pci_dev_get(pci_dev);
error = __pci_device_probe(drv, pci_dev); error = __pci_device_probe(drv, pci_dev);
if (error) if (error)
pci_put_dev(pci_dev); pci_dev_put(pci_dev);
return error; return error;
} }
...@@ -156,7 +156,7 @@ static int pci_device_remove(struct device * dev) ...@@ -156,7 +156,7 @@ static int pci_device_remove(struct device * dev)
drv->remove(pci_dev); drv->remove(pci_dev);
pci_dev->driver = NULL; pci_dev->driver = NULL;
} }
pci_put_dev(pci_dev); pci_dev_put(pci_dev);
return 0; return 0;
} }
...@@ -448,18 +448,18 @@ static int pci_bus_match(struct device * dev, struct device_driver * drv) ...@@ -448,18 +448,18 @@ static int pci_bus_match(struct device * dev, struct device_driver * drv)
} }
/** /**
* pci_get_dev - increments the reference count of the pci device structure * pci_dev_get - increments the reference count of the pci device structure
* @dev: the device being referenced * @dev: the device being referenced
* *
* Each live reference to a device should be refcounted. * Each live reference to a device should be refcounted.
* *
* Drivers for PCI devices should normally record such references in * Drivers for PCI devices should normally record such references in
* their probe() methods, when they bind to a device, and release * their probe() methods, when they bind to a device, and release
* them by calling pci_put_dev(), in their disconnect() methods. * them by calling pci_dev_put(), in their disconnect() methods.
* *
* A pointer to the device with the incremented reference counter is returned. * A pointer to the device with the incremented reference counter is returned.
*/ */
struct pci_dev *pci_get_dev (struct pci_dev *dev) struct pci_dev *pci_dev_get(struct pci_dev *dev)
{ {
struct device *tmp; struct device *tmp;
...@@ -474,13 +474,13 @@ struct pci_dev *pci_get_dev (struct pci_dev *dev) ...@@ -474,13 +474,13 @@ struct pci_dev *pci_get_dev (struct pci_dev *dev)
} }
/** /**
* pci_put_dev - release a use of the pci device structure * pci_dev_put - release a use of the pci device structure
* @dev: device that's been disconnected * @dev: device that's been disconnected
* *
* Must be called when a user of a device is finished with it. When the last * Must be called when a user of a device is finished with it. When the last
* user of the device calls this function, the memory of the device is freed. * user of the device calls this function, the memory of the device is freed.
*/ */
void pci_put_dev(struct pci_dev *dev) void pci_dev_put(struct pci_dev *dev)
{ {
if (dev) if (dev)
put_device(&dev->dev); put_device(&dev->dev);
...@@ -504,5 +504,5 @@ EXPORT_SYMBOL(pci_register_driver); ...@@ -504,5 +504,5 @@ EXPORT_SYMBOL(pci_register_driver);
EXPORT_SYMBOL(pci_unregister_driver); EXPORT_SYMBOL(pci_unregister_driver);
EXPORT_SYMBOL(pci_dev_driver); EXPORT_SYMBOL(pci_dev_driver);
EXPORT_SYMBOL(pci_bus_type); EXPORT_SYMBOL(pci_bus_type);
EXPORT_SYMBOL(pci_get_dev); EXPORT_SYMBOL(pci_dev_get);
EXPORT_SYMBOL(pci_put_dev); EXPORT_SYMBOL(pci_dev_put);
...@@ -524,7 +524,7 @@ pci_scan_device(struct pci_bus *bus, int devfn) ...@@ -524,7 +524,7 @@ pci_scan_device(struct pci_bus *bus, int devfn)
} }
device_initialize(&dev->dev); device_initialize(&dev->dev);
dev->dev.release = pci_release_dev; dev->dev.release = pci_release_dev;
pci_get_dev(dev); pci_dev_get(dev);
pci_name_device(dev); pci_name_device(dev);
......
...@@ -334,7 +334,7 @@ static void pci_seq_stop(struct seq_file *m, void *v) ...@@ -334,7 +334,7 @@ static void pci_seq_stop(struct seq_file *m, void *v)
{ {
if (v) { if (v) {
struct pci_dev *dev = v; struct pci_dev *dev = v;
pci_put_dev(dev); pci_dev_put(dev);
} }
} }
...@@ -471,7 +471,7 @@ static int show_dev_config(struct seq_file *m, void *v) ...@@ -471,7 +471,7 @@ static int show_dev_config(struct seq_file *m, void *v)
first_dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, NULL); first_dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, NULL);
if (dev == first_dev) if (dev == first_dev)
seq_puts(m, "PCI devices found:\n"); seq_puts(m, "PCI devices found:\n");
pci_put_dev(first_dev); pci_dev_put(first_dev);
drv = pci_dev_driver(dev); drv = pci_dev_driver(dev);
......
...@@ -205,8 +205,8 @@ pci_get_subsys(unsigned int vendor, unsigned int device, ...@@ -205,8 +205,8 @@ pci_get_subsys(unsigned int vendor, unsigned int device,
} }
dev = NULL; dev = NULL;
exit: exit:
pci_put_dev(from); pci_dev_put(from);
dev = pci_get_dev(dev); dev = pci_dev_get(dev);
spin_unlock(&pci_bus_lock); spin_unlock(&pci_bus_lock);
return dev; return dev;
} }
......
...@@ -556,8 +556,8 @@ char *pci_class_name(u32 class); ...@@ -556,8 +556,8 @@ char *pci_class_name(u32 class);
void pci_read_bridge_bases(struct pci_bus *child); void pci_read_bridge_bases(struct pci_bus *child);
struct resource *pci_find_parent_resource(const struct pci_dev *dev, struct resource *res); struct resource *pci_find_parent_resource(const struct pci_dev *dev, struct resource *res);
int pci_get_interrupt_pin(struct pci_dev *dev, struct pci_dev **bridge); int pci_get_interrupt_pin(struct pci_dev *dev, struct pci_dev **bridge);
extern struct pci_dev *pci_get_dev(struct pci_dev *dev); extern struct pci_dev *pci_dev_get(struct pci_dev *dev);
extern void pci_put_dev(struct pci_dev *dev); extern void pci_dev_put(struct pci_dev *dev);
extern void pci_remove_bus_device(struct pci_dev *dev); extern void pci_remove_bus_device(struct pci_dev *dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment