diff mbox

spi: txx9: Use devm_ioremap_resource()

Message ID 003b01cf3292$fc72f500$f558df00$%han@samsung.com (mailing list archive)
State Accepted
Commit 7bdadd8d94a203c0bf02c0f128148e8be3e7f66a
Headers show

Commit Message

Jingoo Han Feb. 26, 2014, 1:35 a.m. UTC
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>
---
 drivers/spi/spi-txx9.c |    9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

Comments

Atsushi Nemoto Feb. 27, 2014, 1:44 p.m. UTC | #1
On Wed, 26 Feb 2014 10:35:09 +0900, Jingoo Han <jg1.han@samsung.com> wrote:
> 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>
> ---
>  drivers/spi/spi-txx9.c |    9 ++-------
>  1 file changed, 2 insertions(+), 7 deletions(-)

Thank you.  It looks good for me.

Reviewed-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Mark Brown Feb. 28, 2014, 6:18 a.m. UTC | #2
On Wed, Feb 26, 2014 at 10:35:09AM +0900, Jingoo Han wrote:
> 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().

Applied, thanks.
diff mbox

Patch

diff --git a/drivers/spi/spi-txx9.c b/drivers/spi/spi-txx9.c
index 523f13d..5cfaafc 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 */