From 8f7e17d847edf6bc02d0813b123b9d78ba504098 Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Tue, 17 Oct 2023 15:34:41 -0500 Subject: 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 Link: https://lore.kernel.org/r/20231017203442.2699322-1-robh@kernel.org Signed-off-by: Mark Brown --- drivers/regulator/lochnagar-regulator.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'drivers/regulator/lochnagar-regulator.c') diff --git a/drivers/regulator/lochnagar-regulator.c b/drivers/regulator/lochnagar-regulator.c index 11b358efbc92..e53911c80719 100644 --- a/drivers/regulator/lochnagar-regulator.c +++ b/drivers/regulator/lochnagar-regulator.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include @@ -243,7 +242,6 @@ static int lochnagar_regulator_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct lochnagar *lochnagar = dev_get_drvdata(dev->parent); struct regulator_config config = { }; - const struct of_device_id *of_id; const struct regulator_desc *desc; struct regulator_dev *rdev; int ret; @@ -252,12 +250,10 @@ static int lochnagar_regulator_probe(struct platform_device *pdev) config.regmap = lochnagar->regmap; config.driver_data = lochnagar; - of_id = of_match_device(lochnagar_of_match, dev); - if (!of_id) + desc = device_get_match_data(dev); + if (!desc) return -EINVAL; - desc = of_id->data; - rdev = devm_regulator_register(dev, desc, &config); if (IS_ERR(rdev)) { ret = PTR_ERR(rdev); -- cgit v1.2.3