[PATCH v1 2/3] mfd: max8907: Remove platform_data based probing
From: Svyatoslav Ryhel
Date: Sun Sep 27 2026 - 11:58:19 EST
There are no in-tree users of this driver, but it supports devicetree
based probing, which means external dtb files may exist that work with
this.
Remove the unused legacy code and make this a DT-only driver.
Signed-off-by: Svyatoslav Ryhel <clamor95@xxxxxxxxx>
---
drivers/mfd/max8907.c | 8 +-------
drivers/regulator/max8907-regulator.c | 8 +++-----
include/linux/mfd/max8907.h | 5 -----
3 files changed, 4 insertions(+), 17 deletions(-)
diff --git a/drivers/mfd/max8907.c b/drivers/mfd/max8907.c
index 7bac1d6517717..363ac80c0593b 100644
--- a/drivers/mfd/max8907.c
+++ b/drivers/mfd/max8907.c
@@ -184,13 +184,7 @@ static int max8907_i2c_probe(struct i2c_client *i2c)
{
struct max8907 *max8907;
int ret;
- struct max8907_platform_data *pdata = dev_get_platdata(&i2c->dev);
- bool pm_off = false;
-
- if (pdata)
- pm_off = pdata->pm_off;
- else if (i2c->dev.of_node)
- pm_off = of_property_read_bool(i2c->dev.of_node,
+ bool pm_off = of_property_read_bool(i2c->dev.of_node,
"maxim,system-power-controller");
max8907 = devm_kzalloc(&i2c->dev, sizeof(struct max8907), GFP_KERNEL);
diff --git a/drivers/regulator/max8907-regulator.c b/drivers/regulator/max8907-regulator.c
index e59aa7a3ee546..907ed3fca5e97 100644
--- a/drivers/regulator/max8907-regulator.c
+++ b/drivers/regulator/max8907-regulator.c
@@ -274,7 +274,6 @@ static inline struct device_node *match_of_node(int index)
static int max8907_regulator_probe(struct platform_device *pdev)
{
struct max8907 *max8907 = dev_get_drvdata(pdev->dev.parent);
- struct max8907_platform_data *pdata = dev_get_platdata(max8907->dev);
int ret;
struct max8907_regulator *pmic;
unsigned int val;
@@ -312,10 +311,9 @@ static int max8907_regulator_probe(struct platform_device *pdev)
struct regulator_dev *rdev;
config.dev = pdev->dev.parent;
- if (pdata)
- idata = pdata->init_data[i];
- else
- idata = match_init_data(i);
+
+ idata = match_init_data(i);
+
config.init_data = idata;
config.driver_data = pmic;
config.regmap = max8907->regmap_gen;
diff --git a/include/linux/mfd/max8907.h b/include/linux/mfd/max8907.h
index 4be3c2370e2a4..e222250f0cc1e 100644
--- a/include/linux/mfd/max8907.h
+++ b/include/linux/mfd/max8907.h
@@ -227,11 +227,6 @@ enum {
MAX8907_IRQ_RTC_ALARM0,
};
-struct max8907_platform_data {
- struct regulator_init_data *init_data[MAX8907_NUM_REGULATORS];
- bool pm_off;
-};
-
struct regmap_irq_chips_data;
struct max8907 {
--
2.53.0