* [PATCH] PCI: rcar: Reuse generic pci_parse_request_of_pci_ranges() function
@ 2018-04-25 15:21 Vladimir Zapolskiy
2018-04-26 7:43 ` Simon Horman
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Vladimir Zapolskiy @ 2018-04-25 15:21 UTC (permalink / raw)
To: Simon Horman, Bjorn Helgaas; +Cc: linux-pci, linux-renesas-soc
The non-functional change removes a custom function to parse and
allocate PCI resources in favour of pci_parse_request_of_pci_ranges().
Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
---
drivers/pci/host/pcie-rcar.c | 42 +-----------------------------------------
1 file changed, 1 insertion(+), 41 deletions(-)
diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c
index 6ab28f29ac6a..66863b587380 100644
--- a/drivers/pci/host/pcie-rcar.c
+++ b/drivers/pci/host/pcie-rcar.c
@@ -1063,44 +1063,6 @@ static const struct of_device_id rcar_pcie_of_match[] = {
{},
};
-static int rcar_pcie_parse_request_of_pci_ranges(struct rcar_pcie *pci)
-{
- int err;
- struct device *dev = pci->dev;
- struct device_node *np = dev->of_node;
- resource_size_t iobase;
- struct resource_entry *win, *tmp;
-
- err = of_pci_get_host_bridge_resources(np, 0, 0xff, &pci->resources,
- &iobase);
- if (err)
- return err;
-
- err = devm_request_pci_bus_resources(dev, &pci->resources);
- if (err)
- goto out_release_res;
-
- resource_list_for_each_entry_safe(win, tmp, &pci->resources) {
- struct resource *res = win->res;
-
- if (resource_type(res) == IORESOURCE_IO) {
- err = pci_remap_iospace(res, iobase);
- if (err) {
- dev_warn(dev, "error %d: failed to map resource %pR\n",
- err, res);
-
- resource_list_destroy_entry(win);
- }
- }
- }
-
- return 0;
-
-out_release_res:
- pci_free_resource_list(&pci->resources);
- return err;
-}
-
static int rcar_pcie_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
@@ -1118,9 +1080,7 @@ static int rcar_pcie_probe(struct platform_device *pdev)
pcie->dev = dev;
- INIT_LIST_HEAD(&pcie->resources);
-
- err = rcar_pcie_parse_request_of_pci_ranges(pcie);
+ err = pci_parse_request_of_pci_ranges(dev, &pcie->resources, NULL);
if (err)
goto err_free_bridge;
--
2.8.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] PCI: rcar: Reuse generic pci_parse_request_of_pci_ranges() function
2018-04-25 15:21 [PATCH] PCI: rcar: Reuse generic pci_parse_request_of_pci_ranges() function Vladimir Zapolskiy
@ 2018-04-26 7:43 ` Simon Horman
2018-04-26 8:07 ` Geert Uytterhoeven
2018-05-08 11:23 ` Lorenzo Pieralisi
2 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2018-04-26 7:43 UTC (permalink / raw)
To: Vladimir Zapolskiy; +Cc: Bjorn Helgaas, linux-pci, linux-renesas-soc
On Wed, Apr 25, 2018 at 06:21:25PM +0300, Vladimir Zapolskiy wrote:
> The non-functional change removes a custom function to parse and
> allocate PCI resources in favour of pci_parse_request_of_pci_ranges().
>
> Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] PCI: rcar: Reuse generic pci_parse_request_of_pci_ranges() function
2018-04-25 15:21 [PATCH] PCI: rcar: Reuse generic pci_parse_request_of_pci_ranges() function Vladimir Zapolskiy
2018-04-26 7:43 ` Simon Horman
@ 2018-04-26 8:07 ` Geert Uytterhoeven
2018-05-08 11:23 ` Lorenzo Pieralisi
2 siblings, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2018-04-26 8:07 UTC (permalink / raw)
To: Vladimir Zapolskiy; +Cc: Simon Horman, Bjorn Helgaas, linux-pci, Linux-Renesas
On Wed, Apr 25, 2018 at 5:21 PM, Vladimir Zapolskiy
<vladimir_zapolskiy@mentor.com> wrote:
> The non-functional change removes a custom function to parse and
> allocate PCI resources in favour of pci_parse_request_of_pci_ranges().
>
> Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] PCI: rcar: Reuse generic pci_parse_request_of_pci_ranges() function
2018-04-25 15:21 [PATCH] PCI: rcar: Reuse generic pci_parse_request_of_pci_ranges() function Vladimir Zapolskiy
2018-04-26 7:43 ` Simon Horman
2018-04-26 8:07 ` Geert Uytterhoeven
@ 2018-05-08 11:23 ` Lorenzo Pieralisi
2 siblings, 0 replies; 4+ messages in thread
From: Lorenzo Pieralisi @ 2018-05-08 11:23 UTC (permalink / raw)
To: Vladimir Zapolskiy
Cc: Simon Horman, Bjorn Helgaas, linux-pci, linux-renesas-soc
On Wed, Apr 25, 2018 at 06:21:25PM +0300, Vladimir Zapolskiy wrote:
> The non-functional change removes a custom function to parse and
> allocate PCI resources in favour of pci_parse_request_of_pci_ranges().
>
> Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
> ---
> drivers/pci/host/pcie-rcar.c | 42 +-----------------------------------------
> 1 file changed, 1 insertion(+), 41 deletions(-)
>
> diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c
> index 6ab28f29ac6a..66863b587380 100644
> --- a/drivers/pci/host/pcie-rcar.c
> +++ b/drivers/pci/host/pcie-rcar.c
> @@ -1063,44 +1063,6 @@ static const struct of_device_id rcar_pcie_of_match[] = {
> {},
> };
Applied to pci/rcar for v4.18, thanks.
Lorenzo
> -static int rcar_pcie_parse_request_of_pci_ranges(struct rcar_pcie *pci)
> -{
> - int err;
> - struct device *dev = pci->dev;
> - struct device_node *np = dev->of_node;
> - resource_size_t iobase;
> - struct resource_entry *win, *tmp;
> -
> - err = of_pci_get_host_bridge_resources(np, 0, 0xff, &pci->resources,
> - &iobase);
> - if (err)
> - return err;
> -
> - err = devm_request_pci_bus_resources(dev, &pci->resources);
> - if (err)
> - goto out_release_res;
> -
> - resource_list_for_each_entry_safe(win, tmp, &pci->resources) {
> - struct resource *res = win->res;
> -
> - if (resource_type(res) == IORESOURCE_IO) {
> - err = pci_remap_iospace(res, iobase);
> - if (err) {
> - dev_warn(dev, "error %d: failed to map resource %pR\n",
> - err, res);
> -
> - resource_list_destroy_entry(win);
> - }
> - }
> - }
> -
> - return 0;
> -
> -out_release_res:
> - pci_free_resource_list(&pci->resources);
> - return err;
> -}
> -
> static int rcar_pcie_probe(struct platform_device *pdev)
> {
> struct device *dev = &pdev->dev;
> @@ -1118,9 +1080,7 @@ static int rcar_pcie_probe(struct platform_device *pdev)
>
> pcie->dev = dev;
>
> - INIT_LIST_HEAD(&pcie->resources);
> -
> - err = rcar_pcie_parse_request_of_pci_ranges(pcie);
> + err = pci_parse_request_of_pci_ranges(dev, &pcie->resources, NULL);
> if (err)
> goto err_free_bridge;
>
> --
> 2.8.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-05-08 11:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-25 15:21 [PATCH] PCI: rcar: Reuse generic pci_parse_request_of_pci_ranges() function Vladimir Zapolskiy
2018-04-26 7:43 ` Simon Horman
2018-04-26 8:07 ` Geert Uytterhoeven
2018-05-08 11:23 ` Lorenzo Pieralisi
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.