mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/3] spmi: Drop struct spmi_device_id
@ 2026-11-26 14:48 Uwe Kleine-König
  2026-11-26 14:48 ` [PATCH v2 1/3] spmi: Don't limit device name matchin driver name on SPMI_NAME_SIZE chars Uwe Kleine-König
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Uwe Kleine-König @ 2026-11-26 14:48 UTC (permalink / raw)
  To: Stephen Boyd, Abel Vesa; +Cc: linux-kernel, Pawel Zalewski

Hello,

my v1 patch
(https://lore.kernel.org/all/20261125112158.938835-2-u.kleine-koenig@baylibre.com/)
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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-26 14:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-26 14:48 [PATCH v2 0/3] spmi: Drop struct spmi_device_id Uwe Kleine-König
2026-11-26 14:48 ` [PATCH v2 1/3] spmi: Don't limit device name matchin driver name on SPMI_NAME_SIZE chars Uwe Kleine-König
2026-11-26 14:48 ` [PATCH v2 2/3] spmi: Drop struct spmi_device_id Uwe Kleine-König
2026-11-26 14:48 ` [PATCH v2 3/3] spmi: Don't export locally used function spmi_device_add() Uwe Kleine-König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®