public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PCI: Move prototypes for EXPORT_SYMBOL functions to include/linux/pci.h
@ 2007-07-13  5:16 Kumar Gala
  2007-07-13  5:33 ` Greg KH
  0 siblings, 1 reply; 7+ messages in thread
From: Kumar Gala @ 2007-07-13  5:16 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-pci, linux-kernel

pci_do_scan_bus() and pci_bus_find_capability() are marked EXPORT_SYMBOL
and thus usable outside of the PCI drive core itself.  Make the prototypes
for these functions accessible to everyone.

Also kill the duplicate prototype for pci_bus_alloc_resource().

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>

---
commit 2b8427b1a458361c1a5eaea0f8542cceb8df9572
tree 1bd6dae0542d31556b473c7ababecad6416e3a15
parent 773208946a132fb733ba273ee8562814f828cc28
author Kumar Gala <galak@kernel.crashing.org> Fri, 13 Jul 2007 00:15:20 -0500
committer Kumar Gala <galak@kernel.crashing.org> Fri, 13 Jul 2007 00:15:20 -0500

 drivers/pci/pci.h   |   11 +----------
 include/linux/pci.h |    4 ++++
 2 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index 3fec13d..c16d180 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -6,12 +6,7 @@ extern int pci_uevent(struct device *dev, char **envp, int num_envp,
 extern int pci_create_sysfs_dev_files(struct pci_dev *pdev);
 extern void pci_remove_sysfs_dev_files(struct pci_dev *pdev);
 extern void pci_cleanup_rom(struct pci_dev *dev);
-extern int pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res,
-				  resource_size_t size, resource_size_t align,
-				  resource_size_t min, unsigned int type_mask,
-				  void (*alignf)(void *, struct resource *,
-					      resource_size_t, resource_size_t),
-				  void *alignf_data);
+
 /* Firmware callbacks */
 extern int (*platform_pci_choose_state)(struct pci_dev *dev, pm_message_t state);
 extern int (*platform_pci_set_power_state)(struct pci_dev *dev, pci_power_t state);
@@ -34,10 +29,6 @@ static inline int pci_proc_detach_device(struct pci_dev *dev) { 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_bus_find_capability (struct pci_bus *bus, unsigned int devfn, int cap);
-
 extern void pci_remove_legacy_files(struct pci_bus *bus);

 /* Lock for read/write access to pci device and bus lists */
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 37a7158..006ec05 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -575,6 +575,10 @@ int pci_set_power_state(struct pci_dev *dev, pci_power_t state);
 pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state);
 int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int enable);

+/* Functions for PCI Hotplug drivers to use */
+unsigned int pci_do_scan_bus(struct pci_bus *bus);
+int pci_bus_find_capability (struct pci_bus *bus, unsigned int devfn, int cap);
+
 /* Helper functions for low-level code (drivers/pci/setup-[bus,res].c) */
 void pci_bus_assign_resources(struct pci_bus *bus);
 void pci_bus_size_bridges(struct pci_bus *bus);

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] PCI: Move prototypes for EXPORT_SYMBOL functions to include/linux/pci.h
  2007-07-13  5:16 [PATCH] PCI: Move prototypes for EXPORT_SYMBOL functions to include/linux/pci.h Kumar Gala
@ 2007-07-13  5:33 ` Greg KH
  2007-07-13  5:55   ` Kumar Gala
  0 siblings, 1 reply; 7+ messages in thread
From: Greg KH @ 2007-07-13  5:33 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linux-pci, linux-kernel

On Fri, Jul 13, 2007 at 12:16:29AM -0500, Kumar Gala wrote:
> pci_do_scan_bus() and pci_bus_find_capability() are marked EXPORT_SYMBOL
> and thus usable outside of the PCI drive core itself.  Make the prototypes
> for these functions accessible to everyone.

Well, no, I'd like to only have the pci hotplug drivers use them if
possible.  So until we have proper namespaces on the exported symbols,
I'd really like to keep these as-is if possible.

Or are you needing these symbols for some code outside of the
drivers/pci/ directory tree?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] PCI: Move prototypes for EXPORT_SYMBOL functions to include/linux/pci.h
  2007-07-13  5:33 ` Greg KH
@ 2007-07-13  5:55   ` Kumar Gala
  2007-07-13  6:05     ` Greg KH
  0 siblings, 1 reply; 7+ messages in thread
From: Kumar Gala @ 2007-07-13  5:55 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-pci, linux-kernel


On Jul 13, 2007, at 12:33 AM, Greg KH wrote:

> On Fri, Jul 13, 2007 at 12:16:29AM -0500, Kumar Gala wrote:
>> pci_do_scan_bus() and pci_bus_find_capability() are marked  
>> EXPORT_SYMBOL
>> and thus usable outside of the PCI drive core itself.  Make the  
>> prototypes
>> for these functions accessible to everyone.
>
> Well, no, I'd like to only have the pci hotplug drivers use them if
> possible.  So until we have proper namespaces on the exported symbols,
> I'd really like to keep these as-is if possible.
>
> Or are you needing these symbols for some code outside of the
> drivers/pci/ directory tree?

I need pci_bus_find_capability() in arch/powerpc pci code.

I'm using it as a way to tell if we are a PCIe PHB.

- k

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] PCI: Move prototypes for EXPORT_SYMBOL functions to include/linux/pci.h
  2007-07-13  5:55   ` Kumar Gala
@ 2007-07-13  6:05     ` Greg KH
  2007-07-13  6:10       ` Kumar Gala
  0 siblings, 1 reply; 7+ messages in thread
From: Greg KH @ 2007-07-13  6:05 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linux-pci, linux-kernel

On Fri, Jul 13, 2007 at 12:55:39AM -0500, Kumar Gala wrote:
> 
>  On Jul 13, 2007, at 12:33 AM, Greg KH wrote:
> 
> > On Fri, Jul 13, 2007 at 12:16:29AM -0500, Kumar Gala wrote:
> >> pci_do_scan_bus() and pci_bus_find_capability() are marked EXPORT_SYMBOL
> >> and thus usable outside of the PCI drive core itself.  Make the prototypes
> >> for these functions accessible to everyone.
> >
> > Well, no, I'd like to only have the pci hotplug drivers use them if
> > possible.  So until we have proper namespaces on the exported symbols,
> > I'd really like to keep these as-is if possible.
> >
> > Or are you needing these symbols for some code outside of the
> > drivers/pci/ directory tree?
> 
>  I need pci_bus_find_capability() in arch/powerpc pci code.
> 
>  I'm using it as a way to tell if we are a PCIe PHB.

Ok, care to export only that function then?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] PCI: Move prototypes for EXPORT_SYMBOL functions to include/linux/pci.h
  2007-07-13  6:05     ` Greg KH
@ 2007-07-13  6:10       ` Kumar Gala
  2007-07-13  6:27         ` Greg KH
  0 siblings, 1 reply; 7+ messages in thread
From: Kumar Gala @ 2007-07-13  6:10 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-pci, linux-kernel

On Thu, 12 Jul 2007, Greg KH wrote:

> On Fri, Jul 13, 2007 at 12:55:39AM -0500, Kumar Gala wrote:
> >
> >  On Jul 13, 2007, at 12:33 AM, Greg KH wrote:
> >
> > > On Fri, Jul 13, 2007 at 12:16:29AM -0500, Kumar Gala wrote:
> > >> pci_do_scan_bus() and pci_bus_find_capability() are marked EXPORT_SYMBOL
> > >> and thus usable outside of the PCI drive core itself.  Make the prototypes
> > >> for these functions accessible to everyone.
> > >
> > > Well, no, I'd like to only have the pci hotplug drivers use them if
> > > possible.  So until we have proper namespaces on the exported symbols,
> > > I'd really like to keep these as-is if possible.
> > >
> > > Or are you needing these symbols for some code outside of the
> > > drivers/pci/ directory tree?
> >
> >  I need pci_bus_find_capability() in arch/powerpc pci code.
> >
> >  I'm using it as a way to tell if we are a PCIe PHB.
>
> Ok, care to export only that function then?

that's fine, will do.

I assume we want to kill the prototype pci_bus_alloc_resource() in
drivers/pci/pci.h since its duplicated in include/linux/pci.h

Also, I wasn't sure 'extern int pci_bus_find_capability'.. or just 'int
pci_bus_find_capability'?

-k

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] PCI: Move prototypes for EXPORT_SYMBOL functions to include/linux/pci.h
  2007-07-13  6:10       ` Kumar Gala
@ 2007-07-13  6:27         ` Greg KH
  2007-07-17  4:27           ` [PATCH] PCI: Move prototypes for pci_bus_find_capability " Kumar Gala
  0 siblings, 1 reply; 7+ messages in thread
From: Greg KH @ 2007-07-13  6:27 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linux-pci, linux-kernel

On Fri, Jul 13, 2007 at 01:10:46AM -0500, Kumar Gala wrote:
> On Thu, 12 Jul 2007, Greg KH wrote:
> 
> > On Fri, Jul 13, 2007 at 12:55:39AM -0500, Kumar Gala wrote:
> > >
> > >  On Jul 13, 2007, at 12:33 AM, Greg KH wrote:
> > >
> > > > On Fri, Jul 13, 2007 at 12:16:29AM -0500, Kumar Gala wrote:
> > > >> pci_do_scan_bus() and pci_bus_find_capability() are marked EXPORT_SYMBOL
> > > >> and thus usable outside of the PCI drive core itself.  Make the prototypes
> > > >> for these functions accessible to everyone.
> > > >
> > > > Well, no, I'd like to only have the pci hotplug drivers use them if
> > > > possible.  So until we have proper namespaces on the exported symbols,
> > > > I'd really like to keep these as-is if possible.
> > > >
> > > > Or are you needing these symbols for some code outside of the
> > > > drivers/pci/ directory tree?
> > >
> > >  I need pci_bus_find_capability() in arch/powerpc pci code.
> > >
> > >  I'm using it as a way to tell if we are a PCIe PHB.
> >
> > Ok, care to export only that function then?
> 
> that's fine, will do.
> 
> I assume we want to kill the prototype pci_bus_alloc_resource() in
> drivers/pci/pci.h since its duplicated in include/linux/pci.h

Yes.

> Also, I wasn't sure 'extern int pci_bus_find_capability'.. or just 'int
> pci_bus_find_capability'?

Whatever matches the surrounding code, I don't have a preference but I
think others might.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] PCI: Move prototypes for pci_bus_find_capability to include/linux/pci.h
  2007-07-13  6:27         ` Greg KH
@ 2007-07-17  4:27           ` Kumar Gala
  0 siblings, 0 replies; 7+ messages in thread
From: Kumar Gala @ 2007-07-17  4:27 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-pci, linux-kernel

We need pci_bus_find_capability() in some arch/powerpc code so move
the prototype into a header accessible to it.

Also kill the duplicate prototype for pci_bus_alloc_resource().

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---

Here's a version that just moves the prototype I need for arch/powerpc and
kills the duplicate.

 drivers/pci/pci.h   |    8 +-------
 include/linux/pci.h |    3 +++
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index 3fec13d..835875d 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -6,12 +6,7 @@ extern int pci_uevent(struct device *dev, char **envp, int num_envp,
 extern int pci_create_sysfs_dev_files(struct pci_dev *pdev);
 extern void pci_remove_sysfs_dev_files(struct pci_dev *pdev);
 extern void pci_cleanup_rom(struct pci_dev *dev);
-extern int pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res,
-				  resource_size_t size, resource_size_t align,
-				  resource_size_t min, unsigned int type_mask,
-				  void (*alignf)(void *, struct resource *,
-					      resource_size_t, resource_size_t),
-				  void *alignf_data);
+
 /* Firmware callbacks */
 extern int (*platform_pci_choose_state)(struct pci_dev *dev, pm_message_t state);
 extern int (*platform_pci_set_power_state)(struct pci_dev *dev, pci_power_t state);
@@ -36,7 +31,6 @@ static inline int pci_proc_detach_bus(struct pci_bus *bus) { return 0; }

 /* Functions for PCI Hotplug drivers to use */
 extern unsigned int pci_do_scan_bus(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);

diff --git a/include/linux/pci.h b/include/linux/pci.h
index 5e84f2e..8a689ef 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -577,6 +577,9 @@ int pci_set_power_state(struct pci_dev *dev, pci_power_t state);
 pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state);
 int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int enable);

+/* Functions for PCI Hotplug drivers to use */
+int pci_bus_find_capability (struct pci_bus *bus, unsigned int devfn, int cap);
+
 /* Helper functions for low-level code (drivers/pci/setup-[bus,res].c) */
 void pci_bus_assign_resources(struct pci_bus *bus);
 void pci_bus_size_bridges(struct pci_bus *bus);
-- 
1.5.2.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-07-17  4:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-13  5:16 [PATCH] PCI: Move prototypes for EXPORT_SYMBOL functions to include/linux/pci.h Kumar Gala
2007-07-13  5:33 ` Greg KH
2007-07-13  5:55   ` Kumar Gala
2007-07-13  6:05     ` Greg KH
2007-07-13  6:10       ` Kumar Gala
2007-07-13  6:27         ` Greg KH
2007-07-17  4:27           ` [PATCH] PCI: Move prototypes for pci_bus_find_capability " Kumar Gala

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox