Skip to content

Commit

Permalink
spi: txx9: Use devm_ioremap_resource()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jingoo Han authored and Mark Brown committed Feb 28, 2014
1 parent 425f96d commit 7bdadd8
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions drivers/spi/spi-txx9.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 7bdadd8

Please sign in to comment.