summaryrefslogtreecommitdiff
path: root/drivers/regulator/qcom_rpm-regulator.c
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2023-10-17 15:34:41 -0500
committerMark Brown <broonie@kernel.org>2023-10-17 21:38:48 +0100
commit8f7e17d847edf6bc02d0813b123b9d78ba504098 (patch)
tree120904e8da64019d8776c30c7c05959470e5e9b5 /drivers/regulator/qcom_rpm-regulator.c
parent46537a8676d6555141c4b98ec1bf5f3eea971128 (diff)
regulator: Use device_get_match_data()
Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20231017203442.2699322-1-robh@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator/qcom_rpm-regulator.c')
-rw-r--r--drivers/regulator/qcom_rpm-regulator.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/regulator/qcom_rpm-regulator.c b/drivers/regulator/qcom_rpm-regulator.c
index 9366488f0383..2d5fec1457d1 100644
--- a/drivers/regulator/qcom_rpm-regulator.c
+++ b/drivers/regulator/qcom_rpm-regulator.c
@@ -937,7 +937,6 @@ MODULE_DEVICE_TABLE(of, rpm_of_match);
static int rpm_reg_probe(struct platform_device *pdev)
{
const struct rpm_regulator_data *reg;
- const struct of_device_id *match;
struct regulator_config config = { };
struct regulator_dev *rdev;
struct qcom_rpm_reg *vreg;
@@ -949,13 +948,13 @@ static int rpm_reg_probe(struct platform_device *pdev)
return -ENODEV;
}
- match = of_match_device(rpm_of_match, &pdev->dev);
- if (!match) {
+ reg = device_get_match_data(&pdev->dev);
+ if (!reg) {
dev_err(&pdev->dev, "failed to match device\n");
return -ENODEV;
}
- for (reg = match->data; reg->name; reg++) {
+ for (; reg->name; reg++) {
vreg = devm_kmemdup(&pdev->dev, reg->template, sizeof(*vreg), GFP_KERNEL);
if (!vreg)
return -ENOMEM;