int sis5595_detect(struct i2c_adapter *adapter, int address, int kind) 
static int sis5595_detect(struct i2c_adapter *adapter) 
int sis5595_detect(struct i2c_adapter *adapter, int address, int kind){	int err = 0;	int i;	struct i2c_client *new_client;	struct sis5595_data *data;	char val;	u16 a;	/* Make sure we are probing the ISA bus!!  */	if (!i2c_is_isa_adapter(adapter))		goto exit;	if (force_addr)		address = force_addr & ~(SIS5595_EXTENT - 1);	/* Reserve the ISA region */	if (!request_region(address, SIS5595_EXTENT, sis5595_driver.name)) {		err = -EBUSY;		goto exit;	}	if (force_addr) {		dev_warn(&adapter->dev, "forcing ISA address 0x%04X\n", address);		if (PCIBIOS_SUCCESSFUL !=		    pci_write_config_word(s_bridge, SIS5595_BASE_REG, address))			goto exit_release;		if (PCIBIOS_SUCCESSFUL !=		    pci_read_config_word(s_bridge, SIS5595_BASE_REG, &a))			goto exit_release;		if ((a & ~(SIS5595_EXTENT - 1)) != address)			/* doesn't work for some chips? */			goto exit_release;	}	if (PCIBIOS_SUCCESSFUL !=	    pci_read_config_byte(s_bridge, SIS5595_ENABLE_REG, &val)) {		goto exit_release;	}	if ((val & 0x80) == 0) {		if (PCIBIOS_SUCCESSFUL !=		    pci_write_config_byte(s_bridge, SIS5595_ENABLE_REG,					  val | 0x80))			goto exit_release;		if (PCIBIOS_SUCCESSFUL !=		    pci_read_config_byte(s_bridge, SIS5595_ENABLE_REG, &val))			goto exit_release;		if ((val & 0x80) == 0) 			/* doesn't work for some chips! */			goto exit_release;	}	if (!(data = kmalloc(sizeof(struct sis5595_data), GFP_KERNEL))) {		err = -ENOMEM;		goto exit_release;	}	memset(data, 0, sizeof(struct sis5595_data));	new_client = &data->client;	new_client->addr = address;	init_MUTEX(&data->lock);	i2c_set_clientdata(new_client, data);	new_client->adapter = adapter;	new_client->driver = &sis5595_driver;	new_client->flags = 0;	/* Check revision and pin registers to determine whether 4 or 5 voltages */	pci_read_config_byte(s_bridge, SIS5595_REVISION_REG, &(data->revision));	/* 4 voltages, 1 temp */	data->maxins = 3;	if (data->revision >= REV2MIN) {		pci_read_config_byte(s_bridge, SIS5595_PIN_REG, &val);		if (!(val & 0x80))			/* 5 voltages, no temps */			data->maxins = 4;	}		/* Fill in the remaining client fields and put it into the global list */	strlcpy(new_client->name, "sis5595", I2C_NAME_SIZE);	data->valid = 0;	init_MUTEX(&data->update_lock);	/* Tell the I2C layer a new client has arrived */	if ((err = i2c_attach_client(new_client)))		goto exit_free;		/* Initialize the SIS5595 chip */	sis5595_init_client(new_client);	/* A few vars need to be filled upon startup */	for (i = 0; i < 2; i++) {		data->fan_min[i] = sis5595_read_value(new_client,					SIS5595_REG_FAN_MIN(i));	}	/* Register sysfs hooks */	data->class_dev = hwmon_device_register(&new_client->dev);	if (IS_ERR(data->class_dev)) {		err = PTR_ERR(data->class_dev);		goto exit_detach;	}	device_create_file(&new_client->dev, &dev_attr_in0_input);	device_create_file(&new_client->dev, &dev_attr_in0_min);	device_create_file(&new_client->dev, &dev_attr_in0_max);	device_create_file(&new_client->dev, &dev_attr_in1_input);	device_create_file(&new_client->dev, &dev_attr_in1_min);	device_create_file(&new_client->dev, &dev_attr_in1_max);	device_create_file(&new_client->dev, &dev_attr_in2_input);	device_create_file(&new_client->dev, &dev_attr_in2_min);	device_create_file(&new_client->dev, &dev_attr_in2_max);	device_create_file(&new_client->dev, &dev_attr_in3_input);	device_create_file(&new_client->dev, &dev_attr_in3_min);	device_create_file(&new_client->dev, &dev_attr_in3_max);	if (data->maxins == 4) {		device_create_file(&new_client->dev, &dev_attr_in4_input);		device_create_file(&new_client->dev, &dev_attr_in4_min);		device_create_file(&new_client->dev, &dev_attr_in4_max);	}	device_create_file(&new_client->dev, &dev_attr_fan1_input);	device_create_file(&new_client->dev, &dev_attr_fan1_min);	device_create_file(&new_client->dev, &dev_attr_fan1_div);	device_create_file(&new_client->dev, &dev_attr_fan2_input);	device_create_file(&new_client->dev, &dev_attr_fan2_min);	device_create_file(&new_client->dev, &dev_attr_fan2_div);	device_create_file(&new_client->dev, &dev_attr_alarms);	if (data->maxins == 3) {		device_create_file(&new_client->dev, &dev_attr_temp1_input);		device_create_file(&new_client->dev, &dev_attr_temp1_max);		device_create_file(&new_client->dev, &dev_attr_temp1_max_hyst);	}	return 0;exit_detach:	i2c_detach_client(new_client);exit_free:	kfree(data);exit_release:	release_region(address, SIS5595_EXTENT);exit:	return err;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/2d8672c5a6ba0d3f1d8d3ad61ef67868941364f0/sis5595.c/clean/drivers/hwmon/sis5595.c