Commit 41145b98 authored by Axel Lin's avatar Axel Lin Committed by Mark Brown

regulator: pbias: Use of_device_get_match_data

Use of_device_get_match_data to simplify the code a bit.
Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
Link: https://lore.kernel.org/r/20190925101256.19030-1-axel.lin@ingics.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 2e36e140
...@@ -164,7 +164,6 @@ static int pbias_regulator_probe(struct platform_device *pdev) ...@@ -164,7 +164,6 @@ static int pbias_regulator_probe(struct platform_device *pdev)
const struct pbias_reg_info *info; const struct pbias_reg_info *info;
int ret = 0; int ret = 0;
int count, idx, data_idx = 0; int count, idx, data_idx = 0;
const struct of_device_id *match;
const struct pbias_of_data *data; const struct pbias_of_data *data;
unsigned int offset; unsigned int offset;
...@@ -183,9 +182,8 @@ static int pbias_regulator_probe(struct platform_device *pdev) ...@@ -183,9 +182,8 @@ static int pbias_regulator_probe(struct platform_device *pdev)
if (IS_ERR(syscon)) if (IS_ERR(syscon))
return PTR_ERR(syscon); return PTR_ERR(syscon);
match = of_match_device(of_match_ptr(pbias_of_match), &pdev->dev); data = of_device_get_match_data(&pdev->dev);
if (match && match->data) { if (data) {
data = match->data;
offset = data->offset; offset = data->offset;
} else { } else {
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment