diff options
author | Krzysztof Wilczyński <kw@linux.com> | 2021-04-27 23:18:47 +0300 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2021-04-29 18:07:31 +0300 |
commit | df1af7cbe7bc11720b3e915771d47acc3604eb44 (patch) | |
tree | 5698161246c9acf9a14a3cff3d478a37e88e775f /drivers/pci/pci-label.c | |
parent | 362fb766264a1d62254ad950304fa1d97172bb44 (diff) | |
download | linux-df1af7cbe7bc11720b3e915771d47acc3604eb44.tar.xz |
PCI/sysfs: Rearrange smbios_attr_group and acpi_attr_group
Collect the smbios_attr_group and acpi_attr_group together in the logical
order. No functional change intended.
[bhelgaas: split to separate patch]
Link: https://lore.kernel.org/r/20210416205856.3234481-6-kw@linux.com
Signed-off-by: Krzysztof Wilczyński <kw@linux.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/pci-label.c')
-rw-r--r-- | drivers/pci/pci-label.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/drivers/pci/pci-label.c b/drivers/pci/pci-label.c index c4636f2e8545..f94ce0328609 100644 --- a/drivers/pci/pci-label.c +++ b/drivers/pci/pci-label.c @@ -87,21 +87,6 @@ static size_t find_smbios_instance_string(struct pci_dev *pdev, char *buf, return 0; } -static umode_t smbios_attr_is_visible(struct kobject *kobj, struct attribute *a, - int n) -{ - struct device *dev = kobj_to_dev(kobj); - struct pci_dev *pdev = to_pci_dev(dev); - - if (device_has_acpi_name(dev)) - return 0; - - if (!find_smbios_instance_string(pdev, NULL, SMBIOS_ATTR_NONE)) - return 0; - - return a->mode; -} - static ssize_t smbios_label_show(struct device *dev, struct device_attribute *attr, char *buf) { @@ -129,6 +114,21 @@ static struct attribute *smbios_attrs[] = { NULL, }; +static umode_t smbios_attr_is_visible(struct kobject *kobj, struct attribute *a, + int n) +{ + struct device *dev = kobj_to_dev(kobj); + struct pci_dev *pdev = to_pci_dev(dev); + + if (device_has_acpi_name(dev)) + return 0; + + if (!find_smbios_instance_string(pdev, NULL, SMBIOS_ATTR_NONE)) + return 0; + + return a->mode; +} + const struct attribute_group pci_dev_smbios_attr_group = { .attrs = smbios_attrs, .is_visible = smbios_attr_is_visible, @@ -193,17 +193,6 @@ static int dsm_get_label(struct device *dev, char *buf, return len; } -static umode_t acpi_attr_is_visible(struct kobject *kobj, struct attribute *a, - int n) -{ - struct device *dev = kobj_to_dev(kobj); - - if (!device_has_acpi_name(dev)) - return 0; - - return a->mode; -} - static ssize_t label_show(struct device *dev, struct device_attribute *attr, char *buf) { @@ -224,6 +213,17 @@ static struct attribute *acpi_attrs[] = { NULL, }; +static umode_t acpi_attr_is_visible(struct kobject *kobj, struct attribute *a, + int n) +{ + struct device *dev = kobj_to_dev(kobj); + + if (!device_has_acpi_name(dev)) + return 0; + + return a->mode; +} + const struct attribute_group pci_dev_acpi_attr_group = { .attrs = acpi_attrs, .is_visible = acpi_attr_is_visible, |