diff options
author | Jingoo Han <jg1.han@samsung.com> | 2014-02-25 20:35:09 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-02-28 01:17:52 -0500 |
commit | 7bdadd8d94a203c0bf02c0f128148e8be3e7f66a (patch) | |
tree | 628775161bc53a33acf0062f941e58ec8745e413 /drivers/spi/spi-txx9.c | |
parent | 425f96d2f635d7a1a101c916830ba7843a6d5a50 (diff) |
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.c | 9 |
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) | |||
358 | master->max_speed_hz = c->baseclk / (SPI_MIN_DIVIDER + 1); | 358 | master->max_speed_hz = c->baseclk / (SPI_MIN_DIVIDER + 1); |
359 | 359 | ||
360 | res = platform_get_resource(dev, IORESOURCE_MEM, 0); | 360 | res = platform_get_resource(dev, IORESOURCE_MEM, 0); |
361 | if (!res) | 361 | c->membase = devm_ioremap_resource(&dev->dev, res); |
362 | goto exit_busy; | 362 | if (IS_ERR(c->membase)) |
363 | if (!devm_request_mem_region(&dev->dev, res->start, resource_size(res), | ||
364 | "spi_txx9")) | ||
365 | goto exit_busy; | ||
366 | c->membase = devm_ioremap(&dev->dev, res->start, resource_size(res)); | ||
367 | if (!c->membase) | ||
368 | goto exit_busy; | 363 | goto exit_busy; |
369 | 364 | ||
370 | /* enter config mode */ | 365 | /* enter config mode */ |