Skip to content

Commit 2229c1f

Browse files
gregkhbjorn-helgaas
authored andcommitted
PCI: convert bus code to use drv_groups
The drv_attrs field of struct bus_type is going away soon, drv_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 0f49ba5 commit 2229c1f

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

drivers/pci/pci-driver.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ store_new_id(struct device_driver *driver, const char *buf, size_t count)
135135
return retval;
136136
return count;
137137
}
138+
static DRIVER_ATTR(new_id, S_IWUSR, NULL, store_new_id);
138139

139140
/**
140141
* store_remove_id - remove a PCI device ID from this driver
@@ -180,12 +181,14 @@ store_remove_id(struct device_driver *driver, const char *buf, size_t count)
180181
return retval;
181182
return count;
182183
}
184+
static DRIVER_ATTR(remove_id, S_IWUSR, NULL, store_remove_id);
183185

184-
static struct driver_attribute pci_drv_attrs[] = {
185-
__ATTR(new_id, S_IWUSR, NULL, store_new_id),
186-
__ATTR(remove_id, S_IWUSR, NULL, store_remove_id),
187-
__ATTR_NULL,
186+
static struct attribute *pci_drv_attrs[] = {
187+
&driver_attr_new_id.attr,
188+
&driver_attr_remove_id.attr,
189+
NULL,
188190
};
191+
ATTRIBUTE_GROUPS(pci_drv);
189192

190193
/**
191194
* pci_match_id - See if a pci device matches a given pci_id table
@@ -1318,7 +1321,7 @@ struct bus_type pci_bus_type = {
13181321
.shutdown = pci_device_shutdown,
13191322
.dev_attrs = pci_dev_attrs,
13201323
.bus_groups = pci_bus_groups,
1321-
.drv_attrs = pci_drv_attrs,
1324+
.drv_groups = pci_drv_groups,
13221325
.pm = PCI_PM_OPS_PTR,
13231326
};
13241327

0 commit comments

Comments
 (0)