diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2024-04-03 22:45:11 +0200 |
---|---|---|
committer | Luca Boccassi <luca.boccassi@gmail.com> | 2024-04-04 22:29:57 +0200 |
commit | 9990552f9a26cfb07ef3edaad846543bdd013b10 (patch) | |
tree | 37aaaa828bf86d06bfe759661819e8a6bba2f8a8 /src/backlight/backlight.c | |
parent | udev: do not update sysattr and sysctl value on testing (diff) | |
download | systemd-9990552f9a26cfb07ef3edaad846543bdd013b10.tar.xz systemd-9990552f9a26cfb07ef3edaad846543bdd013b10.zip |
backlight: fix detection of multiple graphic cards
Follow-up for e0504dd011189d97a1ea813aabfe1e696742bcf5.
Hopefully, devices in PCI subsystem have some properties, thus have
their udev database file. But, that may not be true. Here, we only read
sysattrs of enumerated devices, hence it is not necessary to check if
the device is initialized or not.
Diffstat (limited to 'src/backlight/backlight.c')
-rw-r--r-- | src/backlight/backlight.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/backlight/backlight.c b/src/backlight/backlight.c index 6126405994..2de6c2008a 100644 --- a/src/backlight/backlight.c +++ b/src/backlight/backlight.c @@ -55,6 +55,10 @@ static int has_multiple_graphics_cards(void) { if (r < 0) return r; + r = sd_device_enumerator_allow_uninitialized(e); + if (r < 0) + return r; + r = sd_device_enumerator_add_match_subsystem(e, "pci", /* match = */ true); if (r < 0) return r; |