Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1258706 > unrolled thread
| Started by | Sanjeev Sharma <sanjeev_sharma@mentor.com> |
|---|---|
| First post | 2015-10-29 11:10 +0100 |
| Last post | 2015-10-30 16:30 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] hsi: controllers:remove redundant code Sanjeev Sharma <sanjeev_sharma@mentor.com> - 2015-10-29 11:10 +0100
Re: [PATCH] hsi: controllers:remove redundant code Sebastian Reichel <sre@kernel.org> - 2015-10-30 16:30 +0100
| From | Sanjeev Sharma <sanjeev_sharma@mentor.com> |
|---|---|
| Date | 2015-10-29 11:10 +0100 |
| Subject | [PATCH] hsi: controllers:remove redundant code |
| Message-ID | <qoSjD-7gc-1@gated-at.bofh.it> |
Use devm_ioremap_resource() in order to make the code simpler,
and remove redundant return value check of platform_get_resource()
because this value is alreadytaken care by devm_ioremap_resource()
Signed-off-by: Sanjeev Sharma <sanjeev_sharma@mentor.com>
---
drivers/hsi/controllers/omap_ssi.c | 21 ++++-----------------
1 file changed, 4 insertions(+), 17 deletions(-)
diff --git a/drivers/hsi/controllers/omap_ssi.c b/drivers/hsi/controllers/omap_ssi.c
index 089c6c3..f6d3100 100644
--- a/drivers/hsi/controllers/omap_ssi.c
+++ b/drivers/hsi/controllers/omap_ssi.c
@@ -295,27 +295,14 @@ static int __init ssi_get_iomem(struct platform_device *pd,
const char *name, void __iomem **pbase, dma_addr_t *phy)
{
struct resource *mem;
- struct resource *ioarea;
void __iomem *base;
struct hsi_controller *ssi = platform_get_drvdata(pd);
mem = platform_get_resource_byname(pd, IORESOURCE_MEM, name);
- if (!mem) {
- dev_err(&pd->dev, "IO memory region missing (%s)\n", name);
- return -ENXIO;
- }
- ioarea = devm_request_mem_region(&ssi->device, mem->start,
- resource_size(mem), dev_name(&pd->dev));
- if (!ioarea) {
- dev_err(&pd->dev, "%s IO memory region request failed\n",
- mem->name);
- return -ENXIO;
- }
- base = devm_ioremap(&ssi->device, mem->start, resource_size(mem));
- if (!base) {
- dev_err(&pd->dev, "%s IO remap failed\n", mem->name);
- return -ENXIO;
- }
+ base = devm_ioremap_resource(&ssi->device, mem);
+ if (IS_ERR(base))
+ return PTR_ERR(base);
+
*pbase = base;
if (phy)
--
1.7.11.7
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Sebastian Reichel <sre@kernel.org> |
|---|---|
| Date | 2015-10-30 16:30 +0100 |
| Message-ID | <qpjMS-7uG-7@gated-at.bofh.it> |
| In reply to | #1258706 |
[Multipart message — attachments visible in raw view] — view raw
Hi, On Thu, Oct 29, 2015 at 03:34:55PM +0530, Sanjeev Sharma wrote: > Use devm_ioremap_resource() in order to make the code simpler, > and remove redundant return value check of platform_get_resource() > because this value is alreadytaken care by devm_ioremap_resource() Thanks, queued. -- Sebastian
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web