* [PATCH] pci: convert to devm_ioremap_resource()
@ 2013-03-11 7:42 Silviu-Mihai Popescu
2013-03-11 10:00 ` Gabor Juhos
0 siblings, 1 reply; 4+ messages in thread
From: Silviu-Mihai Popescu @ 2013-03-11 7:42 UTC (permalink / raw)
To: linux-mips
Cc: ralf, juhosg, blogic, xsecute, linux-kernel, Silviu-Mihai Popescu
Convert all uses of devm_request_and_ioremap() to the newly introduced
devm_ioremap_resource() which provides more consistent error handling.
devm_ioremap_resource() provides its own error messages so all explicit
error messages can be removed from the failure code paths.
Signed-off-by: Silviu-Mihai Popescu <silviupopescu1990@gmail.com>
---
arch/mips/pci/pci-ar724x.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] pci: convert to devm_ioremap_resource()
2013-03-11 7:42 [PATCH] pci: convert to devm_ioremap_resource() Silviu-Mihai Popescu
@ 2013-03-11 10:00 ` Gabor Juhos
2013-03-11 9:58 ` John Crispin
0 siblings, 1 reply; 4+ messages in thread
From: Gabor Juhos @ 2013-03-11 10:00 UTC (permalink / raw)
To: Silviu-Mihai Popescu; +Cc: linux-mips, ralf, blogic, xsecute, linux-kernel
2013.03.11. 8:42 keltezéssel, Silviu-Mihai Popescu írta:
> Convert all uses of devm_request_and_ioremap() to the newly introduced
> devm_ioremap_resource() which provides more consistent error handling.
>
> devm_ioremap_resource() provides its own error messages so all explicit
> error messages can be removed from the failure code paths.
>
> Signed-off-by: Silviu-Mihai Popescu <silviupopescu1990@gmail.com>
> ---
> arch/mips/pci/pci-ar724x.c | 18 +++++++++---------
> 1 file changed, 9 insertions(+), 9 deletions(-)
Acked-by: Gabor Juhos <juhosg@openwrt.org>
Just a minor note, arch/mips/pci/pci-ar71xx.c should be fixed as well probably.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] pci: convert to devm_ioremap_resource()
2013-03-11 10:00 ` Gabor Juhos
@ 2013-03-11 9:58 ` John Crispin
2013-03-11 10:14 ` Gabor Juhos
0 siblings, 1 reply; 4+ messages in thread
From: John Crispin @ 2013-03-11 9:58 UTC (permalink / raw)
To: linux-mips
On 11/03/13 11:00, Gabor Juhos wrote:
> 2013.03.11. 8:42 keltezéssel, Silviu-Mihai Popescu írta:
>> Convert all uses of devm_request_and_ioremap() to the newly introduced
>> devm_ioremap_resource() which provides more consistent error handling.
>>
>> devm_ioremap_resource() provides its own error messages so all explicit
>> error messages can be removed from the failure code paths.
>>
>> Signed-off-by: Silviu-Mihai Popescu<silviupopescu1990@gmail.com>
>> ---
>> arch/mips/pci/pci-ar724x.c | 18 +++++++++---------
>> 1 file changed, 9 insertions(+), 9 deletions(-)
>
> Acked-by: Gabor Juhos<juhosg@openwrt.org>
>
> Just a minor note, arch/mips/pci/pci-ar71xx.c should be fixed as well probably.
>
>
Hi,
is this patch supposed to go upstream via linux-mips.org ?
John
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] pci: convert to devm_ioremap_resource()
2013-03-11 9:58 ` John Crispin
@ 2013-03-11 10:14 ` Gabor Juhos
0 siblings, 0 replies; 4+ messages in thread
From: Gabor Juhos @ 2013-03-11 10:14 UTC (permalink / raw)
To: John Crispin; +Cc: linux-mips
2013.03.11. 10:58 keltezéssel, John Crispin írta:
> On 11/03/13 11:00, Gabor Juhos wrote:
>> 2013.03.11. 8:42 keltezéssel, Silviu-Mihai Popescu írta:
>>> Convert all uses of devm_request_and_ioremap() to the newly introduced
>>> devm_ioremap_resource() which provides more consistent error handling.
>>>
>>> devm_ioremap_resource() provides its own error messages so all explicit
>>> error messages can be removed from the failure code paths.
>>>
>>> Signed-off-by: Silviu-Mihai Popescu<silviupopescu1990@gmail.com>
>>> ---
>>> arch/mips/pci/pci-ar724x.c | 18 +++++++++---------
>>> 1 file changed, 9 insertions(+), 9 deletions(-)
>>
>> Acked-by: Gabor Juhos<juhosg@openwrt.org>
>>
>> Just a minor note, arch/mips/pci/pci-ar71xx.c should be fixed as well probably.
>>
>>
>
>
> Hi,
>
> is this patch supposed to go upstream via linux-mips.org ?
Yes, IMHO.
-Gabor
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-03-11 10:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-11 7:42 [PATCH] pci: convert to devm_ioremap_resource() Silviu-Mihai Popescu
2013-03-11 10:00 ` Gabor Juhos
2013-03-11 9:58 ` John Crispin
2013-03-11 10:14 ` Gabor Juhos
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.