[i2c] [patch 2.6.19-rc6 12/11] hwmon updates

Jean Delvare khali at linux-fr.org
Fri Dec 15 18:38:17 CET 2006


David,

On Mon, 4 Dec 2006 14:09:21 -0800, David Brownell wrote:
> Removing the undesirable non-class i2c_adapter driver impacts
> some of the hwmon drivers using i2c or i2c_isa, which use that
> with dev_{info,dbg,warn}() level diagnostics.  This updates
> them appropriately.
> 
> Signed-off-by: David Brownell <dbrownell at users.sourceforge.net>
> 
> ---
> One more patch, this goes in the first group ... a number of hwmon
> drivers needed build fixes too.
> 
>  drivers/hwmon/adm1025.c    |    4 ++--
>  drivers/hwmon/adm1026.c    |   12 ++++++++----
>  drivers/hwmon/adm9240.c    |    8 +++++---
>  drivers/hwmon/gl518sm.c    |    2 +-
>  drivers/hwmon/it87.c       |    2 +-
>  drivers/hwmon/lm63.c       |    2 +-
>  drivers/hwmon/lm78.c       |    3 ++-
>  drivers/hwmon/lm83.c       |    4 ++--
>  drivers/hwmon/lm85.c       |   28 ++++++++++++++++++----------
>  drivers/hwmon/lm87.c       |    2 +-
>  drivers/hwmon/lm90.c       |    4 ++--
>  drivers/hwmon/max1619.c    |    4 ++--
>  drivers/hwmon/sis5595.c    |    3 ++-
>  drivers/hwmon/smsc47b397.c |    3 ++-
>  drivers/hwmon/smsc47m1.c   |    5 +++--
>  drivers/hwmon/smsc47m192.c |    4 ++--
>  drivers/hwmon/via686a.c    |    8 ++++----
>  drivers/hwmon/vt8231.c     |   11 ++++++-----
>  drivers/hwmon/w83627hf.c   |    2 +-
>  drivers/hwmon/w83781d.c    |   27 +++++++++++++++++----------
>  drivers/hwmon/w83l785ts.c  |    6 +++---
>  21 files changed, 85 insertions(+), 59 deletions(-)
> 
> 
> Index: g26/drivers/hwmon/it87.c
> ===================================================================
> --- g26.orig/drivers/hwmon/it87.c	2006-11-06 11:50:26.000000000 -0800
> +++ g26/drivers/hwmon/it87.c	2006-12-03 13:15:28.000000000 -0800
> @@ -986,7 +986,7 @@ static int it87_detect(struct i2c_adapte
>  		}
>  		else {
>  			if (kind == 0)
> -				dev_info(&adapter->dev, 
> +				dev_info(adapter->class_dev.dev,
>  					"Ignoring 'force' parameter for unknown chip at "
>  					"adapter %d, address 0x%02x\n",
>  					i2c_adapter_id(adapter), address);
> Index: g26/drivers/hwmon/w83627hf.c
> ===================================================================
> --- g26.orig/drivers/hwmon/w83627hf.c	2006-11-06 11:50:26.000000000 -0800
> +++ g26/drivers/hwmon/w83627hf.c	2006-12-03 13:18:22.000000000 -0800
> @@ -1079,7 +1079,7 @@ static int w83627hf_detect(struct i2c_ad
>  	else if (val == W687THF_DEVID)
>  		kind = w83687thf;
>  	else {
> -		dev_info(&adapter->dev,
> +		dev_info(adapter->class_dev.dev,
>  			 "Unsupported chip (dev_id=0x%02X).\n", val);
>  		goto ERROR1;
>  	}
> Index: g26/drivers/hwmon/w83781d.c
> ===================================================================
> --- g26.orig/drivers/hwmon/w83781d.c	2006-11-06 11:50:26.000000000 -0800
> +++ g26/drivers/hwmon/w83781d.c	2006-12-03 13:21:45.000000000 -0800
> @@ -1021,17 +1021,17 @@ w83781d_detect(struct i2c_adapter *adapt
>  	/* Prevent users from forcing a kind for a bus it isn't supposed
>  	   to possibly be on */
>  	if (is_isa && (kind == as99127f || kind == w83783s)) {
> -		dev_err(&adapter->dev,
> +		dev_err(adapter->class_dev.dev,

Might be worth introducing a local dev variable for this driver, that
would save a lot of line wrapping.

>  			"Cannot force I2C-only chip for ISA address 0x%02x.\n",
>  			address);
>  		err = -EINVAL;
>  		goto ERROR0;
>  	}
> -	
> +

Back out please.

>  	if (is_isa)
>  		if (!request_region(address, W83781D_EXTENT,
>  				    w83781d_isa_driver.driver.name)) {
> -			dev_dbg(&adapter->dev, "Request of region "
> +			dev_dbg(adapter->class_dev.dev, "Request of region "
>  				"0x%x-0x%x for w83781d failed\n", address,
>  				address + W83781D_EXTENT - 1);
>  			err = -EBUSY;
> @@ -1050,7 +1050,8 @@ w83781d_detect(struct i2c_adapter *adapt
>  			if (inb_p(address + 2) != i
>  			 || inb_p(address + 3) != i
>  			 || inb_p(address + 7) != i) {
> -				dev_dbg(&adapter->dev, "Detection of w83781d "
> +				dev_dbg(adapter->class_dev.dev,
> +					"Detection of w83781d "
>  					"chip failed at step 1\n");
>  				err = -ENODEV;
>  				goto ERROR1;
> @@ -1063,7 +1064,8 @@ w83781d_detect(struct i2c_adapter *adapt
>  			val2 = inb_p(address + 5) & 0x7f;
>  			if (val2 != (~i & 0x7f)) {
>  				outb_p(i, address + 5);
> -				dev_dbg(&adapter->dev, "Detection of w83781d "
> +				dev_dbg(adapter->class_dev.dev,
> +					"Detection of w83781d "
>  					"chip failed at step 2 (0x%x != "
>  					"0x%x at 0x%x)\n", val2, ~i & 0x7f,
>  					address + 5);
> @@ -1099,7 +1101,8 @@ w83781d_detect(struct i2c_adapter *adapt
>  	   bank. */
>  	if (kind < 0) {
>  		if (w83781d_read_value(client, W83781D_REG_CONFIG) & 0x80) {
> -			dev_dbg(&adapter->dev, "Detection of w83781d chip "
> +			dev_dbg(adapter->class_dev.dev,
> +				"Detection of w83781d chip "
>  				"failed at step 3\n");
>  			err = -ENODEV;
>  			goto ERROR2;
> @@ -1110,7 +1113,8 @@ w83781d_detect(struct i2c_adapter *adapt
>  		if ((!(val1 & 0x07)) &&
>  		    (((!(val1 & 0x80)) && (val2 != 0xa3) && (val2 != 0xc3))
>  		     || ((val1 & 0x80) && (val2 != 0x5c) && (val2 != 0x12)))) {
> -			dev_dbg(&adapter->dev, "Detection of w83781d chip "
> +			dev_dbg(adapter->class_dev.dev,
> +				"Detection of w83781d chip "
>  				"failed at step 4\n");
>  			err = -ENODEV;
>  			goto ERROR2;
> @@ -1121,7 +1125,8 @@ w83781d_detect(struct i2c_adapter *adapt
>  				  ((val1 & 0x80) && (val2 == 0x5c)))) {
>  			if (w83781d_read_value
>  			    (client, W83781D_REG_I2C_ADDR) != address) {
> -				dev_dbg(&adapter->dev, "Detection of w83781d "
> +				dev_dbg(adapter->class_dev.dev,
> +					"Detection of w83781d "
>  					"chip failed at step 5\n");
>  				err = -ENODEV;
>  				goto ERROR2;
> @@ -1144,7 +1149,8 @@ w83781d_detect(struct i2c_adapter *adapt
>  		else if (val2 == 0x12)
>  			vendid = asus;
>  		else {
> -			dev_dbg(&adapter->dev, "w83781d chip vendor is "
> +			dev_dbg(adapter->class_dev.dev,
> +				"w83781d chip vendor is "
>  				"neither Winbond nor Asus\n");
>  			err = -ENODEV;
>  			goto ERROR2;
> @@ -1164,7 +1170,8 @@ w83781d_detect(struct i2c_adapter *adapt
>  			kind = as99127f;
>  		else {
>  			if (kind == 0)
> -				dev_warn(&adapter->dev, "Ignoring 'force' "
> +				dev_warn(adapter->class_dev.dev,
> +					"Ignoring 'force' "
>  					 "parameter for unknown chip at "
>  					 "address 0x%02x\n", address);
>  			err = -EINVAL;
> Index: g26/drivers/hwmon/smsc47m1.c
> ===================================================================
> --- g26.orig/drivers/hwmon/smsc47m1.c	2006-11-06 11:50:26.000000000 -0800
> +++ g26/drivers/hwmon/smsc47m1.c	2006-12-03 13:35:37.000000000 -0800
> @@ -424,7 +424,7 @@ static int smsc47m1_detect(struct i2c_ad
>  	int fan1, fan2, pwm1, pwm2;
>  
>  	if (!request_region(address, SMSC_EXTENT, smsc47m1_driver.driver.name)) {
> -		dev_err(&adapter->dev, "Region 0x%x already in use!\n", address);
> +		dev_err(adapter->class_dev.dev, "Region 0x%x already in use!\n", address);

Line too long, please wrap.

>  		return -EBUSY;
>  	}
>  
> @@ -455,7 +455,8 @@ static int smsc47m1_detect(struct i2c_ad
>  	pwm2 = (smsc47m1_read_value(new_client, SMSC47M1_REG_PPIN(1)) & 0x05)
>  	       == 0x04;
>  	if (!(fan1 || fan2 || pwm1 || pwm2)) {
> -		dev_warn(&adapter->dev, "Device at 0x%x is not configured, "
> +		dev_warn(adapter->class_dev.dev,
> +			"Device at 0x%x is not configured, "
>  			 "will not use\n", new_client->addr);

Please add a space to align better.

>  		err = -ENODEV;
>  		goto error_free;
> Index: g26/drivers/hwmon/gl518sm.c
> ===================================================================
> --- g26.orig/drivers/hwmon/gl518sm.c	2006-11-06 11:50:26.000000000 -0800
> +++ g26/drivers/hwmon/gl518sm.c	2006-12-03 13:29:50.000000000 -0800
> @@ -433,7 +433,7 @@ static int gl518_detect(struct i2c_adapt
>  			kind = gl518sm_r80;
>  		} else {
>  			if (kind <= 0)
> -				dev_info(&adapter->dev,
> +				dev_info(adapter->class_dev.dev,
>  				    "Ignoring 'force' parameter for unknown "
>  				    "chip at adapter %d, address 0x%02x\n",
>  				    i2c_adapter_id(adapter), address);
> Index: g26/drivers/hwmon/adm1025.c
> ===================================================================
> --- g26.orig/drivers/hwmon/adm1025.c	2006-11-06 11:50:26.000000000 -0800
> +++ g26/drivers/hwmon/adm1025.c	2006-12-03 13:29:09.000000000 -0800
> @@ -404,7 +404,7 @@ static int adm1025_detect(struct i2c_ada
>  		     ADM1025_REG_STATUS1) & 0xC0) != 0x00
>  		 || (i2c_smbus_read_byte_data(new_client,
>  		     ADM1025_REG_STATUS2) & 0xBC) != 0x00) {
> -			dev_dbg(&adapter->dev,
> +			dev_dbg(adapter->class_dev.dev,
>  				"ADM1025 detection failed at 0x%02x.\n",
>  				address);
>  			goto exit_free;
> @@ -432,7 +432,7 @@ static int adm1025_detect(struct i2c_ada
>  		}
>  
>  		if (kind <= 0) { /* identification failed */
> -			dev_info(&adapter->dev,
> +			dev_info(adapter->class_dev.dev,
>  			    "Unsupported chip (man_id=0x%02X, "
>  			    "chip_id=0x%02X).\n", man_id, chip_id);
>  			goto exit_free;
> Index: g26/drivers/hwmon/lm85.c
> ===================================================================
> --- g26.orig/drivers/hwmon/lm85.c	2006-11-06 11:50:26.000000000 -0800
> +++ g26/drivers/hwmon/lm85.c	2006-12-03 13:33:09.000000000 -0800
> @@ -1144,14 +1144,15 @@ static int lm85_detect(struct i2c_adapte
>  	company = lm85_read_value(new_client, LM85_REG_COMPANY);
>  	verstep = lm85_read_value(new_client, LM85_REG_VERSTEP);
>  
> -	dev_dbg(&adapter->dev, "Detecting device at %d,0x%02x with"
> +	dev_dbg(adapter->class_dev.dev, "Detecting device at %d,0x%02x with"

For this driver too, a local dev variable would probably be welcome.

>  		" COMPANY: 0x%02x and VERSTEP: 0x%02x\n",
>  		i2c_adapter_id(new_client->adapter), new_client->addr,
>  		company, verstep);
>  
>  	/* If auto-detecting, Determine the chip type. */
>  	if (kind <= 0) {
> -		dev_dbg(&adapter->dev, "Autodetecting device at %d,0x%02x ...\n",
> +		dev_dbg(adapter->class_dev.dev,
> +			"Autodetecting device at %d,0x%02x ...\n",
>  			i2c_adapter_id(adapter), address );
>  		if( company == LM85_COMPANY_NATIONAL
>  		    && verstep == LM85_VERSTEP_LM85C ) {
> @@ -1161,7 +1162,8 @@ static int lm85_detect(struct i2c_adapte
>  			kind = lm85b ;
>  		} else if( company == LM85_COMPANY_NATIONAL
>  		    && (verstep & LM85_VERSTEP_VMASK) == LM85_VERSTEP_GENERIC ) {
> -			dev_err(&adapter->dev, "Unrecognized version/stepping 0x%02x"
> +			dev_err(adapter->class_dev.dev,
> +				"Unrecognized version/stepping 0x%02x"
>  				" Defaulting to LM85.\n", verstep);
>  			kind = any_chip ;
>  		} else if( company == LM85_COMPANY_ANALOG_DEV
> @@ -1173,7 +1175,8 @@ static int lm85_detect(struct i2c_adapte
>  			kind = adt7463 ;
>  		} else if( company == LM85_COMPANY_ANALOG_DEV
>  		    && (verstep & LM85_VERSTEP_VMASK) == LM85_VERSTEP_GENERIC ) {
> -			dev_err(&adapter->dev, "Unrecognized version/stepping 0x%02x"
> +			dev_err(adapter->class_dev.dev,
> +				"Unrecognized version/stepping 0x%02x"
>  				" Defaulting to Generic LM85.\n", verstep );
>  			kind = any_chip ;
>  		} else if( company == LM85_COMPANY_SMSC
> @@ -1191,19 +1194,24 @@ static int lm85_detect(struct i2c_adapte
>  			kind = emc6d102 ;
>  		} else if( company == LM85_COMPANY_SMSC
>  		    && (verstep & LM85_VERSTEP_VMASK) == LM85_VERSTEP_GENERIC) {
> -			dev_err(&adapter->dev, "lm85: Detected SMSC chip\n");
> -			dev_err(&adapter->dev, "lm85: Unrecognized version/stepping 0x%02x"
> -			    " Defaulting to Generic LM85.\n", verstep );
> +			dev_err(adapter->class_dev.dev,
> +				"lm85: Detected SMSC chip\n");
> +			dev_err(adapter->class_dev.dev,
> +				"lm85: Unrecognized version/stepping 0x%02x"
> +				" Defaulting to Generic LM85.\n", verstep );
>  			kind = any_chip ;
>  		} else if( kind == any_chip
>  		    && (verstep & LM85_VERSTEP_VMASK) == LM85_VERSTEP_GENERIC) {
> -			dev_err(&adapter->dev, "Generic LM85 Version 6 detected\n");
> +			dev_err(adapter->class_dev.dev,
> +				"Generic LM85 Version 6 detected\n");
>  			/* Leave kind as "any_chip" */
>  		} else {
> -			dev_dbg(&adapter->dev, "Autodetection failed\n");
> +			dev_dbg(adapter->class_dev.dev,
> +				"Autodetection failed\n");
>  			/* Not an LM85 ... */
>  			if( kind == any_chip ) {  /* User used force=x,y */
> -				dev_err(&adapter->dev, "Generic LM85 Version 6 not"
> +				dev_err(adapter->class_dev.dev,
> +					"Generic LM85 Version 6 not"
>  					" found at %d,0x%02x. Try force_lm85c.\n",
>  					i2c_adapter_id(adapter), address );
>  			}
> Index: g26/drivers/hwmon/lm78.c
> ===================================================================
> --- g26.orig/drivers/hwmon/lm78.c	2006-11-06 11:50:26.000000000 -0800
> +++ g26/drivers/hwmon/lm78.c	2006-12-03 13:30:31.000000000 -0800
> @@ -624,7 +624,8 @@ static int lm78_detect(struct i2c_adapte
>  			kind = lm79;
>  		else {
>  			if (kind == 0)
> -				dev_warn(&adapter->dev, "Ignoring 'force' "
> +				dev_warn(adapter->class_dev.dev,
> +					"Ignoring 'force' "
>  					"parameter for unknown chip at "
>  					"adapter %d, address 0x%02x\n",
>  					i2c_adapter_id(adapter), address);
> Index: g26/drivers/hwmon/max1619.c
> ===================================================================
> --- g26.orig/drivers/hwmon/max1619.c	2006-11-06 11:50:26.000000000 -0800
> +++ g26/drivers/hwmon/max1619.c	2006-12-03 13:34:44.000000000 -0800
> @@ -248,7 +248,7 @@ static int max1619_detect(struct i2c_ada
>  				MAX1619_REG_R_STATUS);
>  		if ((reg_config & 0x03) != 0x00
>  		 || reg_convrate > 0x07 || (reg_status & 0x61 ) !=0x00) {
> -			dev_dbg(&adapter->dev,
> +			dev_dbg(adapter->class_dev.dev,
>  				"MAX1619 detection failed at 0x%02x.\n",
>  				address);
>  			goto exit_free;
> @@ -267,7 +267,7 @@ static int max1619_detect(struct i2c_ada
>  			kind = max1619;
>  
>  		if (kind <= 0) { /* identification failed */
> -			dev_info(&adapter->dev,
> +			dev_info(adapter->class_dev.dev,
>  			    "Unsupported chip (man_id=0x%02X, "
>  			    "chip_id=0x%02X).\n", man_id, chip_id);
>  			goto exit_free;
> Index: g26/drivers/hwmon/lm90.c
> ===================================================================
> --- g26.orig/drivers/hwmon/lm90.c	2006-11-06 11:50:26.000000000 -0800
> +++ g26/drivers/hwmon/lm90.c	2006-12-03 13:33:56.000000000 -0800
> @@ -573,12 +573,12 @@ static int lm90_detect(struct i2c_adapte
>  			if (chip_id == man_id
>  			 && (reg_config1 & 0x1F) == (man_id & 0x0F)
>  			 && reg_convrate <= 0x09) {
> -			 	kind = max6657;
> +				kind = max6657;

Back out.

>  			}
>  		}
>  
>  		if (kind <= 0) { /* identification failed */
> -			dev_info(&adapter->dev,
> +			dev_info(adapter->class_dev.dev,
>  			    "Unsupported chip (man_id=0x%02X, "
>  			    "chip_id=0x%02X).\n", man_id, chip_id);
>  			goto exit_free;
> Index: g26/drivers/hwmon/lm83.c
> ===================================================================
> --- g26.orig/drivers/hwmon/lm83.c	2006-11-06 11:50:26.000000000 -0800
> +++ g26/drivers/hwmon/lm83.c	2006-12-03 13:31:21.000000000 -0800
> @@ -337,7 +337,7 @@ static int lm83_detect(struct i2c_adapte
>  		    & 0x48) != 0x00) ||
>  		    ((i2c_smbus_read_byte_data(new_client, LM83_REG_R_CONFIG)
>  		    & 0x41) != 0x00)) {
> -			dev_dbg(&adapter->dev,
> +			dev_dbg(adapter->class_dev.dev,
>  			    "LM83 detection failed at 0x%02x.\n", address);
>  			goto exit_free;
>  		}
> @@ -361,7 +361,7 @@ static int lm83_detect(struct i2c_adapte
>  		}
>  
>  		if (kind <= 0) { /* identification failed */
> -			dev_info(&adapter->dev,
> +			dev_info(adapter->class_dev.dev,
>  			    "Unsupported chip (man_id=0x%02X, "
>  			    "chip_id=0x%02X).\n", man_id, chip_id);
>  			goto exit_free;
> Index: g26/drivers/hwmon/w83l785ts.c
> ===================================================================
> --- g26.orig/drivers/hwmon/w83l785ts.c	2006-11-06 11:50:26.000000000 -0800
> +++ g26/drivers/hwmon/w83l785ts.c	2006-12-03 13:37:09.000000000 -0800
> @@ -187,7 +187,7 @@ static int w83l785ts_detect(struct i2c_a
>  		      W83L785TS_REG_CONFIG, 0) & 0x80) != 0x00)
>  		 || ((w83l785ts_read_value(new_client,
>  		      W83L785TS_REG_TYPE, 0) & 0xFC) != 0x00)) {
> -			dev_dbg(&adapter->dev,
> +			dev_dbg(adapter->class_dev.dev,
>  				"W83L785TS-S detection failed at 0x%02x.\n",
>  				address);
>  			goto exit_free;
> @@ -210,9 +210,9 @@ static int w83l785ts_detect(struct i2c_a
>  				kind = w83l785ts;			
>  			}
>  		}
> -	
> +

Back out.

>  		if (kind <= 0) { /* identification failed */
> -			dev_info(&adapter->dev,
> +			dev_info(adapter->class_dev.dev,
>  				 "Unsupported chip (man_id=0x%04X, "
>  				 "chip_id=0x%02X).\n", man_id, chip_id);
>  			goto exit_free;
> Index: g26/drivers/hwmon/via686a.c
> ===================================================================
> --- g26.orig/drivers/hwmon/via686a.c	2006-11-06 11:50:26.000000000 -0800
> +++ g26/drivers/hwmon/via686a.c	2006-12-03 13:36:32.000000000 -0800
> @@ -637,7 +637,7 @@ static int via686a_detect(struct i2c_ada
>  	/* 8231 requires multiple of 256, we enforce that on 686 as well */
>  	if (force_addr) {
>  		address = force_addr & 0xFF00;
> -		dev_warn(&adapter->dev, "forcing ISA address 0x%04X\n",
> +		dev_warn(adapter->class_dev.dev, "forcing ISA address 0x%04X\n",
>  			 address);
>  		if (PCIBIOS_SUCCESSFUL !=
>  		    pci_write_config_word(s_bridge, VIA686A_BASE_REG, address))
> @@ -648,13 +648,13 @@ static int via686a_detect(struct i2c_ada
>  		return -ENODEV;
>  	if (!(val & 0x0001)) {
>  		if (force_addr) {
> -			dev_info(&adapter->dev, "enabling sensors\n");
> +			dev_info(adapter->class_dev.dev, "enabling sensors\n");
>  			if (PCIBIOS_SUCCESSFUL !=
>  			    pci_write_config_word(s_bridge, VIA686A_ENABLE_REG,
>  						  val | 0x0001))
>  				return -ENODEV;
>  		} else {
> -			dev_warn(&adapter->dev, "sensors disabled - enable "
> +			dev_warn(adapter->class_dev.dev, "sensors disabled - enable "

Line too long, please split it earlier.

>  				 "with force_addr=0x%x\n", address);
>  			return -ENODEV;
>  		}
> @@ -663,7 +663,7 @@ static int via686a_detect(struct i2c_ada
>  	/* Reserve the ISA region */
>  	if (!request_region(address, VIA686A_EXTENT,
>  			    via686a_driver.driver.name)) {
> -		dev_err(&adapter->dev, "region 0x%x already in use!\n",
> +		dev_err(adapter->class_dev.dev, "region 0x%x already in use!\n",
>  			address);
>  		return -ENODEV;
>  	}
> Index: g26/drivers/hwmon/lm87.c
> ===================================================================
> --- g26.orig/drivers/hwmon/lm87.c	2006-11-06 11:50:26.000000000 -0800
> +++ g26/drivers/hwmon/lm87.c	2006-12-03 14:00:33.000000000 -0800
> @@ -652,7 +652,7 @@ static int lm87_detect(struct i2c_adapte
>  		if (rev < 0x01 || rev > 0x08
>  		 || (lm87_read_value(new_client, LM87_REG_CONFIG) & 0x80)
>  		 || lm87_read_value(new_client, LM87_REG_COMPANY_ID) != 0x02) {
> -			dev_dbg(&adapter->dev,
> +			dev_dbg(adapter->class_dev.dev,
>  				"LM87 detection failed at 0x%02x.\n",
>  				address);
>  			goto exit_free;
> Index: g26/drivers/hwmon/lm63.c
> ===================================================================
> --- g26.orig/drivers/hwmon/lm63.c	2006-11-06 11:50:26.000000000 -0800
> +++ g26/drivers/hwmon/lm63.c	2006-12-03 13:58:20.000000000 -0800
> @@ -474,7 +474,7 @@ static int lm63_detect(struct i2c_adapte
>  		 && (reg_alert_mask & 0xA4) == 0xA4) {
>  			kind = lm63;
>  		} else { /* failed */
> -			dev_dbg(&adapter->dev, "Unsupported chip "
> +			dev_dbg(adapter->class_dev.dev, "Unsupported chip "
>  				"(man_id=0x%02X, chip_id=0x%02X).\n",
>  				man_id, chip_id);
>  			goto exit_free;
> Index: g26/drivers/hwmon/sis5595.c
> ===================================================================
> --- g26.orig/drivers/hwmon/sis5595.c	2006-11-06 11:50:26.000000000 -0800
> +++ g26/drivers/hwmon/sis5595.c	2006-12-03 14:01:33.000000000 -0800
> @@ -538,7 +538,8 @@ static int sis5595_detect(struct i2c_ada
>  		goto exit;
>  	}
>  	if (force_addr) {
> -		dev_warn(&adapter->dev, "forcing ISA address 0x%04X\n", address);
> +		dev_warn(adapter->class_dev.dev,
> +			"forcing ISA address 0x%04X\n", address);
>  		if (PCIBIOS_SUCCESSFUL !=
>  		    pci_write_config_word(s_bridge, SIS5595_BASE_REG, address))
>  			goto exit_release;
> Index: g26/drivers/hwmon/adm9240.c
> ===================================================================
> --- g26.orig/drivers/hwmon/adm9240.c	2006-11-06 11:50:26.000000000 -0800
> +++ g26/drivers/hwmon/adm9240.c	2006-12-03 13:52:54.000000000 -0800
> @@ -539,7 +539,8 @@ static int adm9240_detect(struct i2c_ada
>  		/* verify chip: reg address should match i2c address */
>  		if (i2c_smbus_read_byte_data(new_client, ADM9240_REG_I2C_ADDR)
>  				!= address) {
> -			dev_err(&adapter->dev, "detect fail: address match, "
> +			dev_err(adapter->class_dev.dev,
> +					"detect fail: address match, "
>  					"0x%02x\n", address);
>  			goto exit_free;
>  		}
> @@ -554,7 +555,8 @@ static int adm9240_detect(struct i2c_ada
>  		} else if (man_id == 0x01) {
>  			kind = lm81;
>  		} else {
> -			dev_err(&adapter->dev, "detect fail: unknown manuf, "
> +			dev_err(adapter->class_dev.dev,
> +					"detect fail: unknown manuf, "
>  					"0x%02x\n", man_id);
>  			goto exit_free;
>  		}
> @@ -562,7 +564,7 @@ static int adm9240_detect(struct i2c_ada
>  		/* successful detect, print chip info */
>  		die_rev = i2c_smbus_read_byte_data(new_client,
>  				ADM9240_REG_DIE_REV);
> -		dev_info(&adapter->dev, "found %s revision %u\n",
> +		dev_info(adapter->class_dev.dev, "found %s revision %u\n",
>  				man_id == 0x23 ? "ADM9240" :
>  				man_id == 0xda ? "DS1780" : "LM81", die_rev);
>  	}
> Index: g26/drivers/hwmon/adm1026.c
> ===================================================================
> --- g26.orig/drivers/hwmon/adm1026.c	2006-11-06 11:50:26.000000000 -0800
> +++ g26/drivers/hwmon/adm1026.c	2006-12-03 13:44:51.000000000 -0800
> @@ -1619,11 +1619,13 @@ static int adm1026_detect(struct i2c_ada
>  			kind = adm1026;
>  		} else if (company == ADM1026_COMPANY_ANALOG_DEV
>  			&& (verstep & 0xf0) == ADM1026_VERSTEP_GENERIC) {
> -			dev_err(&adapter->dev, ": Unrecognized stepping "
> +			dev_err(adapter->class_dev.dev,
> +				"Unrecognized stepping "
>  				"0x%02x. Defaulting to ADM1026.\n", verstep);
>  			kind = adm1026;
>  		} else if ((verstep & 0xf0) == ADM1026_VERSTEP_GENERIC) {
> -			dev_err(&adapter->dev, ": Found version/stepping "
> +			dev_err(adapter->class_dev.dev,
> +				"Found version/stepping "
>  				"0x%02x. Assuming generic ADM1026.\n",
>  				verstep);
>  			kind = any_chip;
> @@ -1632,7 +1634,8 @@ static int adm1026_detect(struct i2c_ada
>  				"failed\n");
>  			/* Not an ADM1026 ... */
>  			if (kind == 0)  { /* User used force=x,y */
> -				dev_err(&adapter->dev, "Generic ADM1026 not "
> +				dev_err(adapter->class_dev.dev,
> +					"Generic ADM1026 not "
>  					"found at %d,0x%02x.  Try "
>  					"force_adm1026.\n",
>  					i2c_adapter_id(adapter), address);
> @@ -1651,7 +1654,8 @@ static int adm1026_detect(struct i2c_ada
>  		type_name = "adm1026";
>  		break;
>  	default :
> -		dev_err(&adapter->dev, ": Internal error, invalid "
> +		dev_err(adapter->class_dev.dev,
> +			"Internal error, invalid "
>  			"kind (%d)!", kind);
>  		err = -EFAULT;
>  		goto exitfree;
> Index: g26/drivers/hwmon/smsc47b397.c
> ===================================================================
> --- g26.orig/drivers/hwmon/smsc47b397.c	2006-11-06 11:50:26.000000000 -0800
> +++ g26/drivers/hwmon/smsc47b397.c	2006-12-03 14:07:54.000000000 -0800
> @@ -255,7 +255,8 @@ static int smsc47b397_detect(struct i2c_
>  
>  	if (!request_region(address, SMSC_EXTENT,
>  			    smsc47b397_driver.driver.name)) {
> -		dev_err(&adapter->dev, "Region 0x%x already in use!\n",
> +		dev_err(adapter->class_dev.dev,
> +			"Region 0x%x already in use!\n",
>  			address);
>  		return -EBUSY;
>  	}
> Index: g26/drivers/hwmon/smsc47m192.c
> ===================================================================
> --- g26.orig/drivers/hwmon/smsc47m192.c	2006-11-06 11:50:26.000000000 -0800
> +++ g26/drivers/hwmon/smsc47m192.c	2006-12-03 14:09:04.000000000 -0800
> @@ -517,11 +517,11 @@ static int smsc47m192_detect(struct i2c_
>  				SMSC47M192_REG_VID) & 0x70) == 0x00
>  		 && (i2c_smbus_read_byte_data(client,
>  				SMSC47M192_REG_VID4) & 0xfe) == 0x80) {
> -			dev_info(&adapter->dev,
> +			dev_info(adapter->class_dev.dev,
>  				 "found SMSC47M192 or SMSC47M997, "
>  				 "version 2, stepping A%d\n", version & 0x0f);
>  		} else {
> -			dev_dbg(&adapter->dev,
> +			dev_dbg(adapter->class_dev.dev,
>  				"SMSC47M192 detection failed at 0x%02x\n",
>  				address);
>  			goto exit_free;
> Index: g26/drivers/hwmon/vt8231.c
> ===================================================================
> --- g26.orig/drivers/hwmon/vt8231.c	2006-11-06 11:50:26.000000000 -0800
> +++ g26/drivers/hwmon/vt8231.c	2006-12-03 14:11:20.000000000 -0800
> @@ -690,7 +690,8 @@ int vt8231_detect(struct i2c_adapter *ad
>  	/* 8231 requires multiple of 256 */
>  	if (force_addr)	{
>  		isa_address = force_addr & 0xFF00;
> -		dev_warn(&adapter->dev, "forcing ISA address 0x%04X\n",
> +		dev_warn(adapter->class_dev.dev,
> +				"forcing ISA address 0x%04X\n",
>  				 isa_address);
>  		if (PCIBIOS_SUCCESSFUL != pci_write_config_word(s_bridge,
>  						VT8231_BASE_REG, isa_address))
> @@ -702,7 +703,7 @@ int vt8231_detect(struct i2c_adapter *ad
>  		return -ENODEV;
>  
>  	if (!(val & 0x0001)) {
> -		dev_warn(&adapter->dev, "enabling sensors\n");
> +		dev_warn(adapter->class_dev.dev, "enabling sensors\n");
>  		if (PCIBIOS_SUCCESSFUL !=
>  			pci_write_config_word(s_bridge, VT8231_ENABLE_REG,
>  							  val | 0x0001))
> @@ -712,8 +713,9 @@ int vt8231_detect(struct i2c_adapter *ad
>  	/* Reserve the ISA region */
>  	if (!request_region(isa_address, VT8231_EXTENT,
>  			    vt8231_pci_driver.name)) {
> -		dev_err(&adapter->dev, "region 0x%x already in use!\n",
> -			   isa_address);
> +		dev_err(adapter->class_dev.dev,
> +			"region 0x%x already in use!\n",
> +			isa_address);
>  		return -ENODEV;
>  	}
>  
> @@ -727,7 +729,6 @@ int vt8231_detect(struct i2c_adapter *ad
>  	client->addr = isa_address;
>  	client->adapter = adapter;
>  	client->driver = &vt8231_driver;
> -	client->dev.parent = &adapter->dev;

This change is independent and could be applied separate from the
patchset, right? If so, please provide a separate patch and I'll apply
it right away.

>  
>  	/* Fill in the remaining client fields and put into the global list */
>  	strlcpy(client->name, "vt8231", I2C_NAME_SIZE);

Please include the new w83793 driver in the next iteration of this
patch.

Thanks,
-- 
Jean Delvare



More information about the i2c mailing list