summaryrefslogtreecommitdiff
path: root/drivers/regulator/lochnagar-regulator.c
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2023-10-17 23:34:41 +0300
committerMark Brown <broonie@kernel.org>2023-10-17 23:38:48 +0300
commit8f7e17d847edf6bc02d0813b123b9d78ba504098 (patch)
tree120904e8da64019d8776c30c7c05959470e5e9b5 /drivers/regulator/lochnagar-regulator.c
parent46537a8676d6555141c4b98ec1bf5f3eea971128 (diff)
downloadlinux-8f7e17d847edf6bc02d0813b123b9d78ba504098.tar.xz
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/lochnagar-regulator.c')
-rw-r--r--drivers/regulator/lochnagar-regulator.c8
1 files changed, 2 insertions, 6 deletions
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 <linux/module.h>
#include <linux/mutex.h>
#include <linux/of.h>
-#include <linux/of_device.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/regulator/driver.h>
@@ -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);