Skip to content

Commit ed072e4

Browse files
committed
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
2 parents f2a3ce1 + 265baca commit ed072e4

5 files changed

Lines changed: 19 additions & 13 deletions

File tree

arch/s390/include/asm/pci.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,14 @@ static inline bool zdev_enabled(struct zpci_dev *zdev)
191191
return (zdev->fh & (1UL << 31)) ? true : false;
192192
}
193193

194-
extern const struct attribute_group *zpci_attr_groups[];
194+
extern const struct attribute_group zpci_attr_group;
195+
extern const struct attribute_group pfip_attr_group;
196+
extern const struct attribute_group zpci_ident_attr_group;
197+
198+
#define ARCH_PCI_DEV_GROUPS &zpci_attr_group, \
199+
&pfip_attr_group, \
200+
&zpci_ident_attr_group,
201+
195202
extern unsigned int s390_pci_force_floating __initdata;
196203
extern unsigned int s390_pci_no_rid;
197204

arch/s390/pci/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
# Makefile for the s390 PCI subsystem.
44
#
55

6-
obj-$(CONFIG_PCI) += pci.o pci_irq.o pci_clp.o pci_sysfs.o \
6+
obj-$(CONFIG_PCI) += pci.o pci_irq.o pci_clp.o \
77
pci_event.o pci_debug.o pci_insn.o pci_mmio.o \
88
pci_bus.o pci_kvm_hook.o
99
obj-$(CONFIG_PCI_IOV) += pci_iov.o
10+
obj-$(CONFIG_SYSFS) += pci_sysfs.o

arch/s390/pci/pci.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,6 @@ int pcibios_device_add(struct pci_dev *pdev)
587587
if (pdev->is_physfn)
588588
pdev->no_vf_scan = 1;
589589

590-
pdev->dev.groups = zpci_attr_groups;
591590
zpci_map_resources(pdev);
592591

593592
for (i = 0; i < PCI_STD_NUM_BARS; i++) {

arch/s390/pci/pci_sysfs.c

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ static struct attribute *zpci_ident_attrs[] = {
197197
NULL,
198198
};
199199

200-
static struct attribute_group zpci_ident_attr_group = {
200+
const struct attribute_group zpci_ident_attr_group = {
201201
.attrs = zpci_ident_attrs,
202202
.is_visible = zpci_index_is_visible,
203203
};
@@ -223,7 +223,7 @@ static struct attribute *zpci_dev_attrs[] = {
223223
NULL,
224224
};
225225

226-
static struct attribute_group zpci_attr_group = {
226+
const struct attribute_group zpci_attr_group = {
227227
.attrs = zpci_dev_attrs,
228228
.bin_attrs = zpci_bin_attrs,
229229
};
@@ -235,14 +235,8 @@ static struct attribute *pfip_attrs[] = {
235235
&dev_attr_segment3.attr,
236236
NULL,
237237
};
238-
static struct attribute_group pfip_attr_group = {
238+
239+
const struct attribute_group pfip_attr_group = {
239240
.name = "pfip",
240241
.attrs = pfip_attrs,
241242
};
242-
243-
const struct attribute_group *zpci_attr_groups[] = {
244-
&zpci_attr_group,
245-
&pfip_attr_group,
246-
&zpci_ident_attr_group,
247-
NULL,
248-
};

drivers/pci/pci-sysfs.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@
3131
#include <linux/aperture.h>
3232
#include "pci.h"
3333

34+
#ifndef ARCH_PCI_DEV_GROUPS
35+
#define ARCH_PCI_DEV_GROUPS
36+
#endif
37+
3438
static int sysfs_initialized; /* = 0 */
3539

3640
/* show configuration fields */
@@ -1624,6 +1628,7 @@ const struct attribute_group *pci_dev_groups[] = {
16241628
&pci_dev_acpi_attr_group,
16251629
#endif
16261630
&pci_dev_resource_resize_group,
1631+
ARCH_PCI_DEV_GROUPS
16271632
NULL,
16281633
};
16291634

0 commit comments

Comments
 (0)