printk(KERN_ERR PFX "%s (%s) has invalid driver data %lx\n", pci_pretty_name(pdev), pci_name(pdev), id->driver_data); 
printk(KERN_ERR PFX "%s has invalid driver data %lx\n", pci_name(pdev), id->driver_data); 
static int __devinit mthca_init_one(struct pci_dev *pdev,				    const struct pci_device_id *id){	static int mthca_version_printed = 0;	int ddr_hidden = 0;	int err;	struct mthca_dev *mdev;	if (!mthca_version_printed) {		printk(KERN_INFO "%s", mthca_version);		++mthca_version_printed;	}	printk(KERN_INFO PFX "Initializing %s (%s)\n",	       pci_pretty_name(pdev), pci_name(pdev));	if (id->driver_data >= ARRAY_SIZE(mthca_hca_table)) {		printk(KERN_ERR PFX "%s (%s) has invalid driver data %lx\n",		       pci_pretty_name(pdev), pci_name(pdev), id->driver_data);		return -ENODEV;	}	err = pci_enable_device(pdev);	if (err) {		dev_err(&pdev->dev, "Cannot enable PCI device, "			"aborting.\n");		return err;	}	/*	 * Check for BARs.  We expect 0: 1MB, 2: 8MB, 4: DDR (may not	 * be present)	 */	if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM) ||	    pci_resource_len(pdev, 0) != 1 << 20) {		dev_err(&pdev->dev, "Missing DCS, aborting.\n");		err = -ENODEV;		goto err_disable_pdev;	}	if (!(pci_resource_flags(pdev, 2) & IORESOURCE_MEM) ||	    pci_resource_len(pdev, 2) != 1 << 23) {		dev_err(&pdev->dev, "Missing UAR, aborting.\n");		err = -ENODEV;		goto err_disable_pdev;	}	if (!(pci_resource_flags(pdev, 4) & IORESOURCE_MEM))		ddr_hidden = 1;	err = mthca_request_regions(pdev, ddr_hidden);	if (err) {		dev_err(&pdev->dev, "Cannot obtain PCI resources, "			"aborting.\n");		goto err_disable_pdev;	}	pci_set_master(pdev);	err = pci_set_dma_mask(pdev, DMA_64BIT_MASK);	if (err) {		dev_warn(&pdev->dev, "Warning: couldn't set 64-bit PCI DMA mask.\n");		err = pci_set_dma_mask(pdev, DMA_32BIT_MASK);		if (err) {			dev_err(&pdev->dev, "Can't set PCI DMA mask, aborting.\n");			goto err_free_res;		}	}	err = pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK);	if (err) {		dev_warn(&pdev->dev, "Warning: couldn't set 64-bit "			 "consistent PCI DMA mask.\n");		err = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK);		if (err) {			dev_err(&pdev->dev, "Can't set consistent PCI DMA mask, "				"aborting.\n");			goto err_free_res;		}	}	mdev = (struct mthca_dev *) ib_alloc_device(sizeof *mdev);	if (!mdev) {		dev_err(&pdev->dev, "Device struct alloc failed, "			"aborting.\n");		err = -ENOMEM;		goto err_free_res;	}	mdev->pdev = pdev;	if (ddr_hidden)		mdev->mthca_flags |= MTHCA_FLAG_DDR_HIDDEN;	if (mthca_hca_table[id->driver_data].is_memfree)		mdev->mthca_flags |= MTHCA_FLAG_MEMFREE;	if (mthca_hca_table[id->driver_data].is_pcie)		mdev->mthca_flags |= MTHCA_FLAG_PCIE;	/*	 * Now reset the HCA before we touch the PCI capabilities or	 * attempt a firmware command, since a boot ROM may have left	 * the HCA in an undefined state.	 */	err = mthca_reset(mdev);	if (err) {		mthca_err(mdev, "Failed to reset HCA, aborting.\n");		goto err_free_dev;	}	if (msi_x && !mthca_enable_msi_x(mdev))		mdev->mthca_flags |= MTHCA_FLAG_MSI_X;	if (msi && !(mdev->mthca_flags & MTHCA_FLAG_MSI_X) &&	    !pci_enable_msi(pdev))		mdev->mthca_flags |= MTHCA_FLAG_MSI;	if (mthca_cmd_init(mdev)) {		mthca_err(mdev, "Failed to init command interface, aborting.\n");		goto err_free_dev;	}	err = mthca_tune_pci(mdev);	if (err)		goto err_cmd;	err = mthca_init_hca(mdev);	if (err)		goto err_cmd;	if (mdev->fw_ver < mthca_hca_table[id->driver_data].latest_fw) {		mthca_warn(mdev, "HCA FW version %x.%x.%x is old (%x.%x.%x is current).\n",			   (int) (mdev->fw_ver >> 32), (int) (mdev->fw_ver >> 16) & 0xffff,			   (int) (mdev->fw_ver & 0xffff),			   (int) (mthca_hca_table[id->driver_data].latest_fw >> 32),			   (int) (mthca_hca_table[id->driver_data].latest_fw >> 16) & 0xffff,			   (int) (mthca_hca_table[id->driver_data].latest_fw & 0xffff));		mthca_warn(mdev, "If you have problems, try updating your HCA FW.\n");	}	err = mthca_setup_hca(mdev);	if (err)		goto err_close;	err = mthca_register_device(mdev);	if (err)		goto err_cleanup;	err = mthca_create_agents(mdev);	if (err)		goto err_unregister;	pci_set_drvdata(pdev, mdev);	return 0;err_unregister:	mthca_unregister_device(mdev);err_cleanup:	mthca_cleanup_mcg_table(mdev);	mthca_cleanup_av_table(mdev);	mthca_cleanup_qp_table(mdev);	mthca_cleanup_srq_table(mdev);	mthca_cleanup_cq_table(mdev);	mthca_cmd_use_polling(mdev);	mthca_cleanup_eq_table(mdev);	mthca_pd_free(mdev, &mdev->driver_pd);	mthca_cleanup_mr_table(mdev);	mthca_cleanup_pd_table(mdev);	mthca_cleanup_uar_table(mdev);err_close:	mthca_close_hca(mdev);err_cmd:	mthca_cmd_cleanup(mdev);err_free_dev:	if (mdev->mthca_flags & MTHCA_FLAG_MSI_X)		pci_disable_msix(pdev);	if (mdev->mthca_flags & MTHCA_FLAG_MSI)		pci_disable_msi(pdev);	ib_dealloc_device(&mdev->ib_dev);err_free_res:	mthca_release_regions(pdev, ddr_hidden);err_disable_pdev:	pci_disable_device(pdev);	pci_set_drvdata(pdev, NULL);	return err;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/982245f01734e9d5a3ab98b2b2e9761ae7719094/mthca_main.c/clean/drivers/infiniband/hw/mthca/mthca_main.c