• Emil Velikov's avatar
    xf86drm: introduce a get_real_pci_path() helper · a0290013
    Emil Velikov authored
    Introduce a helper which gets the real sysfs path for the given pci
    In other words, instead opening the /sys/dev/char/*/device symlink, we
    opt for the actual /sys/devices/pci*/*/
    It folds three (nearly identical) snprintf's and paves the way of adding
    extra devices (see next patch) a piece of pie.
    v2: use a caller (on stack) provided real_path (Eric)
    Signed-off-by: Emil Velikov's avatarEmil Velikov <emil.velikov@collabora.com>
    Tested-by: Robert Foss <robert.foss@collabora.com> (v1)
    Reviewed-by: Robert Foss <robert.foss@collabora.com> (v1)
    Reviewed-by: Eric Engestrom <eric@engestrom.ch> (v1)
xf86drm.c 103 KB