From: Sergei Shtylyov Date: Wed, 13 Jul 2011 15:20:14 +0000 (+0400) Subject: PCI hotplug: cpqphp: use pci_dev->vendor X-Git-Tag: v4.13~13865^2~9 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=05d3ac267a9d10af6ca370afe21802333aad1d5c;p=mirror_ubuntu-bionic-kernel.git PCI hotplug: cpqphp: use pci_dev->vendor The driver reads PCI vendor ID from the PCI configuration register while it is already stored by the PCI subsystem in the 'vendor' field of 'struct pci_dev'... Signed-off-by: Sergei Shtylyov Signed-off-by: Jesse Barnes --- diff --git a/drivers/pci/hotplug/cpqphp_core.c b/drivers/pci/hotplug/cpqphp_core.c index 627274cc571f..f1ce99cceac6 100644 --- a/drivers/pci/hotplug/cpqphp_core.c +++ b/drivers/pci/hotplug/cpqphp_core.c @@ -840,8 +840,9 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) /* Need to read VID early b/c it's used to differentiate CPQ and INTC * discovery */ - rc = pci_read_config_word(pdev, PCI_VENDOR_ID, &vendor_id); - if (rc || ((vendor_id != PCI_VENDOR_ID_COMPAQ) && (vendor_id != PCI_VENDOR_ID_INTEL))) { + vendor_id = pdev->vendor; + if ((vendor_id != PCI_VENDOR_ID_COMPAQ) && + (vendor_id != PCI_VENDOR_ID_INTEL)) { err(msg_HPC_non_compaq_or_intel); rc = -ENODEV; goto err_disable_device;