diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/pci/hotplug/shpchp_core.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/pci/hotplug/shpchp_core.c b/drivers/pci/hotplug/shpchp_core.c index e3c0c17295da..3132d60a79f5 100644 --- a/drivers/pci/hotplug/shpchp_core.c +++ b/drivers/pci/hotplug/shpchp_core.c | |||
@@ -351,6 +351,17 @@ static int get_cur_bus_speed (struct hotplug_slot *hotplug_slot, enum pci_bus_sp | |||
351 | return 0; | 351 | return 0; |
352 | } | 352 | } |
353 | 353 | ||
354 | static int is_shpc_capable(struct pci_dev *dev) | ||
355 | { | ||
356 | if ((dev->vendor == PCI_VENDOR_ID_AMD) || (dev->device == | ||
357 | PCI_DEVICE_ID_AMD_GOLAM_7450)) | ||
358 | return 1; | ||
359 | if (pci_find_capability(dev, PCI_CAP_ID_SHPC)) | ||
360 | return 1; | ||
361 | |||
362 | return 0; | ||
363 | } | ||
364 | |||
354 | static int shpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | 365 | static int shpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) |
355 | { | 366 | { |
356 | int rc; | 367 | int rc; |
@@ -359,6 +370,9 @@ static int shpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
359 | int first_device_num; /* first PCI device number supported by this SHPC */ | 370 | int first_device_num; /* first PCI device number supported by this SHPC */ |
360 | int num_ctlr_slots; /* number of slots supported by this SHPC */ | 371 | int num_ctlr_slots; /* number of slots supported by this SHPC */ |
361 | 372 | ||
373 | if (!is_shpc_capable(pdev)) | ||
374 | return -ENODEV; | ||
375 | |||
362 | ctrl = (struct controller *) kmalloc(sizeof(struct controller), GFP_KERNEL); | 376 | ctrl = (struct controller *) kmalloc(sizeof(struct controller), GFP_KERNEL); |
363 | if (!ctrl) { | 377 | if (!ctrl) { |
364 | err("%s : out of memory\n", __FUNCTION__); | 378 | err("%s : out of memory\n", __FUNCTION__); |