[PATCH v2 0/3] spmi: Drop struct spmi_device_id
From: Uwe Kleine-König
Date: Thu Nov 26 2026 - 09:48:38 EST
Hello,
my v1 patch
(https://lore.kernel.org/all/20261125112158.938835-2-u.kleine-koenig@xxxxxxxxxxxx/)
is the same as patch #2 here, but without the first patch of this series
this results in a build failure. I kept Pawel's R-b tag I got in v1.
I'm not 100% sure, I grokked the spmi situation completely. As pointed
out in the commit description of patch #1 both driver name and device
name are proper \0-terminated strings with no theoretical length limit.
So only comparing SPMI_NAME_SIZE chars is at least strange. I think
there is no device/driver combo that needs that string comparison to
match.
All spmi devices seem to be instantiated via drivers/spmi/spmi.c from
dtb with the exception of drivers/regulator/mt6363-regulator.c.
spmi_device_add() enforces a device name in the form format("%d-%02x",
sdev->ctrl->nr, sdev->usid) and I didn't find a driver with that name.
mt6363-regulator.c does
sdev = spmi_device_alloc(sparent->ctrl);
dev_set_name(&sdev->dev, "%d-%02x-regulator", sdev->ctrl->nr, sdev->usid);
device_add(&sdev->dev);
but there doesn't seem to be a matching driver for that either.
I discovered the opportunity for the 3rd patch while researching the
above details. I'm not sure about that either as
drivers/regulator/mt6363-regulator.c uses spmi_device_remove() so maybe
it should use spmi_device_add(), too? Also I didn't find the
device_put() that is needed to undo spmi_device_alloc() when the
mt6363-regulator device gets unbound.
Best regards
Uwe
Uwe Kleine-König (3):
spmi: Don't limit device name matchin driver name on SPMI_NAME_SIZE
chars
spmi: Drop struct spmi_device_id
spmi: Don't export locally used function spmi_device_add()
drivers/spmi/spmi.c | 6 ++----
include/linux/device-id/spmi.h | 17 -----------------
include/linux/mod_devicetable.h | 1 -
include/linux/spmi.h | 2 --
4 files changed, 2 insertions(+), 24 deletions(-)
delete mode 100644 include/linux/device-id/spmi.h
base-commit: 9437046953b2fb3bf55b36582450ea0267df82a7
--
2.47.3