aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/pci/pci_sysfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/pci/pci_sysfs.c')
-rw-r--r--arch/s390/pci/pci_sysfs.c44
1 files changed, 13 insertions, 31 deletions
diff --git a/arch/s390/pci/pci_sysfs.c b/arch/s390/pci/pci_sysfs.c
index ab4a91393005..b56a3958f1a7 100644
--- a/arch/s390/pci/pci_sysfs.c
+++ b/arch/s390/pci/pci_sysfs.c
@@ -72,36 +72,18 @@ static ssize_t store_recover(struct device *dev, struct device_attribute *attr,
72} 72}
73static DEVICE_ATTR(recover, S_IWUSR, NULL, store_recover); 73static DEVICE_ATTR(recover, S_IWUSR, NULL, store_recover);
74 74
75static struct device_attribute *zpci_dev_attrs[] = { 75static struct attribute *zpci_dev_attrs[] = {
76 &dev_attr_function_id, 76 &dev_attr_function_id.attr,
77 &dev_attr_function_handle, 77 &dev_attr_function_handle.attr,
78 &dev_attr_pchid, 78 &dev_attr_pchid.attr,
79 &dev_attr_pfgid, 79 &dev_attr_pfgid.attr,
80 &dev_attr_recover, 80 &dev_attr_recover.attr,
81 NULL,
82};
83static struct attribute_group zpci_attr_group = {
84 .attrs = zpci_dev_attrs,
85};
86const struct attribute_group *zpci_attr_groups[] = {
87 &zpci_attr_group,
81 NULL, 88 NULL,
82}; 89};
83
84int zpci_sysfs_add_device(struct device *dev)
85{
86 int i, rc = 0;
87
88 for (i = 0; zpci_dev_attrs[i]; i++) {
89 rc = device_create_file(dev, zpci_dev_attrs[i]);
90 if (rc)
91 goto error;
92 }
93 return 0;
94
95error:
96 while (--i >= 0)
97 device_remove_file(dev, zpci_dev_attrs[i]);
98 return rc;
99}
100
101void zpci_sysfs_remove_device(struct device *dev)
102{
103 int i;
104
105 for (i = 0; zpci_dev_attrs[i]; i++)
106 device_remove_file(dev, zpci_dev_attrs[i]);
107}