• K
    PCI/sysfs: Convert "index", "acpi_index", "label" to static attributes · 506140f9
    Krzysztof Wilczyński 提交于
    The "label", "index", and "acpi_index" sysfs attributes show firmware label
    information about the device.  If the ACPI Device Name _DSM is implemented
    for the device, we have:
    
      label        Device name (optional, may be null)
      acpi_index   Instance number (unique under \_SB scope)
    
    When there is no ACPI _DSM and SMBIOS provides an Onboard Devices structure
    for the device, we have:
    
      label        Reference Designation, e.g., a silkscreen label
      index        Device Type Instance
    
    Previously these attributes were dynamically created either by
    pci_bus_add_device() or the pci_sysfs_init() initcall, but since they don't
    need to be created or removed dynamically, we can use a static attribute so
    the device model takes care of addition and removal automatically.
    
    Convert "label", "index", and "acpi_index" to static attributes.
    
    Presence of the ACPI _DSM (device_has_acpi_name()) determines whether the
    ACPI information (label, acpi_index) or the SMBIOS information (label,
    index) is visible.
    
    [bhelgaas: commit log, split to separate patch, add "pci_dev_" prefix]
    Suggested-by: NOliver O'Halloran <oohall@gmail.com>
    Link: https://lore.kernel.org/r/20210416205856.3234481-6-kw@linux.comSigned-off-by: NKrzysztof Wilczyński <kw@linux.com>
    Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
    506140f9
pci.h 22.2 KB