From a6adeafff6035ff956d64b763b22d15ad5e210b6 Mon Sep 17 00:00:00 2001 From: "rajesh.shah@intel.com" Date: Thu, 13 Oct 2005 12:05:39 -0700 Subject: [PATCH] --- yaml --- r: 10679 b: refs/heads/master c: 1410dc1cef1e2f5e90c1fcb97041f42e0eee35b4 h: refs/heads/master i: 10677: 4bf48bd13f94328202c1e3da20a10f203d50e58b 10675: 8e640d7bfefa1498f395b39c0121c3fc7cdefae3 10671: 7bac694053ca1248d402c3b6fca4e3c833c73d73 v: v3 --- [refs] | 2 +- trunk/drivers/pci/hotplug/shpchp_core.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 320d0d34b3d3..2a7d059e0ed3 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 424600f9706b20a8a33ad928d3d0326bd88679bc +refs/heads/master: 1410dc1cef1e2f5e90c1fcb97041f42e0eee35b4 diff --git a/trunk/drivers/pci/hotplug/shpchp_core.c b/trunk/drivers/pci/hotplug/shpchp_core.c index e3c0c17295da..3132d60a79f5 100644 --- a/trunk/drivers/pci/hotplug/shpchp_core.c +++ b/trunk/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 return 0; } +static int is_shpc_capable(struct pci_dev *dev) +{ + if ((dev->vendor == PCI_VENDOR_ID_AMD) || (dev->device == + PCI_DEVICE_ID_AMD_GOLAM_7450)) + return 1; + if (pci_find_capability(dev, PCI_CAP_ID_SHPC)) + return 1; + + return 0; +} + static int shpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) { int rc; @@ -359,6 +370,9 @@ static int shpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) int first_device_num; /* first PCI device number supported by this SHPC */ int num_ctlr_slots; /* number of slots supported by this SHPC */ + if (!is_shpc_capable(pdev)) + return -ENODEV; + ctrl = (struct controller *) kmalloc(sizeof(struct controller), GFP_KERNEL); if (!ctrl) { err("%s : out of memory\n", __FUNCTION__);