]> git.baikalelectronics.ru Git - kernel.git/commitdiff
PCI/sysfs: Rearrange smbios_attr_group and acpi_attr_group
authorKrzysztof Wilczyński <kw@linux.com>
Tue, 27 Apr 2021 20:18:47 +0000 (15:18 -0500)
committerBjorn Helgaas <bhelgaas@google.com>
Thu, 29 Apr 2021 15:07:31 +0000 (10:07 -0500)
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>
drivers/pci/pci-label.c

index c4636f2e85453646c32c97beff2e25268dbf37fe..f94ce0328609469b58f64ee828c0f40bbfe9d9e2 100644 (file)
@@ -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,