* [PATCH] regulator: twl6030: Use of_device_get_match_data()
@ 2019-01-09 9:30 Axel Lin
0 siblings, 0 replies; only message in thread
From: Axel Lin @ 2019-01-09 9:30 UTC (permalink / raw)
To: Mark Brown; +Cc: Tony Lindgren, Liam Girdwood, linux-kernel, Axel Lin
Use of_device_get_match_data() to simplify the code a bit.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
drivers/regulator/twl6030-regulator.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/regulator/twl6030-regulator.c b/drivers/regulator/twl6030-regulator.c
index 219cbd910dbf..78b964539775 100644
--- a/drivers/regulator/twl6030-regulator.c
+++ b/drivers/regulator/twl6030-regulator.c
@@ -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;
--
2.17.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2019-01-09 9:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-09 9:30 [PATCH] regulator: twl6030: Use of_device_get_match_data() Axel Lin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.