Skip to content

Commit

Permalink
[PATCH] PCI: drivers/pci: some cleanups
Browse files Browse the repository at this point in the history
This patch contains the following cleanups:
- hotplug/pciehp_core.c: make the needlessly global hpdriver_context
                         static
- #if 0 the following unused functions:
  - pci.c: pci_bus_max_busnr()
  - pci.c: pci_max_busnr()
  - proc.c: pci_proc_attach_bus()
  - remove.c: pci_remove_device_safe

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Adrian Bunk authored and Greg Kroah-Hartman committed Jan 9, 2006
1 parent c64b5ee commit 54c762f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion drivers/pci/hotplug/pciehp_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ static void __exit unload_pciehpd(void)

}

int hpdriver_context = 0;
static int hpdriver_context = 0;

static void pciehp_remove (struct pcie_device *device)
{
Expand Down
5 changes: 3 additions & 2 deletions drivers/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <asm/dma.h> /* isa_dma_bridge_buggy */
#include "pci.h"

#if 0

/**
* pci_bus_max_busnr - returns maximum PCI bus number of given bus' children
Expand Down Expand Up @@ -63,6 +64,8 @@ pci_max_busnr(void)
return max;
}

#endif /* 0 */

static int __pci_find_next_cap(struct pci_bus *bus, unsigned int devfn, u8 pos, int cap)
{
u8 id;
Expand Down Expand Up @@ -917,8 +920,6 @@ EXPORT_SYMBOL_GPL(pci_restore_bars);
EXPORT_SYMBOL(pci_enable_device_bars);
EXPORT_SYMBOL(pci_enable_device);
EXPORT_SYMBOL(pci_disable_device);
EXPORT_SYMBOL(pci_max_busnr);
EXPORT_SYMBOL(pci_bus_max_busnr);
EXPORT_SYMBOL(pci_find_capability);
EXPORT_SYMBOL(pci_bus_find_capability);
EXPORT_SYMBOL(pci_release_regions);
Expand Down
5 changes: 0 additions & 5 deletions drivers/pci/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,15 @@ extern int pci_user_write_config_dword(struct pci_dev *dev, int where, u32 val);
#ifdef CONFIG_PROC_FS
extern int pci_proc_attach_device(struct pci_dev *dev);
extern int pci_proc_detach_device(struct pci_dev *dev);
extern int pci_proc_attach_bus(struct pci_bus *bus);
extern int pci_proc_detach_bus(struct pci_bus *bus);
#else
static inline int pci_proc_attach_device(struct pci_dev *dev) { return 0; }
static inline int pci_proc_detach_device(struct pci_dev *dev) { return 0; }
static inline int pci_proc_attach_bus(struct pci_bus *bus) { return 0; }
static inline int pci_proc_detach_bus(struct pci_bus *bus) { return 0; }
#endif

/* Functions for PCI Hotplug drivers to use */
extern unsigned int pci_do_scan_bus(struct pci_bus *bus);
extern int pci_remove_device_safe(struct pci_dev *dev);
extern unsigned char pci_max_busnr(void);
extern unsigned char pci_bus_max_busnr(struct pci_bus *bus);
extern int pci_bus_find_capability (struct pci_bus *bus, unsigned int devfn, int cap);

extern void pci_remove_legacy_files(struct pci_bus *bus);
Expand Down
3 changes: 2 additions & 1 deletion drivers/pci/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@ int pci_proc_detach_device(struct pci_dev *dev)
return 0;
}

#if 0
int pci_proc_attach_bus(struct pci_bus* bus)
{
struct proc_dir_entry *de = bus->procdir;
Expand All @@ -447,6 +448,7 @@ int pci_proc_attach_bus(struct pci_bus* bus)
}
return 0;
}
#endif /* 0 */

int pci_proc_detach_bus(struct pci_bus* bus)
{
Expand Down Expand Up @@ -612,7 +614,6 @@ __initcall(pci_proc_init);

#ifdef CONFIG_HOTPLUG
EXPORT_SYMBOL(pci_proc_attach_device);
EXPORT_SYMBOL(pci_proc_attach_bus);
EXPORT_SYMBOL(pci_proc_detach_bus);
#endif

3 changes: 2 additions & 1 deletion drivers/pci/remove.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,15 @@ static void pci_destroy_dev(struct pci_dev *dev)
* in question is not being used by a driver.
* Returns 0 on success.
*/
#if 0
int pci_remove_device_safe(struct pci_dev *dev)
{
if (pci_dev_driver(dev))
return -EBUSY;
pci_destroy_dev(dev);
return 0;
}
EXPORT_SYMBOL(pci_remove_device_safe);
#endif /* 0 */

void pci_remove_bus(struct pci_bus *pci_bus)
{
Expand Down

0 comments on commit 54c762f

Please sign in to comment.