sysfs_obj_name(d, "", path);
strcat(path, rel_path);
- return canonicalize_file_name(path);
+ // Returns a pointer to malloc'ed memory
+ return realpath(path, NULL);
}
static int
{
for (d = a->devices; d; d = d->next)
if (dom == (unsigned)d->domain && bus == d->bus && dev == d->dev && !d->phy_slot)
- d->phy_slot = pci_strdup(a, entry->d_name);
+ d->phy_slot = pci_set_property(d, PCI_FILL_PHYS_SLOT, entry->d_name);
}
fclose(file);
}
{
char buf[OBJBUFSIZE];
if (sysfs_get_string(d, "modalias", buf, 0))
- d->module_alias = pci_strdup(d->access, buf);
+ d->module_alias = pci_set_property(d, PCI_FILL_MODULE_ALIAS, buf);
}
if ((flags & PCI_FILL_LABEL) && !(d->known_fields & PCI_FILL_LABEL))
{
char buf[OBJBUFSIZE];
if (sysfs_get_string(d, "label", buf, 0))
- d->label = pci_strdup(d->access, buf);
+ d->label = pci_set_property(d, PCI_FILL_LABEL, buf);
}
if ((flags & PCI_FILL_NUMA_NODE) && !(d->known_fields & PCI_FILL_NUMA_NODE))
d->numa_node = sysfs_get_value(d, "numa_node", 0);
if ((flags & PCI_FILL_DT_NODE) && !(d->known_fields & PCI_FILL_DT_NODE))
- pci_set_property(d, PCI_FILL_DT_NODE, sysfs_deref_link(d, "of_node"));
+ {
+ char *node = sysfs_deref_link(d, "of_node");
+ if (node)
+ {
+ pci_set_property(d, PCI_FILL_DT_NODE, node);
+ free(node);
+ }
+ }
return pci_generic_fill_info(d, flags);
}