/* detect bus speed by looking at control reg timing: */ switch((reg1 >> 8) & 7) { case 5: pci_set_drvdata(dev, (void *) forty_base_hpt366); break; case 9: pci_set_drvdata(dev, (void *) twenty_five_base_hpt366); break; case 7: default: pci_set_drvdata(dev, (void *) thirty_three_base_hpt366); break; }  if (!pci_get_drvdata(dev)) { printk(KERN_ERR "hpt366: unknown bus timing.\n"); pci_set_drvdata(dev, NULL); } 
static int __devinit init_hpt366(struct pci_dev *dev){	u32 reg1	= 0;	u8 drive_fast	= 0;	/*	 * Disable the "fast interrupt" prediction.	 */	pci_read_config_byte(dev, 0x51, &drive_fast);	if (drive_fast & 0x80)		pci_write_config_byte(dev, 0x51, drive_fast & ~0x80);	pci_read_config_dword(dev, 0x40, &reg1);										/* detect bus speed by looking at control reg timing: */	switch((reg1 >> 8) & 7) {		case 5:			pci_set_drvdata(dev, (void *) forty_base_hpt366);			break;		case 9:			pci_set_drvdata(dev, (void *) twenty_five_base_hpt366);			break;		case 7:		default:			pci_set_drvdata(dev, (void *) thirty_three_base_hpt366);			break;	}	if (!pci_get_drvdata(dev))	{		printk(KERN_ERR "hpt366: unknown bus timing.\n");		pci_set_drvdata(dev, NULL);	}	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/b39b01ffb75e14ed76510e4229ffb575007df0fb/hpt366.c/buggy/drivers/ide/pci/hpt366.c