Skip to contentSkip to conversation

spi: txx9: Use devm_ioremap_resource()

PATCH Applied Jingoo Han 3 participants 3 messages Feb 26, 2014 – Feb 28, 2014 1 message not in the archive SPI

lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH 1/1 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().

---
 drivers/spi/spi-txx9.c |    9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/spi/spi-txx9.c +2 -7
index 523f13d..5cfaafc 100644
@@ -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 */
Signature · 7 lines
1.7.10.4


--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 003b01cf3292$fc72f500$f558df00$%[email protected]

Reviewed-by
#2 lore raw
Quoted 8 lines · Jingoo Han

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().

---
 drivers/spi/spi-txx9.c |    9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

Thank you. It looks good for me.

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

Applied
#3 lore raw
In reply to a message not in the archive
Quoted 3 lines · Jingoo Han

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.