Merge branch 'pci/sysfs'

- Add ARCH_PCI_DEV_GROUPS so s390 can add its own attribute_groups without
  having to stomp on the core's pdev->dev.groups (Lukas Wunner)

* pci/sysfs:
  s390/pci: Stop usurping pdev->dev.groups
This commit is contained in:
Bjorn Helgaas 2024-09-19 14:25:27 -05:00
commit ed072e447e
5 changed files with 19 additions and 13 deletions

View File

@ -191,7 +191,14 @@ static inline bool zdev_enabled(struct zpci_dev *zdev)
return (zdev->fh & (1UL << 31)) ? true : false;
}
extern const struct attribute_group *zpci_attr_groups[];
extern const struct attribute_group zpci_attr_group;
extern const struct attribute_group pfip_attr_group;
extern const struct attribute_group zpci_ident_attr_group;
#define ARCH_PCI_DEV_GROUPS &zpci_attr_group, \
&pfip_attr_group, \
&zpci_ident_attr_group,
extern unsigned int s390_pci_force_floating __initdata;
extern unsigned int s390_pci_no_rid;

View File

@ -3,7 +3,8 @@
# Makefile for the s390 PCI subsystem.
#
obj-$(CONFIG_PCI) += pci.o pci_irq.o pci_clp.o pci_sysfs.o \
obj-$(CONFIG_PCI) += pci.o pci_irq.o pci_clp.o \
pci_event.o pci_debug.o pci_insn.o pci_mmio.o \
pci_bus.o pci_kvm_hook.o
obj-$(CONFIG_PCI_IOV) += pci_iov.o
obj-$(CONFIG_SYSFS) += pci_sysfs.o

View File

@ -587,7 +587,6 @@ int pcibios_device_add(struct pci_dev *pdev)
if (pdev->is_physfn)
pdev->no_vf_scan = 1;
pdev->dev.groups = zpci_attr_groups;
zpci_map_resources(pdev);
for (i = 0; i < PCI_STD_NUM_BARS; i++) {

View File

@ -197,7 +197,7 @@ static struct attribute *zpci_ident_attrs[] = {
NULL,
};
static struct attribute_group zpci_ident_attr_group = {
const struct attribute_group zpci_ident_attr_group = {
.attrs = zpci_ident_attrs,
.is_visible = zpci_index_is_visible,
};
@ -223,7 +223,7 @@ static struct attribute *zpci_dev_attrs[] = {
NULL,
};
static struct attribute_group zpci_attr_group = {
const struct attribute_group zpci_attr_group = {
.attrs = zpci_dev_attrs,
.bin_attrs = zpci_bin_attrs,
};
@ -235,14 +235,8 @@ static struct attribute *pfip_attrs[] = {
&dev_attr_segment3.attr,
NULL,
};
static struct attribute_group pfip_attr_group = {
const struct attribute_group pfip_attr_group = {
.name = "pfip",
.attrs = pfip_attrs,
};
const struct attribute_group *zpci_attr_groups[] = {
&zpci_attr_group,
&pfip_attr_group,
&zpci_ident_attr_group,
NULL,
};

View File

@ -31,6 +31,10 @@
#include <linux/aperture.h>
#include "pci.h"
#ifndef ARCH_PCI_DEV_GROUPS
#define ARCH_PCI_DEV_GROUPS
#endif
static int sysfs_initialized; /* = 0 */
/* show configuration fields */
@ -1624,6 +1628,7 @@ const struct attribute_group *pci_dev_groups[] = {
&pci_dev_acpi_attr_group,
#endif
&pci_dev_resource_resize_group,
ARCH_PCI_DEV_GROUPS
NULL,
};