aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-txx9.c
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2014-02-26 10:35:09 +0900
committerMark Brown <broonie@linaro.org>2014-02-28 15:17:52 +0900
commit7bdadd8d94a203c0bf02c0f128148e8be3e7f66a (patch)
tree628775161bc53a33acf0062f941e58ec8745e413 /drivers/spi/spi-txx9.c
parentspi: txx9: Convert to let spi core handle checking transfer speed (diff)
downloadlinux-dev-7bdadd8d94a203c0bf02c0f128148e8be3e7f66a.tar.xz
linux-dev-7bdadd8d94a203c0bf02c0f128148e8be3e7f66a.zip
spi: txx9: Use devm_ioremap_resource()
Use devm_ioremap_resource() in order to make the code simpler, and remove redundant return value check of platform_get_resource() because the value is checked by devm_ioremap_resource(). Signed-off-by: Jingoo Han <jg1.han@samsung.com> Reviewed-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/spi/spi-txx9.c')
-rw-r--r--drivers/spi/spi-txx9.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/spi/spi-txx9.c b/drivers/spi/spi-txx9.c
index 523f13df52bb..5cfaafc368fc 100644
--- a/drivers/spi/spi-txx9.c
+++ b/drivers/spi/spi-txx9.c
@@ -358,13 +358,8 @@ static int txx9spi_probe(struct platform_device *dev)
master->max_speed_hz = c->baseclk / (SPI_MIN_DIVIDER + 1);
res = platform_get_resource(dev, IORESOURCE_MEM, 0);
- if (!res)
- goto exit_busy;
- if (!devm_request_mem_region(&dev->dev, res->start, resource_size(res),
- "spi_txx9"))
- goto exit_busy;
- c->membase = devm_ioremap(&dev->dev, res->start, resource_size(res));
- if (!c->membase)
+ c->membase = devm_ioremap_resource(&dev->dev, res);
+ if (IS_ERR(c->membase))
goto exit_busy;
/* enter config mode */