Skip to content

Commit

Permalink
linux: handle non-ACPI systems in device_get()
Browse files Browse the repository at this point in the history
/sys/devices/pci0000:00/firmware_node/hid does not exist on all systems.
Kernel parameter acpi=off has been reported as one possible reason in
#120
But this is not the only case. On systems using device trees you may also
not find this file.

We have multiple parsers in dev_probes[]. It is sufficient that one of
these parsers succeeds to provide the device information.

If for instance pci_root_parser and pci_parser fails, we may still get
information from nvme_parser.

If a parser fails, only write a debug information and continue.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
  • Loading branch information
xypron authored and vathpela committed Jan 29, 2024
1 parent 8116fb1 commit 931e97b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -526,8 +526,8 @@ struct device HIDDEN
debug("trying %s", probe->name);
pos = probe->parse(dev, current, dev->link);
if (pos < 0) {
efi_error("parsing %s failed", probe->name);
goto err;
debug("parsing %s failed", probe->name);
continue;
} else if (pos > 0) {
char match[pos+1];

Expand Down

0 comments on commit 931e97b

Please sign in to comment.