提交 56039e65 编写于 作者: G Greg Kroah-Hartman 提交者: Bjorn Helgaas

PCI: Convert class code to use dev_groups

The dev_attrs field of struct class is going away soon, dev_groups
should be used instead.  This converts the PCI class code to use the
correct field.
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
上级 24336a61
...@@ -131,19 +131,19 @@ static ssize_t pci_bus_show_cpuaffinity(struct device *dev, ...@@ -131,19 +131,19 @@ static ssize_t pci_bus_show_cpuaffinity(struct device *dev,
return ret; return ret;
} }
static inline ssize_t pci_bus_show_cpumaskaffinity(struct device *dev, static ssize_t cpuaffinity_show(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr, char *buf)
char *buf)
{ {
return pci_bus_show_cpuaffinity(dev, 0, attr, buf); return pci_bus_show_cpuaffinity(dev, 0, attr, buf);
} }
static DEVICE_ATTR_RO(cpuaffinity);
static inline ssize_t pci_bus_show_cpulistaffinity(struct device *dev, static ssize_t cpulistaffinity_show(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr, char *buf)
char *buf)
{ {
return pci_bus_show_cpuaffinity(dev, 1, attr, buf); return pci_bus_show_cpuaffinity(dev, 1, attr, buf);
} }
static DEVICE_ATTR_RO(cpulistaffinity);
/* show resources */ /* show resources */
static ssize_t static ssize_t
...@@ -379,6 +379,7 @@ dev_bus_rescan_store(struct device *dev, struct device_attribute *attr, ...@@ -379,6 +379,7 @@ dev_bus_rescan_store(struct device *dev, struct device_attribute *attr,
} }
return count; return count;
} }
static DEVICE_ATTR(rescan, (S_IWUSR|S_IWGRP), NULL, dev_bus_rescan_store);
#if defined(CONFIG_PM_RUNTIME) && defined(CONFIG_ACPI) #if defined(CONFIG_PM_RUNTIME) && defined(CONFIG_ACPI)
static ssize_t d3cold_allowed_store(struct device *dev, static ssize_t d3cold_allowed_store(struct device *dev,
...@@ -514,11 +515,20 @@ struct device_attribute pci_dev_attrs[] = { ...@@ -514,11 +515,20 @@ struct device_attribute pci_dev_attrs[] = {
__ATTR_NULL, __ATTR_NULL,
}; };
struct device_attribute pcibus_dev_attrs[] = { static struct attribute *pcibus_attrs[] = {
__ATTR(rescan, (S_IWUSR|S_IWGRP), NULL, dev_bus_rescan_store), &dev_attr_rescan.attr,
__ATTR(cpuaffinity, S_IRUGO, pci_bus_show_cpumaskaffinity, NULL), &dev_attr_cpuaffinity.attr,
__ATTR(cpulistaffinity, S_IRUGO, pci_bus_show_cpulistaffinity, NULL), &dev_attr_cpulistaffinity.attr,
__ATTR_NULL, NULL,
};
static const struct attribute_group pcibus_group = {
.attrs = pcibus_attrs,
};
const struct attribute_group *pcibus_groups[] = {
&pcibus_group,
NULL,
}; };
static ssize_t static ssize_t
......
...@@ -151,7 +151,7 @@ static inline int pci_no_d1d2(struct pci_dev *dev) ...@@ -151,7 +151,7 @@ static inline int pci_no_d1d2(struct pci_dev *dev)
} }
extern struct device_attribute pci_dev_attrs[]; extern struct device_attribute pci_dev_attrs[];
extern struct device_attribute pcibus_dev_attrs[]; extern const struct attribute_group *pcibus_groups[];
extern struct device_type pci_dev_type; extern struct device_type pci_dev_type;
extern struct bus_attribute pci_bus_attrs[]; extern struct bus_attribute pci_bus_attrs[];
......
...@@ -96,7 +96,7 @@ static void release_pcibus_dev(struct device *dev) ...@@ -96,7 +96,7 @@ static void release_pcibus_dev(struct device *dev)
static struct class pcibus_class = { static struct class pcibus_class = {
.name = "pci_bus", .name = "pci_bus",
.dev_release = &release_pcibus_dev, .dev_release = &release_pcibus_dev,
.dev_attrs = pcibus_dev_attrs, .dev_groups = pcibus_groups,
}; };
static int __init pcibus_class_init(void) static int __init pcibus_class_init(void)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册