* dmaengine: sprd: Use devm_ioremap_resource() to map memory
@ 2018-05-09 3:23 ` Baolin Wang
0 siblings, 0 replies; 2+ messages in thread
From: Baolin Wang @ 2018-05-09 3:23 UTC (permalink / raw)
To: dan.j.williams, vinod.koul
Cc: broonie, lars, baolin.wang, dmaengine, linux-kernel
Instead of checking the return value of platform_get_resource(), we can
use devm_ioremap_resource() which has the NULL pointer check and the
momery region requesting.
Suggested-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
---
drivers/dma/sprd-dma.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c
index dba7a17..e715d07 100644
--- a/drivers/dma/sprd-dma.c
+++ b/drivers/dma/sprd-dma.c
@@ -807,10 +807,7 @@ static int sprd_dma_probe(struct platform_device *pdev)
}
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!res)
- return -EINVAL;
- sdev->glb_base = devm_ioremap_nocache(&pdev->dev, res->start,
- resource_size(res));
+ sdev->glb_base = devm_ioremap_resource(&pdev->dev, res);
if (!sdev->glb_base)
return -ENOMEM;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] dmaengine: sprd: Use devm_ioremap_resource() to map memory
@ 2018-05-09 3:23 ` Baolin Wang
0 siblings, 0 replies; 2+ messages in thread
From: Baolin Wang @ 2018-05-09 3:23 UTC (permalink / raw)
To: dan.j.williams, vinod.koul
Cc: broonie, lars, baolin.wang, dmaengine, linux-kernel
Instead of checking the return value of platform_get_resource(), we can
use devm_ioremap_resource() which has the NULL pointer check and the
momery region requesting.
Suggested-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
---
drivers/dma/sprd-dma.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c
index dba7a17..e715d07 100644
--- a/drivers/dma/sprd-dma.c
+++ b/drivers/dma/sprd-dma.c
@@ -807,10 +807,7 @@ static int sprd_dma_probe(struct platform_device *pdev)
}
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!res)
- return -EINVAL;
- sdev->glb_base = devm_ioremap_nocache(&pdev->dev, res->start,
- resource_size(res));
+ sdev->glb_base = devm_ioremap_resource(&pdev->dev, res);
if (!sdev->glb_base)
return -ENOMEM;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-05-09 3:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-09 3:23 dmaengine: sprd: Use devm_ioremap_resource() to map memory Baolin Wang
2018-05-09 3:23 ` [PATCH] " Baolin Wang
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.