summaryrefslogtreecommitdiff
path: root/drivers/pci
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2013-04-12 20:27:28 +0400
committerAl Viro <viro@zeniv.linux.org.uk>2013-05-02 01:29:46 +0400
commita8ca16ea7b0abb0a7e49492d1123b715f0ec62e8 (patch)
treefe201353c71385cab2f3cc0d7235c76121f51789 /drivers/pci
parent8d8b97ba499cb69fccb5fd9f2b439e3265fc3f27 (diff)
downloadlinux-a8ca16ea7b0abb0a7e49492d1123b715f0ec62e8.tar.xz
proc: Supply a function to remove a proc entry by PDE
Supply a function (proc_remove()) to remove a proc entry (and any subtree rooted there) by proc_dir_entry pointer rather than by name and (optionally) root dir entry pointer. This allows us to eliminate all remaining pde->name accesses outside of procfs. Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Grant Likely <grant.likely@linaro.or> cc: linux-acpi@vger.kernel.org cc: openipmi-developer@lists.sourceforge.net cc: devicetree-discuss@lists.ozlabs.org cc: linux-pci@vger.kernel.org cc: netdev@vger.kernel.org cc: netfilter-devel@vger.kernel.org cc: alsa-devel@alsa-project.org Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/proc.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/pci/proc.c b/drivers/pci/proc.c
index 7cde7c131fd0..08126087ec31 100644
--- a/drivers/pci/proc.c
+++ b/drivers/pci/proc.c
@@ -427,20 +427,14 @@ int pci_proc_attach_device(struct pci_dev *dev)
int pci_proc_detach_device(struct pci_dev *dev)
{
- struct proc_dir_entry *e;
-
- if ((e = dev->procent)) {
- remove_proc_entry(e->name, dev->bus->procdir);
- dev->procent = NULL;
- }
+ proc_remove(dev->procent);
+ dev->procent = NULL;
return 0;
}
int pci_proc_detach_bus(struct pci_bus* bus)
{
- struct proc_dir_entry *de = bus->procdir;
- if (de)
- remove_proc_entry(de->name, proc_bus_pci_dir);
+ proc_remove(bus->procdir);
return 0;
}