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>
This commit is contained in:
Axel Lin 2019-09-25 18:12:56 +08:00 committed by Mark Brown
parent 2e36e140b8
commit 41145b980e
No known key found for this signature in database
GPG key ID: 24D68B725D5487D0

View file

@ -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);