diff options
| author | Jisheng Zhang <jszhang@marvell.com> | 2015-04-03 09:17:05 -0400 |
|---|---|---|
| committer | Bjorn Helgaas <bhelgaas@google.com> | 2015-04-09 15:27:06 -0400 |
| commit | 873581698d391ff070fc1eb8fb298c85e873c07c (patch) | |
| tree | f81737ee89b76d564a316d7be9df0d5865946081 /drivers/pci/host/pci-versatile.c | |
| parent | c517d838eb7d07bbe9507871fab3931deccff539 (diff) | |
PCI: versatile: Check for devm_ioremap_resource() failures
Check for failure of devm_ioremap_resource().
devm_ioremap_resource() validates the resource it receives, so if we check
for devm_ioremap_resource() failure, we need not check for failure of the
preceding platform_get_resource().
[bhelgaas: changelog]
Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/host/pci-versatile.c')
| -rw-r--r-- | drivers/pci/host/pci-versatile.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/pci/host/pci-versatile.c b/drivers/pci/host/pci-versatile.c index 1ec694a52379..b1caaea740fe 100644 --- a/drivers/pci/host/pci-versatile.c +++ b/drivers/pci/host/pci-versatile.c | |||
| @@ -138,19 +138,19 @@ static int versatile_pci_probe(struct platform_device *pdev) | |||
| 138 | LIST_HEAD(pci_res); | 138 | LIST_HEAD(pci_res); |
| 139 | 139 | ||
| 140 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 140 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| 141 | if (!res) | ||
| 142 | return -ENODEV; | ||
| 143 | versatile_pci_base = devm_ioremap_resource(&pdev->dev, res); | 141 | versatile_pci_base = devm_ioremap_resource(&pdev->dev, res); |
| 142 | if (IS_ERR(versatile_pci_base)) | ||
| 143 | return PTR_ERR(versatile_pci_base); | ||
| 144 | 144 | ||
| 145 | res = platform_get_resource(pdev, IORESOURCE_MEM, 1); | 145 | res = platform_get_resource(pdev, IORESOURCE_MEM, 1); |
| 146 | if (!res) | ||
| 147 | return -ENODEV; | ||
| 148 | versatile_cfg_base[0] = devm_ioremap_resource(&pdev->dev, res); | 146 | versatile_cfg_base[0] = devm_ioremap_resource(&pdev->dev, res); |
| 147 | if (IS_ERR(versatile_cfg_base[0])) | ||
| 148 | return PTR_ERR(versatile_cfg_base[0]); | ||
| 149 | 149 | ||
| 150 | res = platform_get_resource(pdev, IORESOURCE_MEM, 2); | 150 | res = platform_get_resource(pdev, IORESOURCE_MEM, 2); |
| 151 | if (!res) | ||
| 152 | return -ENODEV; | ||
| 153 | versatile_cfg_base[1] = devm_ioremap_resource(&pdev->dev, res); | 151 | versatile_cfg_base[1] = devm_ioremap_resource(&pdev->dev, res); |
| 152 | if (IS_ERR(versatile_cfg_base[1])) | ||
| 153 | return PTR_ERR(versatile_cfg_base[1]); | ||
| 154 | 154 | ||
| 155 | ret = versatile_pci_parse_request_of_pci_ranges(&pdev->dev, &pci_res); | 155 | ret = versatile_pci_parse_request_of_pci_ranges(&pdev->dev, &pci_res); |
| 156 | if (ret) | 156 | if (ret) |
