Skip to content

Commit 0f49ba5

Browse files
gregkhbjorn-helgaas
authored andcommitted
PCI: convert bus code to use bus_groups
The bus_attrs field of struct bus_type is going away soon, dev_groups should be used instead. This converts the PCI bus code to use the correct field. Cc: Bjorn Helgaas <bhelgaas@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 4a10c2a commit 0f49ba5

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

drivers/pci/pci-driver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1317,7 +1317,7 @@ struct bus_type pci_bus_type = {
13171317
.remove = pci_device_remove,
13181318
.shutdown = pci_device_shutdown,
13191319
.dev_attrs = pci_dev_attrs,
1320-
.bus_attrs = pci_bus_attrs,
1320+
.bus_groups = pci_bus_groups,
13211321
.drv_attrs = pci_drv_attrs,
13221322
.pm = PCI_PM_OPS_PTR,
13231323
};

drivers/pci/pci-sysfs.c

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,10 +302,20 @@ static ssize_t bus_rescan_store(struct bus_type *bus, const char *buf,
302302
}
303303
return count;
304304
}
305+
static BUS_ATTR(rescan, (S_IWUSR|S_IWGRP), NULL, bus_rescan_store);
305306

306-
struct bus_attribute pci_bus_attrs[] = {
307-
__ATTR(rescan, (S_IWUSR|S_IWGRP), NULL, bus_rescan_store),
308-
__ATTR_NULL
307+
struct attribute *pci_bus_attrs[] = {
308+
&bus_attr_rescan.attr,
309+
NULL,
310+
};
311+
312+
static const struct attribute_group pci_bus_group = {
313+
.attrs = pci_bus_attrs,
314+
};
315+
316+
const struct attribute_group *pci_bus_groups[] = {
317+
&pci_bus_group,
318+
NULL,
309319
};
310320

311321
static ssize_t

drivers/pci/pci.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ static inline int pci_no_d1d2(struct pci_dev *dev)
156156
extern struct device_attribute pci_dev_attrs[];
157157
extern const struct attribute_group *pcibus_groups[];
158158
extern struct device_type pci_dev_type;
159-
extern struct bus_attribute pci_bus_attrs[];
159+
extern const struct attribute_group *pci_bus_groups[];
160160

161161

162162
/**

0 commit comments

Comments
 (0)