* [PATCH] ARM: pxa: ssp: Use devm_ioremap_resource instead of devm_ioremap
@ 2015-06-08 8:53 Firo Yang
2015-06-08 9:01 ` Julia Lawall
0 siblings, 1 reply; 2+ messages in thread
From: Firo Yang @ 2015-06-08 8:53 UTC (permalink / raw)
To: linux-arm-kernel
Using devm_ioremap_resource() API to simplify the code.
Signed-off-by: Firo Yang <firogm@gmail.com>
---
According to Julia's advices:
The patch "[PATCH v2] ARM: pxa: ssp: remove unnessary free for devm_xxx"
submited by Firo Yang should be discard. It was obsoleted by
"[PATCH] ARM: pxa: ssp: remove unnessary free for devm_xxx"
and
"[PATCH] ARM: pxa: ssp: Use devm_ioremap_resource instead of devm_ioremap"
I am not sure whether it was clear. If there is any doubt, please
email me.
arch/arm/plat-pxa/ssp.c | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/arch/arm/plat-pxa/ssp.c b/arch/arm/plat-pxa/ssp.c
index ad9529c..8fd5245 100644
--- a/arch/arm/plat-pxa/ssp.c
+++ b/arch/arm/plat-pxa/ssp.c
@@ -182,21 +182,12 @@ static int pxa_ssp_probe(struct platform_device *pdev)
return -ENODEV;
}
- res = devm_request_mem_region(dev, res->start, resource_size(res),
- pdev->name);
- if (res = NULL) {
- dev_err(dev, "failed to request memory resource\n");
- return -EBUSY;
- }
+ ssp->mmio_base = devm_ioremap_resource(dev, res);
+ if (IS_ERR(ssp->mmio_base))
+ return PTR_ERR(ssp->mmio_base);
ssp->phys_base = res->start;
- ssp->mmio_base = devm_ioremap(dev, res->start, resource_size(res));
- if (ssp->mmio_base = NULL) {
- dev_err(dev, "failed to ioremap() registers\n");
- return -ENODEV;
- }
-
ssp->irq = platform_get_irq(pdev, 0);
if (ssp->irq < 0) {
dev_err(dev, "no IRQ resource defined\n");
--
2.4.2
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] ARM: pxa: ssp: Use devm_ioremap_resource instead of devm_ioremap
2015-06-08 8:53 [PATCH] ARM: pxa: ssp: Use devm_ioremap_resource instead of devm_ioremap Firo Yang
@ 2015-06-08 9:01 ` Julia Lawall
0 siblings, 0 replies; 2+ messages in thread
From: Julia Lawall @ 2015-06-08 9:01 UTC (permalink / raw)
To: linux-arm-kernel
> @@ -182,21 +182,12 @@ static int pxa_ssp_probe(struct platform_device *pdev)
> return -ENODEV;
> }
Actually, the code up here is a check that res is not null. You can drop
that as well. devm_ioremap_resource checks the same thing.
julia
>
> - res = devm_request_mem_region(dev, res->start, resource_size(res),
> - pdev->name);
> - if (res = NULL) {
> - dev_err(dev, "failed to request memory resource\n");
> - return -EBUSY;
> - }
> + ssp->mmio_base = devm_ioremap_resource(dev, res);
> + if (IS_ERR(ssp->mmio_base))
> + return PTR_ERR(ssp->mmio_base);
>
> ssp->phys_base = res->start;
>
> - ssp->mmio_base = devm_ioremap(dev, res->start, resource_size(res));
> - if (ssp->mmio_base = NULL) {
> - dev_err(dev, "failed to ioremap() registers\n");
> - return -ENODEV;
> - }
> -
> ssp->irq = platform_get_irq(pdev, 0);
> if (ssp->irq < 0) {
> dev_err(dev, "no IRQ resource defined\n");
> --
> 2.4.2
>
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-06-08 9:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-08 8:53 [PATCH] ARM: pxa: ssp: Use devm_ioremap_resource instead of devm_ioremap Firo Yang
2015-06-08 9:01 ` Julia Lawall
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox