summaryrefslogtreecommitdiffstats
path: root/drivers/hsi
diff options
context:
space:
mode:
authorSanjeev Sharma <sanjeev_sharma@mentor.com>2015-10-29 15:34:55 +0530
committerSebastian Reichel <sre@kernel.org>2015-10-30 16:10:40 +0100
commit16bd5865cdb3b190105db21bd22a0ca0501e7b20 (patch)
tree6b207e90f26402a3f705eb8079ce3b3b92c5770e /drivers/hsi
parentd2c85ac24ed7636934f469fac8836b87c7e6cb40 (diff)
downloadlinux-16bd5865cdb3b190105db21bd22a0ca0501e7b20.tar.bz2
hsi: controllers:remove redundant code
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> Signed-off-by: Sebastian Reichel <sre@kernel.org>
Diffstat (limited to 'drivers/hsi')
-rw-r--r--drivers/hsi/controllers/omap_ssi.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/drivers/hsi/controllers/omap_ssi.c b/drivers/hsi/controllers/omap_ssi.c
index 089c6c3feb3e..f6d3100b7a32 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)