diff options
author | Sebastian Ott <sebott@linux.vnet.ibm.com> | 2014-04-17 13:46:15 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2014-04-30 16:48:41 -0400 |
commit | dfc73e7acd9925b434a355eeeed86d44cb435f9c (patch) | |
tree | 02b907874b2f1bbce4c485f4bc40ffd161715da2 /arch | |
parent | 1e358f94c00570f88a590cabe718daf835440cc9 (diff) |
PCI: Move Open Firmware devspec attribute to PCI common code
Move the devspec OF attribute to PCI common code's set of device attributes
since it's not architecture dependent. As a side effect microblaze and
powerpc no longer need to use pcibios_add_platform_entries().
[bhelgaas: fold in #include for compile error]
Link: https://lkml.kernel.org/r/alpine.LFD.2.11.1404141101500.1529@denkbrett
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/microblaze/pci/pci-common.c | 20 | ||||
-rw-r--r-- | arch/powerpc/kernel/pci-common.c | 20 |
2 files changed, 0 insertions, 40 deletions
diff --git a/arch/microblaze/pci/pci-common.c b/arch/microblaze/pci/pci-common.c index 70996cc66aa2..a59de1bc1ce0 100644 --- a/arch/microblaze/pci/pci-common.c +++ b/arch/microblaze/pci/pci-common.c | |||
@@ -168,26 +168,6 @@ struct pci_controller *pci_find_hose_for_OF_device(struct device_node *node) | |||
168 | return NULL; | 168 | return NULL; |
169 | } | 169 | } |
170 | 170 | ||
171 | static ssize_t pci_show_devspec(struct device *dev, | ||
172 | struct device_attribute *attr, char *buf) | ||
173 | { | ||
174 | struct pci_dev *pdev; | ||
175 | struct device_node *np; | ||
176 | |||
177 | pdev = to_pci_dev(dev); | ||
178 | np = pci_device_to_OF_node(pdev); | ||
179 | if (np == NULL || np->full_name == NULL) | ||
180 | return 0; | ||
181 | return sprintf(buf, "%s", np->full_name); | ||
182 | } | ||
183 | static DEVICE_ATTR(devspec, S_IRUGO, pci_show_devspec, NULL); | ||
184 | |||
185 | /* Add sysfs properties */ | ||
186 | int pcibios_add_platform_entries(struct pci_dev *pdev) | ||
187 | { | ||
188 | return device_create_file(&pdev->dev, &dev_attr_devspec); | ||
189 | } | ||
190 | |||
191 | void pcibios_set_master(struct pci_dev *dev) | 171 | void pcibios_set_master(struct pci_dev *dev) |
192 | { | 172 | { |
193 | /* No special bus mastering setup handling */ | 173 | /* No special bus mastering setup handling */ |
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index d9476c1fc959..24d342e91790 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c | |||
@@ -201,26 +201,6 @@ struct pci_controller* pci_find_hose_for_OF_device(struct device_node* node) | |||
201 | return NULL; | 201 | return NULL; |
202 | } | 202 | } |
203 | 203 | ||
204 | static ssize_t pci_show_devspec(struct device *dev, | ||
205 | struct device_attribute *attr, char *buf) | ||
206 | { | ||
207 | struct pci_dev *pdev; | ||
208 | struct device_node *np; | ||
209 | |||
210 | pdev = to_pci_dev (dev); | ||
211 | np = pci_device_to_OF_node(pdev); | ||
212 | if (np == NULL || np->full_name == NULL) | ||
213 | return 0; | ||
214 | return sprintf(buf, "%s", np->full_name); | ||
215 | } | ||
216 | static DEVICE_ATTR(devspec, S_IRUGO, pci_show_devspec, NULL); | ||
217 | |||
218 | /* Add sysfs properties */ | ||
219 | int pcibios_add_platform_entries(struct pci_dev *pdev) | ||
220 | { | ||
221 | return device_create_file(&pdev->dev, &dev_attr_devspec); | ||
222 | } | ||
223 | |||
224 | /* | 204 | /* |
225 | * Reads the interrupt pin to determine if interrupt is use by card. | 205 | * Reads the interrupt pin to determine if interrupt is use by card. |
226 | * If the interrupt is used, then gets the interrupt line from the | 206 | * If the interrupt is used, then gets the interrupt line from the |