static unsigned int __init init_chipset_amd74xx(struct pci_dev *dev, const char *name) 
static unsigned int __devinit init_chipset_amd74xx(struct pci_dev *dev, const char *name) 
static unsigned int __init init_chipset_amd74xx(struct pci_dev *dev, const char *name){	unsigned char t;	unsigned int u;	int i;/* * Check for bad SWDMA. */	if (amd_config->flags & AMD_CHECK_SWDMA) {		pci_read_config_byte(dev, PCI_REVISION_ID, &t);		if (t <= 7)			amd_config->flags |= AMD_BAD_SWDMA;	}/* * Check 80-wire cable presence. */	switch (amd_config->flags & AMD_UDMA) {		case AMD_UDMA_133:		case AMD_UDMA_100:			pci_read_config_byte(dev, AMD_CABLE_DETECT, &t);			pci_read_config_dword(dev, AMD_UDMA_TIMING, &u);			amd_80w = ((t & 0x3) ? 1 : 0) | ((t & 0xc) ? 2 : 0);			for (i = 24; i >= 0; i -= 8)				if (((u >> i) & 4) && !(amd_80w & (1 << (1 - (i >> 4))))) {					printk(KERN_WARNING "%s: BIOS didn't set cable bits correctly. Enabling workaround.\n",						amd_chipset->name);					amd_80w |= (1 << (1 - (i >> 4)));				}			break;		case AMD_UDMA_66:			pci_read_config_dword(dev, AMD_UDMA_TIMING, &u);			for (i = 24; i >= 0; i -= 8)				if ((u >> i) & 4)					amd_80w |= (1 << (1 - (i >> 4)));			break;	}/* * Take care of prefetch & postwrite. */	pci_read_config_byte(dev, AMD_IDE_CONFIG, &t);	pci_write_config_byte(dev, AMD_IDE_CONFIG,		(amd_config->flags & AMD_BAD_FIFO) ? (t & 0x0f) : (t | 0xf0));/* * Take care of incorrectly wired Serenade mainboards. */	if ((amd_config->flags & AMD_CHECK_SERENADE) &&		dev->subsystem_vendor == PCI_VENDOR_ID_AMD &&		dev->subsystem_device == PCI_DEVICE_ID_AMD_SERENADE)			amd_config->flags = AMD_UDMA_100;/* * Determine the system bus clock. */	amd_clock = system_bus_clock() * 1000;	switch (amd_clock) {		case 33000: amd_clock = 33333; break;		case 37000: amd_clock = 37500; break;		case 41000: amd_clock = 41666; break;	}	if (amd_clock < 20000 || amd_clock > 50000) {		printk(KERN_WARNING "%s: User given PCI clock speed impossible (%d), using 33 MHz instead.\n",			amd_chipset->name, amd_clock);		printk(KERN_WARNING "%s: Use ide0=ata66 if you want to assume 80-wire cable\n",			amd_chipset->name);		amd_clock = 33333;	}/* * Print the boot message. */	pci_read_config_byte(dev, PCI_REVISION_ID, &t);	printk(KERN_INFO "%s: %s (rev %02x) %s controller\n",		amd_chipset->name, pci_name(dev), t, amd_dma[amd_config->flags & AMD_UDMA]);/* * Register /proc/ide/amd74xx entry */#if defined(DISPLAY_AMD_TIMINGS) && defined(CONFIG_PROC_FS)        if (!amd74xx_proc) {                amd_base = pci_resource_start(dev, 4);                bmide_dev = dev;		ide_pci_create_host_proc("amd74xx", amd74xx_get_info);                amd74xx_proc = 1;        }#endif /* DISPLAY_AMD_TIMINGS && CONFIG_PROC_FS */	return dev->irq;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/e895f926cd8b6d50a42cc985d470bdc9a70caeed/amd74xx.c/buggy/drivers/ide/pci/amd74xx.c