Skip to contentSkip to conversation

crypto: talitos - Use devm_platform_ioremap_resource()

PATCH Superseded Fabio Estevam 1 participant 1 message Jun 6, 2019 Crypto API

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: talitos - Use devm_platform_ioremap_resource()

Use devm_platform_ioremap_resource() to simplify the code a bit.

---
 drivers/crypto/talitos.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/crypto/talitos.c +1 -5
index 32a7e747dc5f..f2269a2f8ce6 100644
@@ -3336,7 +3336,6 @@ static int talitos_probe(struct platform_device *ofdev)
 	struct talitos_private *priv;
 	int i, err;
 	int stride;
-	struct resource *res;
 
 	priv = devm_kzalloc(dev, sizeof(struct talitos_private), GFP_KERNEL);
 	if (!priv)
@@ -3350,10 +3349,7 @@ static int talitos_probe(struct platform_device *ofdev)
 
 	spin_lock_init(&priv->reg_lock);
 
-	res = platform_get_resource(ofdev, IORESOURCE_MEM, 0);
-	if (!res)
-		return -ENXIO;
-	priv->reg = devm_ioremap(dev, res->start, resource_size(res));
+	priv->reg = devm_platform_ioremap_resource(ofdev, 0);
 	if (!priv->reg) {
 		dev_err(dev, "failed to of_iomap\n");
 		err = -ENOMEM;
Signature · 1 line
2.17.1