mfd: fix platform-device id collisions
Status from this message: Applied to fixes.
Get series with b4
b4 am [email protected]Versions newest first
Patches in v1 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/6 | mfd: viperboard: fix platform-device id collisiondrivers/ | +3 | 1 reply | |
| 2/6 | mfd: rtsx_usb: fix platform device-id collisiondrivers/ | +1 | 2 replies | |
| 3/6 | mfd: core: add helper function to register hotplug devicesinclude/ | +7 | 1 reply | |
| 4/6 | mfd: use mfd_add_hotplug_devices helperdrivers/ drivers/ | +4 | 1 reply | |
| 5/6 | HID: hid-sensor-hub: use mfd_add_hotplug_devices helperdrivers/ | +3 | 2 replies | |
| 6/6 | mfd: core: fix platform-device id generationdrivers/ | +7 | 1 reply |
Reviews trailers per patch
1 of 6 patches has a Reviewed-by or Acked-by.
| Patch | Jiri Kosina |
|---|---|
| 1/6 | |
| 2/6 | |
| 3/6 | |
| 4/6 | |
| 5/6 | A-b |
| 6/6 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/6] mfd: fix platform-device id collisions
Hot-pluggable multi-function devices should always be registered with PLATFORM_DEVID_AUTO to avoid name collisions on the platform bus.
This series fix the two mfd drivers that currently fail to get this right, and also adds a new helper function to assist any future driver authors.
Included is also a fix of how mfd core generates the platform ids for subdevices. Currently, the mfd cell-id is simply added to the id base that mfd_add_devices is called with. This effectively prevents mfd-devices from using PLATFORM_DEVID_AUTO (-2) while still having non-zero cell ids.
In a different thread I mentioned that using for example
bus_num << 8 | dev_num
as an id-base for USB multi-function devices would also avoid any collisions, but encoding the bus topology in the id base like this is not good idea. [1] Not only would it force any new transports to come up with unique id bases, it would also be very ad-hoc differ from driver to driver (consider multi-interface USB devices or non-zero cell ids).
Note that if userspace needs to find sibling interfaces it should never rely on device naming anyway, but rather use the topology already encoded in sysfs.
The only thing that is currently not possible trough sysfs is to figure out which sibling interface is which should they have the same name but unique cell ids (consider an MFD with multiple leds or gpio chips). Again, parsing device ids is not an option, but if needed we could simply let driver core export any mfd cell-id for platform devices. Note that the final patch is a pre-requisite for this.
Johan
[1] http://marc.info/?l=linux-kernel&m=141094514827834&w=2
Johan Hovold (6):
mfd: viperboard: fix platform-device id collision
mfd: rtsx_usb: fix platform device-id collision
mfd: core: add helper function to register hotplug devices
mfd: use mfd_add_hotplug_devices helper
HID: hid-sensor-hub: use mfd_add_hotplug_devices helper
mfd: core: fix platform-device id generation
drivers/hid/hid-sensor-hub.c | 8 +++----- drivers/mfd/mfd-core.c | 8 +++++++- drivers/mfd/rtsx_usb.c | 4 ++-- drivers/mfd/viperboard.c | 4 ++-- include/linux/mfd/core.h | 7 +++++++ 5 files changed, 21 insertions(+), 10 deletions(-)
Signature · 6 lines
1.8.5.5 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html