Skip to contentSkip to conversation

device-dax: simplify code in devm_register_dax_mapping

PATH -next [email protected] 1 participant 1 message Sep 17, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

From: William Dean <[email protected]>

It could directly return 'devm_add_action_or_reset' to simplify code.

---
 drivers/dax/bus.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/dax/bus.c +1 -4
index 1dad813ee4a6..251c53061764 100644
@@ -772,11 +772,8 @@ static int devm_register_dax_mapping(struct dev_dax *dev_dax, int range_id)
 		return rc;
 	}
 
-	rc = devm_add_action_or_reset(dax_region->dev, unregister_dax_mapping,
+	return devm_add_action_or_reset(dax_region->dev, unregister_dax_mapping,
 			dev);
-	if (rc)
-		return rc;
-	return 0;
 }
 
 static int alloc_dev_dax_range(struct dev_dax *dev_dax, u64 start,
Signature · 1 line
2.25.1