Patchwork [20/29] PCI, sparc: kill pci_find_next_bus

login
register
mail settings
Submitter Yinghai Lu
Date Sept. 25, 2012, 8:26 a.m.
Message ID <1348561590-28067-21-git-send-email-yinghai@kernel.org>
Download mbox | patch
Permalink /patch/186724/
State Not Applicable
Delegated to: David Miller
Headers show

Comments

Yinghai Lu - Sept. 25, 2012, 8:26 a.m.
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: sparclinux@vger.kernel.org
---
 arch/sparc/kernel/pci.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
Jurij Smakov - Sept. 25, 2012, 8:40 a.m.
On Tue, Sep 25, 2012 at 01:26:21AM -0700, Yinghai Lu wrote:
> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: sparclinux@vger.kernel.org
> ---
>  arch/sparc/kernel/pci.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c
> index acc8c83..70d8c16 100644
> --- a/arch/sparc/kernel/pci.c
> +++ b/arch/sparc/kernel/pci.c
> @@ -997,11 +997,13 @@ static void __devinit pci_bus_slot_names(struct device_node *node,
>  
>  static int __init of_pci_slot_init(void)
>  {
> -	struct pci_bus *pbus = NULL;
> +	struct pci_host_bridge *host_bridge = NULL;
> +	struct pci_bus *pbus;
>  
> -	while ((pbus = pci_find_next_bus(pbus)) != NULL) {
> +	for_each_pci_host_bridge(host_bridge) {
>  		struct device_node *node;
>  
> +		pbus = hot_bridge->bus;

Should this be 'host_bridge' and not 'hot_bridge'?

>  		if (pbus->self) {
>  			/* PCI->PCI bridge */
>  			node = pbus->self->dev.of_node;
> -- 
> 1.7.7
> 
> --
> To unsubscribe from this list: send the line "unsubscribe sparclinux" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Yinghai Lu - Sept. 25, 2012, 4:33 p.m.
On Tue, Sep 25, 2012 at 1:40 AM, Jurij Smakov <jurij@wooyd.org> wrote:
> On Tue, Sep 25, 2012 at 01:26:21AM -0700, Yinghai Lu wrote:
>> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
>> Cc: "David S. Miller" <davem@davemloft.net>
>> Cc: sparclinux@vger.kernel.org
>> ---
>>  arch/sparc/kernel/pci.c |    6 ++++--
>>  1 files changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c
>> index acc8c83..70d8c16 100644
>> --- a/arch/sparc/kernel/pci.c
>> +++ b/arch/sparc/kernel/pci.c
>> @@ -997,11 +997,13 @@ static void __devinit pci_bus_slot_names(struct device_node *node,
>>
>>  static int __init of_pci_slot_init(void)
>>  {
>> -     struct pci_bus *pbus = NULL;
>> +     struct pci_host_bridge *host_bridge = NULL;
>> +     struct pci_bus *pbus;
>>
>> -     while ((pbus = pci_find_next_bus(pbus)) != NULL) {
>> +     for_each_pci_host_bridge(host_bridge) {
>>               struct device_node *node;
>>
>> +             pbus = hot_bridge->bus;
>
> Should this be 'host_bridge' and not 'hot_bridge'?

fixed.

Thanks
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - Sept. 25, 2012, 5:05 p.m.
From: Yinghai Lu <yinghai@kernel.org>
Date: Tue, 25 Sep 2012 01:26:21 -0700

> Signed-off-by: Yinghai Lu <yinghai@kernel.org>

Acked-by: David S. Miller <davem@davemloft.net>
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c
index acc8c83..70d8c16 100644
--- a/arch/sparc/kernel/pci.c
+++ b/arch/sparc/kernel/pci.c
@@ -997,11 +997,13 @@  static void __devinit pci_bus_slot_names(struct device_node *node,
 
 static int __init of_pci_slot_init(void)
 {
-	struct pci_bus *pbus = NULL;
+	struct pci_host_bridge *host_bridge = NULL;
+	struct pci_bus *pbus;
 
-	while ((pbus = pci_find_next_bus(pbus)) != NULL) {
+	for_each_pci_host_bridge(host_bridge) {
 		struct device_node *node;
 
+		pbus = hot_bridge->bus;
 		if (pbus->self) {
 			/* PCI->PCI bridge */
 			node = pbus->self->dev.of_node;