xen/PCI: Don't use deprecated function pci_scan_bus_parented()
Subsystems (3)
PATCH v11 1/2 xen/PCI: Don't use deprecated function pci_scan_bus_parented()
From: Arnd Bergmann <[email protected]>
Use pci_scan_root_bus() instead of deprecated function pci_scan_bus_parented().
--- drivers/pci/xen-pcifront.c | 16 +++++++++++++--- 1 files changed, 13 insertions(+), 3 deletions(-)
drivers/pci/xen-pcifront.c +13 -3
@@ -446,9 +446,15 @@ static int pcifront_scan_root(struct pcifront_device *pdev, unsigned int domain, unsigned int bus) {struct pci_bus *b; +LIST_HEAD (resources);struct pcifront_sd *sd =NULL ;struct pci_bus_entry *bus_entry =NULL ;int err =0 ; +static struct resource busn_res = { + .start =0 , + .end =255 , + .flags =IORESOURCE_BUS , + };#ifndef CONFIG_PCI_DOMAINS if (domain !=0 ) {
@@ -470,17 +476,21 @@ static int pcifront_scan_root(struct pcifront_device *pdev, err = -ENOMEM ; goto err_out; } +pci_add_resource (&resources, &ioport_resource); +pci_add_resource (&resources, &iomem_resource); +pci_add_resource (&resources, &busn_res);pcifront_init_sd (sd, domain, bus, pdev);pci_lock_rescan_remove (); - b =pci_scan_bus_parented (&pdev->xdev->dev, bus, - &pcifront_bus_ops, sd); + b =pci_scan_root_bus (&pdev->xdev->dev, bus, + &pcifront_bus_ops, sd, &resources);if (!b) {dev_err (&pdev->xdev->dev,"Error creating PCI Frontend Bus!\n" ); err = -ENOMEM ;pci_unlock_rescan_remove (); +pci_free_resource_list (&resources); goto err_out; }
@@ -488,7 +498,7 @@ static int pcifront_scan_root(struct pcifront_device *pdev,list_add (&bus_entry->list, &pdev->root_buses); -/* pci_scan_bus_parented skips devices which do not have a have +/* pci_scan_root_bus skips devices which do not have a * devfn==0. The pcifront_scan_bus enumerates all devfn. */ err =pcifront_scan_bus (pdev, domain, bus, b);
Signature · 1 line
1.7.1
PATCH v11 2/2 PCI: Remove deprecated pci_scan_bus_parented()
No one uses pci_scan_bus_parented() any more,
remove it.
--- drivers/pci/probe.c | 19 ------------------- include/linux/pci.h | 2 -- 2 files changed, 0 insertions(+), 21 deletions(-)
drivers/pci/probe.c +0 -19
@@ -2094,25 +2094,6 @@ struct pci_bus *pci_scan_root_bus(struct device *parent, int bus, }EXPORT_SYMBOL (pci_scan_root_bus); -/* Deprecated; use pci_scan_root_bus() instead */ -struct pci_bus *pci_scan_bus_parented (struct device *parent, -int bus,struct pci_ops *ops,void *sysdata) -{ -LIST_HEAD (resources); -struct pci_bus *b; - -pci_add_resource (&resources, &ioport_resource); -pci_add_resource (&resources, &iomem_resource); -pci_add_resource (&resources, &busn_resource); - b =pci_create_root_bus (parent, bus, ops, sysdata, &resources); -if (b) -pci_scan_child_bus (b); -else -pci_free_resource_list (&resources); -return b; -} -EXPORT_SYMBOL (pci_scan_bus_parented); -struct pci_bus *pci_scan_bus (int bus,struct pci_ops *ops,void *sysdata) {
include/linux/pci.h +0 -2
@@ -773,8 +773,6 @@ void pcibios_bus_to_resource(struct pci_bus *bus, struct resource *res,void pcibios_scan_specific_bus (int busn);struct pci_bus *pci_find_bus (int domain,int busnr);void pci_bus_add_devices (const struct pci_bus *bus); -struct pci_bus *pci_scan_bus_parented (struct device *parent,int bus, -struct pci_ops *ops,void *sysdata);struct pci_bus *pci_scan_bus (int bus,struct pci_ops *ops,void *sysdata); struct pci_bus *pci_create_root_bus(struct device *parent, int bus, struct pci_ops *ops, void *sysdata,
Signature · 1 line
1.7.1
PATCH v11 2/2 PCI: Remove deprecated pci_scan_bus_parented()
In reply to Yijing WangNo one uses pci_scan_bus_parented() any more,
remove it.
--- drivers/pci/probe.c | 19 ------------------- include/linux/pci.h | 2 -- 2 files changed, 0 insertions(+), 21 deletions(-)
drivers/pci/probe.c +0 -19
@@ -2094,25 +2094,6 @@ struct pci_bus *pci_scan_root_bus(struct device *parent, int bus, }EXPORT_SYMBOL (pci_scan_root_bus); -/* Deprecated; use pci_scan_root_bus() instead */ -struct pci_bus *pci_scan_bus_parented (struct device *parent, -int bus,struct pci_ops *ops,void *sysdata) -{ -LIST_HEAD (resources); -struct pci_bus *b; - -pci_add_resource (&resources, &ioport_resource); -pci_add_resource (&resources, &iomem_resource); -pci_add_resource (&resources, &busn_resource); - b =pci_create_root_bus (parent, bus, ops, sysdata, &resources); -if (b) -pci_scan_child_bus (b); -else -pci_free_resource_list (&resources); -return b; -} -EXPORT_SYMBOL (pci_scan_bus_parented); -struct pci_bus *pci_scan_bus (int bus,struct pci_ops *ops,void *sysdata) {
include/linux/pci.h +0 -2
@@ -773,8 +773,6 @@ void pcibios_bus_to_resource(struct pci_bus *bus, struct resource *res,void pcibios_scan_specific_bus (int busn);struct pci_bus *pci_find_bus (int domain,int busnr);void pci_bus_add_devices (const struct pci_bus *bus); -struct pci_bus *pci_scan_bus_parented (struct device *parent,int bus, -struct pci_ops *ops,void *sysdata);struct pci_bus *pci_scan_bus (int bus,struct pci_ops *ops,void *sysdata); struct pci_bus *pci_create_root_bus(struct device *parent, int bus, struct pci_ops *ops, void *sysdata,
Signature · 1 line
1.7.1
Hi Konrad, sorry to bother you again, any comments for this patch ?
Thanks!
Yijing.
Quoted 67 lines · Yijing Wang
From: Arnd Bergmann <[email protected]>
Use
pci_scan_root_bus()instead of deprecated functionpci_scan_bus_parented().Signed-off-by Arnd Bergmann <[email protected]>Signed-off-by Yijing Wang <[email protected]>CC Konrad Rzeszutek Wilk <[email protected]>--- drivers/pci/xen-pcifront.c | 16 +++++++++++++--- 1 files changed, 13 insertions(+), 3 deletions(-)drivers/pci/xen-pcifront.c +13
-3@@ -446,9 +446,15 @@ static int pcifront_scan_root(struct pcifront_device *pdev, unsigned int domain, unsigned int bus) {struct pci_bus *b; +LIST_HEAD (resources);struct pcifront_sd *sd =NULL ;struct pci_bus_entry *bus_entry =NULL ;int err =0 ; +static struct resource busn_res = { + .start =0 , + .end =255 , + .flags =IORESOURCE_BUS , + };#ifndef CONFIG_PCI_DOMAINS if (domain !=0 ) {@@ -470,17 +476,21 @@ static int pcifront_scan_root(struct pcifront_device *pdev, err = -ENOMEM ; goto err_out; } +pci_add_resource (&resources, &ioport_resource); +pci_add_resource (&resources, &iomem_resource); +pci_add_resource (&resources, &busn_res);pcifront_init_sd (sd, domain, bus, pdev);pci_lock_rescan_remove (); - b =pci_scan_bus_parented (&pdev->xdev->dev, bus, - &pcifront_bus_ops, sd); + b =pci_scan_root_bus (&pdev->xdev->dev, bus, + &pcifront_bus_ops, sd, &resources);if (!b) {dev_err (&pdev->xdev->dev,"Error creating PCI Frontend Bus!\n" ); err = -ENOMEM ;pci_unlock_rescan_remove (); +pci_free_resource_list (&resources); goto err_out; }@@ -488,7 +498,7 @@ static int pcifront_scan_root(struct pcifront_device *pdev,list_add (&bus_entry->list, &pdev->root_buses); -/* pci_scan_bus_parented skips devices which do not have a have +/* pci_scan_root_bus skips devices which do not have a * devfn==0. The pcifront_scan_bus enumerates all devfn. */ err =pcifront_scan_bus (pdev, domain, bus, b);
Signature · 2 lines
Thanks! Yijing
Hi Konrad, sorry to bother you again, any comments for this patch ?
Thanks!
Yijing.
Quoted 67 lines · Yijing Wang
From: Arnd Bergmann <[email protected]>
Use
pci_scan_root_bus()instead of deprecated functionpci_scan_bus_parented().Signed-off-by Arnd Bergmann <[email protected]>Signed-off-by Yijing Wang <[email protected]>CC Konrad Rzeszutek Wilk <[email protected]>--- drivers/pci/xen-pcifront.c | 16 +++++++++++++--- 1 files changed, 13 insertions(+), 3 deletions(-)drivers/pci/xen-pcifront.c +13
-3@@ -446,9 +446,15 @@ static int pcifront_scan_root(struct pcifront_device *pdev, unsigned int domain, unsigned int bus) {struct pci_bus *b; +LIST_HEAD (resources);struct pcifront_sd *sd =NULL ;struct pci_bus_entry *bus_entry =NULL ;int err =0 ; +static struct resource busn_res = { + .start =0 , + .end =255 , + .flags =IORESOURCE_BUS , + };#ifndef CONFIG_PCI_DOMAINS if (domain !=0 ) {@@ -470,17 +476,21 @@ static int pcifront_scan_root(struct pcifront_device *pdev, err = -ENOMEM ; goto err_out; } +pci_add_resource (&resources, &ioport_resource); +pci_add_resource (&resources, &iomem_resource); +pci_add_resource (&resources, &busn_res);pcifront_init_sd (sd, domain, bus, pdev);pci_lock_rescan_remove (); - b =pci_scan_bus_parented (&pdev->xdev->dev, bus, - &pcifront_bus_ops, sd); + b =pci_scan_root_bus (&pdev->xdev->dev, bus, + &pcifront_bus_ops, sd, &resources);if (!b) {dev_err (&pdev->xdev->dev,"Error creating PCI Frontend Bus!\n" ); err = -ENOMEM ;pci_unlock_rescan_remove (); +pci_free_resource_list (&resources); goto err_out; }@@ -488,7 +498,7 @@ static int pcifront_scan_root(struct pcifront_device *pdev,list_add (&bus_entry->list, &pdev->root_buses); -/* pci_scan_bus_parented skips devices which do not have a have +/* pci_scan_root_bus skips devices which do not have a * devfn==0. The pcifront_scan_bus enumerates all devfn. */ err =pcifront_scan_bus (pdev, domain, bus, b);
Signature · 2 lines
Thanks! Yijing
Quoted 9 lines · Yijing Wang
From: Arnd Bergmann <[email protected]>
Use
pci_scan_root_bus()instead of deprecated functionpci_scan_bus_parented().Signed-off-by Arnd Bergmann <[email protected]>Signed-off-by Yijing Wang <[email protected]>CC Konrad Rzeszutek Wilk <[email protected]>
Applied both to pci/enumeration for v4.2, thanks!
Quoted 60 lines
--- drivers/pci/xen-pcifront.c | 16 +++++++++++++--- 1 files changed, 13 insertions(+), 3 deletions(-)drivers/pci/xen-pcifront.c +13
-3@@ -446,9 +446,15 @@ static int pcifront_scan_root(struct pcifront_device *pdev, unsigned int domain, unsigned int bus) {struct pci_bus *b; +LIST_HEAD (resources);struct pcifront_sd *sd =NULL ;struct pci_bus_entry *bus_entry =NULL ;int err =0 ; +static struct resource busn_res = { + .start =0 , + .end =255 , + .flags =IORESOURCE_BUS , + };#ifndef CONFIG_PCI_DOMAINS if (domain !=0 ) {@@ -470,17 +476,21 @@ static int pcifront_scan_root(struct pcifront_device *pdev, err = -ENOMEM ; goto err_out; } +pci_add_resource (&resources, &ioport_resource); +pci_add_resource (&resources, &iomem_resource); +pci_add_resource (&resources, &busn_res);pcifront_init_sd (sd, domain, bus, pdev);pci_lock_rescan_remove (); - b =pci_scan_bus_parented (&pdev->xdev->dev, bus, - &pcifront_bus_ops, sd); + b =pci_scan_root_bus (&pdev->xdev->dev, bus, + &pcifront_bus_ops, sd, &resources);if (!b) {dev_err (&pdev->xdev->dev,"Error creating PCI Frontend Bus!\n" ); err = -ENOMEM ;pci_unlock_rescan_remove (); +pci_free_resource_list (&resources); goto err_out; }@@ -488,7 +498,7 @@ static int pcifront_scan_root(struct pcifront_device *pdev,list_add (&bus_entry->list, &pdev->root_buses); -/* pci_scan_bus_parented skips devices which do not have a have +/* pci_scan_root_bus skips devices which do not have a * devfn==0. The pcifront_scan_bus enumerates all devfn. */ err =pcifront_scan_bus (pdev, domain, bus, b);Signature · 1 line
1.7.1
Quoted 9 lines · Yijing Wang
From: Arnd Bergmann <[email protected]>
Use
pci_scan_root_bus()instead of deprecated functionpci_scan_bus_parented().Signed-off-by Arnd Bergmann <[email protected]>Signed-off-by Yijing Wang <[email protected]>CC Konrad Rzeszutek Wilk <[email protected]>
Applied both to pci/enumeration for v4.2, thanks!
Quoted 60 lines
--- drivers/pci/xen-pcifront.c | 16 +++++++++++++--- 1 files changed, 13 insertions(+), 3 deletions(-)drivers/pci/xen-pcifront.c +13
-3@@ -446,9 +446,15 @@ static int pcifront_scan_root(struct pcifront_device *pdev, unsigned int domain, unsigned int bus) {struct pci_bus *b; +LIST_HEAD (resources);struct pcifront_sd *sd =NULL ;struct pci_bus_entry *bus_entry =NULL ;int err =0 ; +static struct resource busn_res = { + .start =0 , + .end =255 , + .flags =IORESOURCE_BUS , + };#ifndef CONFIG_PCI_DOMAINS if (domain !=0 ) {@@ -470,17 +476,21 @@ static int pcifront_scan_root(struct pcifront_device *pdev, err = -ENOMEM ; goto err_out; } +pci_add_resource (&resources, &ioport_resource); +pci_add_resource (&resources, &iomem_resource); +pci_add_resource (&resources, &busn_res);pcifront_init_sd (sd, domain, bus, pdev);pci_lock_rescan_remove (); - b =pci_scan_bus_parented (&pdev->xdev->dev, bus, - &pcifront_bus_ops, sd); + b =pci_scan_root_bus (&pdev->xdev->dev, bus, + &pcifront_bus_ops, sd, &resources);if (!b) {dev_err (&pdev->xdev->dev,"Error creating PCI Frontend Bus!\n" ); err = -ENOMEM ;pci_unlock_rescan_remove (); +pci_free_resource_list (&resources); goto err_out; }@@ -488,7 +498,7 @@ static int pcifront_scan_root(struct pcifront_device *pdev,list_add (&bus_entry->list, &pdev->root_buses); -/* pci_scan_bus_parented skips devices which do not have a have +/* pci_scan_root_bus skips devices which do not have a * devfn==0. The pcifront_scan_bus enumerates all devfn. */ err =pcifront_scan_bus (pdev, domain, bus, b);Signature · 1 line
1.7.1