* [PATCH] PCI: versatile: Add local struct device pointers
@ 2017-06-27 22:48 Bjorn Helgaas
2017-06-27 23:28 ` Bjorn Helgaas
0 siblings, 1 reply; 2+ messages in thread
From: Bjorn Helgaas @ 2017-06-27 22:48 UTC (permalink / raw)
To: Rob Herring; +Cc: linux-pci
Use a local "struct device *dev" for brevity and consistency with other
drivers. No functional change intended.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
drivers/pci/host/pci-versatile.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/pci/host/pci-versatile.c b/drivers/pci/host/pci-versatile.c
index f572c921cdd4..3de1e0a726db 100644
--- a/drivers/pci/host/pci-versatile.c
+++ b/drivers/pci/host/pci-versatile.c
@@ -120,6 +120,7 @@ static int versatile_pci_parse_request_of_pci_ranges(struct device *dev,
static int versatile_pci_probe(struct platform_device *pdev)
{
+ struct device *dev = &pdev->dev;
struct resource *res;
int ret, i, myslot = -1;
u32 val;
@@ -128,27 +129,26 @@ static int versatile_pci_probe(struct platform_device *pdev)
struct pci_host_bridge *bridge;
LIST_HEAD(pci_res);
- bridge = devm_pci_alloc_host_bridge(&pdev->dev, 0);
+ bridge = devm_pci_alloc_host_bridge(dev, 0);
if (!bridge)
return -ENOMEM;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- versatile_pci_base = devm_ioremap_resource(&pdev->dev, res);
+ versatile_pci_base = devm_ioremap_resource(dev, res);
if (IS_ERR(versatile_pci_base))
return PTR_ERR(versatile_pci_base);
res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
- versatile_cfg_base[0] = devm_ioremap_resource(&pdev->dev, res);
+ versatile_cfg_base[0] = devm_ioremap_resource(dev, res);
if (IS_ERR(versatile_cfg_base[0]))
return PTR_ERR(versatile_cfg_base[0]);
res = platform_get_resource(pdev, IORESOURCE_MEM, 2);
- versatile_cfg_base[1] = devm_pci_remap_cfg_resource(&pdev->dev,
- res);
+ versatile_cfg_base[1] = devm_pci_remap_cfg_resource(dev, res);
if (IS_ERR(versatile_cfg_base[1]))
return PTR_ERR(versatile_cfg_base[1]);
- ret = versatile_pci_parse_request_of_pci_ranges(&pdev->dev, &pci_res);
+ ret = versatile_pci_parse_request_of_pci_ranges(dev, &pci_res);
if (ret)
return ret;
@@ -164,7 +164,7 @@ static int versatile_pci_probe(struct platform_device *pdev)
}
}
if (myslot == -1) {
- dev_err(&pdev->dev, "Cannot find PCI core!\n");
+ dev_err(dev, "Cannot find PCI core!\n");
return -EIO;
}
/*
@@ -172,7 +172,7 @@ static int versatile_pci_probe(struct platform_device *pdev)
*/
pci_slot_ignore |= (1 << myslot);
- dev_info(&pdev->dev, "PCI core found (slot %d)\n", myslot);
+ dev_info(dev, "PCI core found (slot %d)\n", myslot);
writel(myslot, PCI_SELFID);
local_pci_cfg_base = versatile_cfg_base[1] + (myslot << 11);
@@ -205,7 +205,7 @@ static int versatile_pci_probe(struct platform_device *pdev)
pci_add_flags(PCI_REASSIGN_ALL_BUS | PCI_REASSIGN_ALL_RSRC);
list_splice_init(&pci_res, &bridge->windows);
- bridge->dev.parent = &pdev->dev;
+ bridge->dev.parent = dev;
bridge->sysdata = NULL;
bridge->busnr = 0;
bridge->ops = &pci_versatile_ops;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] PCI: versatile: Add local struct device pointers
2017-06-27 22:48 [PATCH] PCI: versatile: Add local struct device pointers Bjorn Helgaas
@ 2017-06-27 23:28 ` Bjorn Helgaas
0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Helgaas @ 2017-06-27 23:28 UTC (permalink / raw)
To: Bjorn Helgaas; +Cc: Rob Herring, linux-pci
On Tue, Jun 27, 2017 at 05:48:23PM -0500, Bjorn Helgaas wrote:
> Use a local "struct device *dev" for brevity and consistency with other
> drivers. No functional change intended.
>
> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
I applied this on the pci/versatile branch for v4.13.
> ---
> drivers/pci/host/pci-versatile.c | 18 +++++++++---------
> 1 file changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/pci/host/pci-versatile.c b/drivers/pci/host/pci-versatile.c
> index f572c921cdd4..3de1e0a726db 100644
> --- a/drivers/pci/host/pci-versatile.c
> +++ b/drivers/pci/host/pci-versatile.c
> @@ -120,6 +120,7 @@ static int versatile_pci_parse_request_of_pci_ranges(struct device *dev,
>
> static int versatile_pci_probe(struct platform_device *pdev)
> {
> + struct device *dev = &pdev->dev;
> struct resource *res;
> int ret, i, myslot = -1;
> u32 val;
> @@ -128,27 +129,26 @@ static int versatile_pci_probe(struct platform_device *pdev)
> struct pci_host_bridge *bridge;
> LIST_HEAD(pci_res);
>
> - bridge = devm_pci_alloc_host_bridge(&pdev->dev, 0);
> + bridge = devm_pci_alloc_host_bridge(dev, 0);
> if (!bridge)
> return -ENOMEM;
>
> res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - versatile_pci_base = devm_ioremap_resource(&pdev->dev, res);
> + versatile_pci_base = devm_ioremap_resource(dev, res);
> if (IS_ERR(versatile_pci_base))
> return PTR_ERR(versatile_pci_base);
>
> res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> - versatile_cfg_base[0] = devm_ioremap_resource(&pdev->dev, res);
> + versatile_cfg_base[0] = devm_ioremap_resource(dev, res);
> if (IS_ERR(versatile_cfg_base[0]))
> return PTR_ERR(versatile_cfg_base[0]);
>
> res = platform_get_resource(pdev, IORESOURCE_MEM, 2);
> - versatile_cfg_base[1] = devm_pci_remap_cfg_resource(&pdev->dev,
> - res);
> + versatile_cfg_base[1] = devm_pci_remap_cfg_resource(dev, res);
> if (IS_ERR(versatile_cfg_base[1]))
> return PTR_ERR(versatile_cfg_base[1]);
>
> - ret = versatile_pci_parse_request_of_pci_ranges(&pdev->dev, &pci_res);
> + ret = versatile_pci_parse_request_of_pci_ranges(dev, &pci_res);
> if (ret)
> return ret;
>
> @@ -164,7 +164,7 @@ static int versatile_pci_probe(struct platform_device *pdev)
> }
> }
> if (myslot == -1) {
> - dev_err(&pdev->dev, "Cannot find PCI core!\n");
> + dev_err(dev, "Cannot find PCI core!\n");
> return -EIO;
> }
> /*
> @@ -172,7 +172,7 @@ static int versatile_pci_probe(struct platform_device *pdev)
> */
> pci_slot_ignore |= (1 << myslot);
>
> - dev_info(&pdev->dev, "PCI core found (slot %d)\n", myslot);
> + dev_info(dev, "PCI core found (slot %d)\n", myslot);
>
> writel(myslot, PCI_SELFID);
> local_pci_cfg_base = versatile_cfg_base[1] + (myslot << 11);
> @@ -205,7 +205,7 @@ static int versatile_pci_probe(struct platform_device *pdev)
> pci_add_flags(PCI_REASSIGN_ALL_BUS | PCI_REASSIGN_ALL_RSRC);
>
> list_splice_init(&pci_res, &bridge->windows);
> - bridge->dev.parent = &pdev->dev;
> + bridge->dev.parent = dev;
> bridge->sysdata = NULL;
> bridge->busnr = 0;
> bridge->ops = &pci_versatile_ops;
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-06-27 23:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-27 22:48 [PATCH] PCI: versatile: Add local struct device pointers Bjorn Helgaas
2017-06-27 23:28 ` Bjorn Helgaas
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.