regulator: twl: Use of_device_get_match_data()
diff mbox series

Message ID 20190119124135.23902-1-axel.lin@ingics.com
State New
Headers show
Series
  • regulator: twl: Use of_device_get_match_data()
Related show

Commit Message

Axel Lin Jan. 19, 2019, 12:41 p.m. UTC
Use of_device_get_match_data() to simplify the code a bit.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/regulator/twl-regulator.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

Patch
diff mbox series

diff --git a/drivers/regulator/twl-regulator.c b/drivers/regulator/twl-regulator.c
index 884c7505ed91..402ea43c77d1 100644
--- a/drivers/regulator/twl-regulator.c
+++ b/drivers/regulator/twl-regulator.c
@@ -576,14 +576,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;