Skip to content

Commit

Permalink
regulator: twl: Use of_device_get_match_data()
Browse files Browse the repository at this point in the history
Use of_device_get_match_data() to simplify the code a bit.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Axel Lin authored and Mark Brown committed Jan 22, 2019
1 parent 37b9ef9 commit 93997a0
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions drivers/regulator/twl-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 93997a0

Please sign in to comment.