| To: | linux-mips@linux-mips.org |
|---|---|
| Subject: | [PATCH v3] pci: convert to devm_ioremap_resource() |
| From: | Silviu-Mihai Popescu <silviupopescu1990@gmail.com> |
| Date: | Tue, 12 Mar 2013 13:30:05 +0200 |
| Cc: | ralf@linux-mips.org, juhosg@openwrt.org, blogic@openwrt.org, kaloz@openwrt.org, xsecute@googlemail.com, linux-kernel@vger.kernel.org, Silviu-Mihai Popescu <silviupopescu1990@gmail.com> |
| Dkim-signature: | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=qsVUoG39MEaSvhZBoac1nGYwEvId4xe7GR4aPK7BXzg=; b=J3MPsxV9mg6jrLX2SMQh7HA9Zc7Hj/V6vo9/0QO6OSwyMmZo3RquI559EVoP4YYm8x HQFVdW+iH0qziZrQCpsI9QsoGqNaT/9e4uqYavOyUVqXVNwKrK3EaBMKBIbHVAR9L7Vj gWozHkI69AdGk3m6+BOoqtVDSoTCBpedJ43mTBLFdRFVabJ5uVrRYaBh3R29pX1kjy6q yjGAJhpUHY+HouuOXLEll6IkXATT6JSSh0HA1q6L9I6WrIPyAkfXZSt41CZDdJFBWf/g UQGpZKw/iNzAsLn65AguaGtWdGz3CTzpAS/bJCb8AMTLYBgCH1Vqofyny3o0iVJg/k6w Zeyw== |
| List-archive: | <http://www.linux-mips.org/archives/linux-mips/> |
| List-help: | <mailto:ecartis@linux-mips.org?Subject=help> |
| List-id: | linux-mips <linux-mips.eddie.linux-mips.org> |
| List-owner: | <mailto:ralf@linux-mips.org> |
| List-post: | <mailto:linux-mips@linux-mips.org> |
| List-software: | Ecartis version 1.0.0 |
| List-subscribe: | <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips> |
| List-unsubscribe: | <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips> |
| Sender: | linux-mips-bounce@linux-mips.org |
Convert all uses of devm_request_and_ioremap() to the newly introduced
devm_ioremap_resource() which provides more consistent error handling.
Signed-off-by: Silviu-Mihai Popescu <silviupopescu1990@gmail.com>
---
arch/mips/pci/pci-ar71xx.c | 6 +++---
arch/mips/pci/pci-ar724x.c | 18 +++++++++---------
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/arch/mips/pci/pci-ar71xx.c b/arch/mips/pci/pci-ar71xx.c
index 412ec02..18517dd 100644
--- a/arch/mips/pci/pci-ar71xx.c
+++ b/arch/mips/pci/pci-ar71xx.c
@@ -366,9 +366,9 @@ static int ar71xx_pci_probe(struct platform_device *pdev)
if (!res)
return -EINVAL;
- apc->cfg_base = devm_request_and_ioremap(&pdev->dev, res);
- if (!apc->cfg_base)
- return -ENOMEM;
+ apc->cfg_base = devm_ioremap_resource(&pdev->dev, res);
+ if (IS_ERR(apc->cfg_base))
+ return PTR_ERR(apc->cfg_base);
apc->irq = platform_get_irq(pdev, 0);
if (apc->irq < 0)
diff --git a/arch/mips/pci/pci-ar724x.c b/arch/mips/pci/pci-ar724x.c
index 8a0700d..65ec032 100644
--- a/arch/mips/pci/pci-ar724x.c
+++ b/arch/mips/pci/pci-ar724x.c
@@ -365,25 +365,25 @@ static int ar724x_pci_probe(struct platform_device *pdev)
if (!res)
return -EINVAL;
- apc->ctrl_base = devm_request_and_ioremap(&pdev->dev, res);
- if (apc->ctrl_base == NULL)
- return -EBUSY;
+ apc->ctrl_base = devm_ioremap_resource(&pdev->dev, res);
+ if (IS_ERR(apc->ctrl_base))
+ return PTR_ERR(apc->ctrl_base);
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cfg_base");
if (!res)
return -EINVAL;
- apc->devcfg_base = devm_request_and_ioremap(&pdev->dev, res);
- if (!apc->devcfg_base)
- return -EBUSY;
+ apc->devcfg_base = devm_ioremap_resource(&pdev->dev, res);
+ if (IS_ERR(apc->devcfg_base))
+ return PTR_ERR(apc->devcfg_base);
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "crp_base");
if (!res)
return -EINVAL;
- apc->crp_base = devm_request_and_ioremap(&pdev->dev, res);
- if (apc->crp_base == NULL)
- return -EBUSY;
+ apc->crp_base = devm_ioremap_resource(&pdev->dev, res);
+ if (IS_ERR(apc->crp_base))
+ return PTR_ERR(apc->crp_base);
apc->irq = platform_get_irq(pdev, 0);
if (apc->irq < 0)
--
1.7.9.5
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: [PATCH v2] pci: convert to devm_ioremap_resource(), Sergei Shtylyov |
|---|---|
| Next by Date: | Re: [PATCH v2] pci: convert to devm_ioremap_resource(), Silviu Popescu |
| Previous by Thread: | Re: [PATCH V2 01/14] MIPS: Build uasm-generated code only once to avoid CPU Hotplug problem, 陈华才 |
| Next by Thread: | Re: [PATCH] MIPS: Fix logic errors in bitops.c, Ralf Baechle |
| Indexes: | [Date] [Thread] [Top] [All Lists] |