regulator: twl6030: Use of_device_get_match_data()
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>
This commit is contained in:
parent
67cc7ca316
commit
7085180d6a
|
@ -687,14 +687,9 @@ static int twlreg_probe(struct platform_device *pdev)
|
||||||
struct regulator_init_data *initdata;
|
struct regulator_init_data *initdata;
|
||||||
struct regulation_constraints *c;
|
struct regulation_constraints *c;
|
||||||
struct regulator_dev *rdev;
|
struct regulator_dev *rdev;
|
||||||
const struct of_device_id *match;
|
|
||||||
struct regulator_config config = { };
|
struct regulator_config config = { };
|
||||||
|
|
||||||
match = of_match_device(twl_of_match, &pdev->dev);
|
template = of_device_get_match_data(&pdev->dev);
|
||||||
if (!match)
|
|
||||||
return -ENODEV;
|
|
||||||
|
|
||||||
template = match->data;
|
|
||||||
if (!template)
|
if (!template)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue