aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug
diff options
context:
space:
mode:
authorrajesh.shah@intel.com <rajesh.shah@intel.com>2005-10-13 15:05:37 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-10-28 18:36:59 -0400
commit7e88ed199689f333668b62348051202706b6a74a (patch)
tree5dd9d1f727a1b6b1435e475dcc62e7fde26d99f5 /drivers/pci/hotplug
parentdbd7a78818d125a0ebd5507d4edb4dd5900006ab (diff)
[PATCH] shpchp: remove redundant display of PCI device resources
Info about resources assigned to PCI devices is already available through sysfs and pci utilities. There's no need for shpchp to create another sysfs file to display the same information. Signed-off-by: Rajesh Shah <rajesh.shah@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/hotplug')
-rw-r--r--drivers/pci/hotplug/shpchp_sysfs.c68
1 files changed, 0 insertions, 68 deletions
diff --git a/drivers/pci/hotplug/shpchp_sysfs.c b/drivers/pci/hotplug/shpchp_sysfs.c
index b0e781dbcffb..ce41719a88f7 100644
--- a/drivers/pci/hotplug/shpchp_sysfs.c
+++ b/drivers/pci/hotplug/shpchp_sysfs.c
@@ -88,75 +88,7 @@ static ssize_t show_ctrl (struct device *dev, struct device_attribute *attr, cha
88} 88}
89static DEVICE_ATTR (ctrl, S_IRUGO, show_ctrl, NULL); 89static DEVICE_ATTR (ctrl, S_IRUGO, show_ctrl, NULL);
90 90
91static ssize_t show_dev (struct device *dev, struct device_attribute *attr, char *buf)
92{
93 struct pci_dev *pdev, *fdev;
94 struct controller *ctrl;
95 char * out = buf;
96 int index;
97 struct resource *res;
98 struct pci_func *new_slot;
99 struct slot *slot;
100
101 pdev = container_of (dev, struct pci_dev, dev);
102 ctrl = pci_get_drvdata(pdev);
103
104 slot=ctrl->slot;
105
106 while (slot) {
107 new_slot = shpchp_slot_find(slot->bus, slot->device, 0);
108 if (!new_slot)
109 break;
110 fdev = new_slot->pci_dev;
111 if (!fdev)
112 break;
113 out += sprintf(out, "assigned resources: memory\n");
114 for (index=0; index <= PCI_NUM_RESOURCES; index++) {
115 res = &(fdev->resource[index]);
116 if (res && (res->flags & IORESOURCE_MEM) &&
117 !(res->flags & IORESOURCE_PREFETCH)) {
118 out += sprintf(out,
119 "start = %8.8lx, length = %8.8lx\n",
120 res->start, (res->end - res->start));
121 }
122 }
123 out += sprintf(out, "assigned resources: prefetchable memory\n");
124 for (index=0; index <= PCI_NUM_RESOURCES; index++) {
125 res = &(fdev->resource[index]);
126 if (res && (res->flags & (IORESOURCE_MEM |
127 IORESOURCE_PREFETCH))) {
128 out += sprintf(out,
129 "start = %8.8lx, length = %8.8lx\n",
130 res->start, (res->end - res->start));
131 }
132 }
133 out += sprintf(out, "assigned resources: IO\n");
134 for (index=0; index <= PCI_NUM_RESOURCES; index++) {
135 res = &(fdev->resource[index]);
136 if (res && (res->flags & IORESOURCE_IO)) {
137 out += sprintf(out,
138 "start = %8.8lx, length = %8.8lx\n",
139 res->start, (res->end - res->start));
140 }
141 }
142 out += sprintf(out, "assigned resources: bus numbers\n");
143 if (fdev->subordinate)
144 out += sprintf(out, "start = %8.8x, length = %8.8x\n",
145 fdev->subordinate->secondary,
146 (fdev->subordinate->subordinate -
147 fdev->subordinate->secondary));
148 else
149 out += sprintf(out, "start = %8.8x, length = %8.8x\n",
150 fdev->bus->number, 1);
151 slot=slot->next;
152 }
153
154 return out - buf;
155}
156static DEVICE_ATTR (dev, S_IRUGO, show_dev, NULL);
157
158void shpchp_create_ctrl_files (struct controller *ctrl) 91void shpchp_create_ctrl_files (struct controller *ctrl)
159{ 92{
160 device_create_file (&ctrl->pci_dev->dev, &dev_attr_ctrl); 93 device_create_file (&ctrl->pci_dev->dev, &dev_attr_ctrl);
161 device_create_file (&ctrl->pci_dev->dev, &dev_attr_dev);
162} 94}