summaryrefslogtreecommitdiff
path: root/drivers/regulator/palmas-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/palmas-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/palmas-regulator.c')
-rw-r--r--drivers/regulator/palmas-regulator.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c
index 076966366b60..e0dc033aae0f 100644
--- a/drivers/regulator/palmas-regulator.c
+++ b/drivers/regulator/palmas-regulator.c
@@ -19,7 +19,6 @@
#include <linux/regmap.h>
#include <linux/mfd/palmas.h>
#include <linux/of.h>
-#include <linux/of_platform.h>
#include <linux/regulator/of_regulator.h>
static const struct linear_range smps_low_ranges[] = {
@@ -1601,16 +1600,13 @@ static int palmas_regulators_probe(struct platform_device *pdev)
struct regulator_config config = { };
struct palmas_pmic *pmic;
const char *pdev_name;
- const struct of_device_id *match;
int ret = 0;
unsigned int reg;
- match = of_match_device(of_match_ptr(of_palmas_match_tbl), &pdev->dev);
-
- if (!match)
+ driver_data = (struct palmas_pmic_driver_data *)device_get_match_data(&pdev->dev);
+ if (!driver_data)
return -ENODATA;
- driver_data = (struct palmas_pmic_driver_data *)match->data;
pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
if (!pdata)
return -ENOMEM;