diff mbox

[v6,28/30] PCI: Export find_pci_host_bridge() and rename to pci_find_host_bridge()

Message ID 1425868467-9667-29-git-send-email-wangyijing@huawei.com (mailing list archive)
State New, archived
Headers show

Commit Message

Yijing Wang March 9, 2015, 2:34 a.m. UTC
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
 drivers/pci/host-bridge.c |    6 +++---
 drivers/pci/pci.h         |    2 ++
 2 files changed, 5 insertions(+), 3 deletions(-)

Comments

Bjorn Helgaas March 12, 2015, 3:43 a.m. UTC | #1
On Mon, Mar 09, 2015 at 10:34:25AM +0800, Yijing Wang wrote:
> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
> ---
>  drivers/pci/host-bridge.c |    6 +++---
>  drivers/pci/pci.h         |    2 ++
>  2 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/pci/host-bridge.c b/drivers/pci/host-bridge.c
> index bc1de59..51f0a82 100644
> --- a/drivers/pci/host-bridge.c
> +++ b/drivers/pci/host-bridge.c
> @@ -103,7 +103,7 @@ static struct pci_bus *find_pci_root_bus(struct pci_bus *bus)
>  	return bus;
>  }
>  
> -static struct pci_host_bridge *find_pci_host_bridge(struct pci_bus *bus)
> +struct pci_host_bridge *pci_find_host_bridge(struct pci_bus *bus)
>  {
>  	struct pci_bus *root_bus = find_pci_root_bus(bus);
>  
> @@ -121,7 +121,7 @@ void pci_set_host_bridge_release(struct pci_host_bridge *bridge,
>  void pcibios_resource_to_bus(struct pci_bus *bus, struct pci_bus_region *region,
>  			     struct resource *res)
>  {
> -	struct pci_host_bridge *bridge = find_pci_host_bridge(bus);
> +	struct pci_host_bridge *bridge = pci_find_host_bridge(bus);
>  	struct resource_entry *window;
>  	resource_size_t offset = 0;
>  
> @@ -146,7 +146,7 @@ static bool region_contains(struct pci_bus_region *region1,
>  void pcibios_bus_to_resource(struct pci_bus *bus, struct resource *res,
>  			     struct pci_bus_region *region)
>  {
> -	struct pci_host_bridge *bridge = find_pci_host_bridge(bus);
> +	struct pci_host_bridge *bridge = pci_find_host_bridge(bus);
>  	struct resource_entry *window;
>  	resource_size_t offset = 0;
>  
> diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
> index a1dc9f2..45252dd 100644
> --- a/drivers/pci/pci.h
> +++ b/drivers/pci/pci.h
> @@ -328,4 +328,6 @@ struct pci_host_bridge *pci_create_host_bridge(
>  		void *sysdata, struct pci_host_bridge_ops *ops);
>  
>  void pci_free_host_bridge(struct pci_host_bridge *host);
> +struct pci_host_bridge *pci_find_host_bridge(struct pci_bus *bus);

This is only used in drivers/pci/host-bridge.c and in drivers/pci/pci.c for
pci_domain_nr().  Can you drop this patch and put the generic
pci_domain_nr() implementation (next patch) in host-bridge.c instead of in
pci.c?

> +
>  #endif /* DRIVERS_PCI_H */
> -- 
> 1.7.1
>
Yijing Wang March 12, 2015, 1:29 p.m. UTC | #2
>> diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
>> index a1dc9f2..45252dd 100644
>> --- a/drivers/pci/pci.h
>> +++ b/drivers/pci/pci.h
>> @@ -328,4 +328,6 @@ struct pci_host_bridge *pci_create_host_bridge(
>>  		void *sysdata, struct pci_host_bridge_ops *ops);
>>  
>>  void pci_free_host_bridge(struct pci_host_bridge *host);
>> +struct pci_host_bridge *pci_find_host_bridge(struct pci_bus *bus);
> 
> This is only used in drivers/pci/host-bridge.c and in drivers/pci/pci.c for
> pci_domain_nr().  Can you drop this patch and put the generic
> pci_domain_nr() implementation (next patch) in host-bridge.c instead of in
> pci.c?

Of course, thanks.

> 
>> +
>>  #endif /* DRIVERS_PCI_H */
>> -- 
>> 1.7.1
>>
> 
> .
>
diff mbox

Patch

diff --git a/drivers/pci/host-bridge.c b/drivers/pci/host-bridge.c
index bc1de59..51f0a82 100644
--- a/drivers/pci/host-bridge.c
+++ b/drivers/pci/host-bridge.c
@@ -103,7 +103,7 @@  static struct pci_bus *find_pci_root_bus(struct pci_bus *bus)
 	return bus;
 }
 
-static struct pci_host_bridge *find_pci_host_bridge(struct pci_bus *bus)
+struct pci_host_bridge *pci_find_host_bridge(struct pci_bus *bus)
 {
 	struct pci_bus *root_bus = find_pci_root_bus(bus);
 
@@ -121,7 +121,7 @@  void pci_set_host_bridge_release(struct pci_host_bridge *bridge,
 void pcibios_resource_to_bus(struct pci_bus *bus, struct pci_bus_region *region,
 			     struct resource *res)
 {
-	struct pci_host_bridge *bridge = find_pci_host_bridge(bus);
+	struct pci_host_bridge *bridge = pci_find_host_bridge(bus);
 	struct resource_entry *window;
 	resource_size_t offset = 0;
 
@@ -146,7 +146,7 @@  static bool region_contains(struct pci_bus_region *region1,
 void pcibios_bus_to_resource(struct pci_bus *bus, struct resource *res,
 			     struct pci_bus_region *region)
 {
-	struct pci_host_bridge *bridge = find_pci_host_bridge(bus);
+	struct pci_host_bridge *bridge = pci_find_host_bridge(bus);
 	struct resource_entry *window;
 	resource_size_t offset = 0;
 
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index a1dc9f2..45252dd 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -328,4 +328,6 @@  struct pci_host_bridge *pci_create_host_bridge(
 		void *sysdata, struct pci_host_bridge_ops *ops);
 
 void pci_free_host_bridge(struct pci_host_bridge *host);
+struct pci_host_bridge *pci_find_host_bridge(struct pci_bus *bus);
+
 #endif /* DRIVERS_PCI_H */