All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] spi: txx9: Use devm_ioremap_resource()
@ 2014-02-26  1:35 Jingoo Han
       [not found] ` <003b01cf3292$fc72f500$f558df00$%han-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Jingoo Han @ 2014-02-26  1:35 UTC (permalink / raw)
  To: 'Mark Brown'
  Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA, 'Jingoo Han',
	'Atsushi Nemoto'

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-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
---
 drivers/spi/spi-txx9.c |    9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

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 */
-- 
1.7.10.4


--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-02-28  6:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-26  1:35 [PATCH] spi: txx9: Use devm_ioremap_resource() Jingoo Han
     [not found] ` <003b01cf3292$fc72f500$f558df00$%han-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-02-27 13:44   ` Atsushi Nemoto
2014-02-28  6:18   ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.