linux: Fix BUS_PLATFORM detection for non-PCI devices

Commit 74b7427c41 (linux: Make platform device probe less fragile)
effectively dropped busid detection for non-PCI devices, for example on
OMAP we have "ID_PATH=platform-omapdrm.0". For such devices busid will not
be set, making platform probes (and server mediated fd support) impossible.

Fix that by extending config_udev_odev_setup_attribs() logic to support
platform devices as well.

Signed-off-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1761>
This commit is contained in:
Ivaylo Dimitrov 2025-01-12 18:54:22 +02:00 committed by Marge Bot
parent e0588d2110
commit 579eb31222

View File

@ -551,6 +551,9 @@ config_udev_odev_setup_attribs(struct udev_device *udev_device, const char *path
attribs->busid = XNFstrdup(value); attribs->busid = XNFstrdup(value);
attribs->busid[3] = ':'; attribs->busid[3] = ':';
} else if (value && (str = strrstr(value, "platform-"))) {
value = str + 9;
attribs->busid = XNFstrdup(value);
} }
if (!value) if (!value)