Skip to contentSkip to conversation

regulator: twl6030: Use of_device_get_match_data()

PATCH New Axel Lin 1 participant 1 message Jan 9, 2019

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 regulator: twl6030: Use of_device_get_match_data()

Use of_device_get_match_data() to simplify the code a bit.

---
 drivers/regulator/twl6030-regulator.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/regulator/twl6030-regulator.c +1 -6
index 219cbd910dbf..78b964539775 100644
@@ -687,14 +687,9 @@ static int twlreg_probe(struct platform_device *pdev)
 	struct regulator_init_data	*initdata;
 	struct regulation_constraints	*c;
 	struct regulator_dev		*rdev;
-	const struct of_device_id	*match;
 	struct regulator_config		config = { };
 
-	match = of_match_device(twl_of_match, &pdev->dev);
-	if (!match)
-		return -ENODEV;
-
-	template = match->data;
+	template = of_device_get_match_data(&pdev->dev);
 	if (!template)
 		return -ENODEV;
 
Signature · 1 line
2.17.1