/* Returns 0 on success, or negative on failure.  */
static int disable_ecrc_checking(struct pci_dev *dev)
/* Returns 0 on success, or negative on failure.  */
static int disable_ecrc_checking(struct pci_dev *dev)
{
	int pos;
	u32 reg32;
	if (!pci_is_pcie(dev))
		return -ENODEV;
	pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR);
	if (!pos)
		return -ENODEV;
	pci_read_config_dword(dev, pos + PCI_ERR_CAP, &reg32);
	reg32 &= ~(PCI_ERR_CAP_ECRC_GENE | PCI_ERR_CAP_ECRC_CHKE);
	pci_write_config_dword(dev, pos + PCI_ERR_CAP, reg32);
	return 0;
}