OSDN Git Service

xf86drm: introduce a get_real_pci_path() helper
authorEmil Velikov <emil.velikov@collabora.com>
Tue, 15 May 2018 16:29:44 +0000 (17:29 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Tue, 24 Jul 2018 15:24:45 +0000 (16:24 +0100)
commita02900133b32dd4a7d6da4966f455ab337e80dfc
treed9b217ef4420fb7bdcd482888770c7d1a5d44505
parent95b262f01975d7522cea67d5f5647e45a0152cf5
xf86drm: introduce a get_real_pci_path() helper

Introduce a helper which gets the real sysfs path for the given pci
device.

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 <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