diff options
author | Axel Lin <axel.lin@ingics.com> | 2019-09-25 13:12:56 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-10-01 14:30:50 +0300 |
commit | 41145b980e3f4c7c26763fae0379f1cb8f336868 (patch) | |
tree | cef0ba27ac19252dc8f9290f80921bb9c805e2b9 /drivers/regulator/pbias-regulator.c | |
parent | 2e36e140b8b8de4023dd0b85e099567ee88cf872 (diff) | |
download | linux-41145b980e3f4c7c26763fae0379f1cb8f336868.tar.xz |
regulator: pbias: 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>
Link: https://lore.kernel.org/r/20190925101256.19030-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator/pbias-regulator.c')
-rw-r--r-- | drivers/regulator/pbias-regulator.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/regulator/pbias-regulator.c b/drivers/regulator/pbias-regulator.c index 92b41a6a4dc2..a59811060bdc 100644 --- a/drivers/regulator/pbias-regulator.c +++ b/drivers/regulator/pbias-regulator.c @@ -164,7 +164,6 @@ static int pbias_regulator_probe(struct platform_device *pdev) const struct pbias_reg_info *info; int ret = 0; int count, idx, data_idx = 0; - const struct of_device_id *match; const struct pbias_of_data *data; unsigned int offset; @@ -183,9 +182,8 @@ static int pbias_regulator_probe(struct platform_device *pdev) if (IS_ERR(syscon)) return PTR_ERR(syscon); - match = of_match_device(of_match_ptr(pbias_of_match), &pdev->dev); - if (match && match->data) { - data = match->data; + data = of_device_get_match_data(&pdev->dev); + if (data) { offset = data->offset; } else { res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |