#include <linux/pci-acpi.h>
#include "pci.h"
+static bool device_has_acpi_name(struct device *dev)
+{
+#ifdef CONFIG_ACPI
+ acpi_handle handle;
+
+ handle = ACPI_HANDLE(dev);
+ if (!handle)
+ return false;
+
+ return acpi_check_dsm(handle, &pci_acpi_dsm_guid, 0x2,
+ 1 << DSM_PCI_DEVICE_NAME);
+#else
+ return false;
+#endif
+}
+
#ifdef CONFIG_DMI
enum smbios_attr_enum {
SMBIOS_ATTR_NONE = 0,
return len;
}
-static bool device_has_dsm(struct device *dev)
-{
- acpi_handle handle;
-
- handle = ACPI_HANDLE(dev);
- if (!handle)
- return false;
-
- return !!acpi_check_dsm(handle, &pci_acpi_dsm_guid, 0x2,
- 1 << DSM_PCI_DEVICE_NAME);
-}
-
static umode_t acpi_index_string_exist(struct kobject *kobj,
struct attribute *attr, int n)
{
dev = kobj_to_dev(kobj);
- if (device_has_dsm(dev))
+ if (device_has_acpi_name(dev))
return S_IRUGO;
return 0;
{
return -1;
}
-
-static inline bool device_has_dsm(struct device *dev)
-{
- return false;
-}
#endif
void pci_create_firmware_label_files(struct pci_dev *pdev)
{
- if (device_has_dsm(&pdev->dev))
+ if (device_has_acpi_name(&pdev->dev))
pci_create_acpi_index_label_files(pdev);
else
pci_create_smbiosname_file(pdev);
void pci_remove_firmware_label_files(struct pci_dev *pdev)
{
- if (device_has_dsm(&pdev->dev))
+ if (device_has_acpi_name(&pdev->dev))
pci_remove_acpi_index_label_files(pdev);
else
pci_remove_smbiosname_file(pdev);