[PATCH v2 04/23] mfd: lp87565: Explicitly set driver data for the generic dt compatible
From: Uwe Kleine-König (The Capable Hub)
Date: Wed Jul 08 2026 - 07:21:31 EST
The driver relies on .data being (void *)LP87565_DEVICE_TYPE_UNKNOWN
(i.e. NULL) for the generic device tree compatible. Make this explicit.
Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@xxxxxxxxxxxx>
---
Hello,
while I'm sure that the driver is improved by this patch, I'm unsure
about the handling of the generic dt compatible. E.g.
drivers/regulator/lp87565-regulator.c has:
switch (lp87565->dev_type) {
case LP87565_DEVICE_TYPE_LP87565_Q1:
min_idx = LP87565_BUCK_10;
max_idx = LP87565_BUCK_23;
break;
case LP87565_DEVICE_TYPE_LP87561_Q1:
min_idx = LP87565_BUCK_3210;
max_idx = LP87565_BUCK_3210;
break;
default:
min_idx = LP87565_BUCK_0;
max_idx = LP87565_BUCK_3;
break;
}
so if "ti,lp87565" is used for a one of the explicitly handled types
above, wrong/surprising things happen. I don't know enough about this
driver and hardware to suggest a better handling (apart from maybe just
dropping the generic compatible handling).
Best regards
Uwe
---
drivers/mfd/lp87565.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/mfd/lp87565.c b/drivers/mfd/lp87565.c
index b78ae79df5fa..efea1ba82811 100644
--- a/drivers/mfd/lp87565.c
+++ b/drivers/mfd/lp87565.c
@@ -26,7 +26,10 @@ static const struct mfd_cell lp87565_cells[] = {
};
static const struct of_device_id of_lp87565_match_table[] = {
- { .compatible = "ti,lp87565", },
+ {
+ .compatible = "ti,lp87565",
+ .data = (void *)LP87565_DEVICE_TYPE_UNKNOWN,
+ },
{
.compatible = "ti,lp87524-q1",
.data = (void *)LP87565_DEVICE_TYPE_LP87524_Q1,
--
2.55.0.11.g153666a7d9bb