[i2c] [patch 2.6.20-rc1 1/6] hwmon stops using i2c_adapter.dev

David Brownell david-b at pacbell.net
Sun Dec 17 19:47:35 CET 2006


This updates the hwmon drivers to prepare for removing the undesirable
non-class i2c_adapter driver and its needless "i2c_adapter.dev" device.
That's used in dev_{err,dbg,info,warn}() diagnostics; the change switches
to using "adapter->class_dev.dev" instead of "&adapter->dev".

Signed-off-by: David Brownell <dbrownell at users.sourceforge.net>
---
 drivers/hwmon/adm1025.c    |    4 ++--
 drivers/hwmon/adm1026.c    |   12 ++++++++----
 drivers/hwmon/adm9240.c    |    8 +++++---
 drivers/hwmon/gl518sm.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       |    2 +-
 drivers/hwmon/max1619.c    |    4 ++--
 drivers/hwmon/sis5595.c    |    3 ++-
 drivers/hwmon/smsc47b397.c |    3 ++-
 drivers/hwmon/smsc47m1.c   |    6 ++++--
 drivers/hwmon/smsc47m192.c |    4 ++--
 drivers/hwmon/via686a.c    |    9 +++++----
 drivers/hwmon/vt8231.c     |   10 ++++++----
 drivers/hwmon/w83627hf.c   |    2 +-
 drivers/hwmon/w83781d.c    |   25 ++++++++++++++++---------
 drivers/hwmon/w83793.c     |    3 ++-
 drivers/hwmon/w83l785ts.c  |    4 ++--
 21 files changed, 85 insertions(+), 55 deletions(-)

Index: g26/drivers/hwmon/w83627hf.c
===================================================================
--- g26.orig/drivers/hwmon/w83627hf.c	2006-12-16 15:51:14.000000000 -0800
+++ g26/drivers/hwmon/w83627hf.c	2006-12-16 15:52:13.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-12-16 15:51:14.000000000 -0800
+++ g26/drivers/hwmon/w83781d.c	2006-12-16 15:52:13.000000000 -0800
@@ -1021,7 +1021,7 @@ 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,
 			"Cannot force I2C-only chip for ISA address 0x%02x.\n",
 			address);
 		err = -EINVAL;
@@ -1031,7 +1031,7 @@ w83781d_detect(struct i2c_adapter *adapt
 	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-12-16 15:51:14.000000000 -0800
+++ g26/drivers/hwmon/smsc47m1.c	2006-12-16 15:52:13.000000000 -0800
@@ -424,7 +424,8 @@ 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);
 		return -EBUSY;
 	}
 
@@ -455,7 +456,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);
 		err = -ENODEV;
 		goto error_free;
Index: g26/drivers/hwmon/gl518sm.c
===================================================================
--- g26.orig/drivers/hwmon/gl518sm.c	2006-12-16 15:51:14.000000000 -0800
+++ g26/drivers/hwmon/gl518sm.c	2006-12-16 15:52:13.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-12-16 15:51:14.000000000 -0800
+++ g26/drivers/hwmon/adm1025.c	2006-12-16 15:52:13.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-12-16 15:51:14.000000000 -0800
+++ g26/drivers/hwmon/lm85.c	2006-12-16 15:52:13.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"
 		" 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-12-16 15:51:14.000000000 -0800
+++ g26/drivers/hwmon/lm78.c	2006-12-16 15:52:13.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-12-16 15:51:14.000000000 -0800
+++ g26/drivers/hwmon/max1619.c	2006-12-16 15:52:13.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-12-16 15:51:14.000000000 -0800
+++ g26/drivers/hwmon/lm90.c	2006-12-16 15:52:13.000000000 -0800
@@ -578,7 +578,7 @@ static int lm90_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/lm83.c
===================================================================
--- g26.orig/drivers/hwmon/lm83.c	2006-12-16 15:51:14.000000000 -0800
+++ g26/drivers/hwmon/lm83.c	2006-12-16 15:52:13.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-12-16 15:51:14.000000000 -0800
+++ g26/drivers/hwmon/w83l785ts.c	2006-12-16 15:52:13.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;
@@ -212,7 +212,7 @@ static int w83l785ts_detect(struct i2c_a
 		}
 	
 		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-12-16 15:51:14.000000000 -0800
+++ g26/drivers/hwmon/via686a.c	2006-12-16 15:52:13.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,14 @@ 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 "
 				 "with force_addr=0x%x\n", address);
 			return -ENODEV;
 		}
@@ -663,7 +664,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-12-16 15:51:14.000000000 -0800
+++ g26/drivers/hwmon/lm87.c	2006-12-16 15:52:13.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-12-16 15:51:14.000000000 -0800
+++ g26/drivers/hwmon/lm63.c	2006-12-16 15:52:13.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-12-16 15:51:14.000000000 -0800
+++ g26/drivers/hwmon/sis5595.c	2006-12-16 15:52:13.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-12-16 15:51:14.000000000 -0800
+++ g26/drivers/hwmon/adm9240.c	2006-12-16 15:52:13.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-12-16 15:51:14.000000000 -0800
+++ g26/drivers/hwmon/adm1026.c	2006-12-16 15:52:13.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-12-16 15:51:14.000000000 -0800
+++ g26/drivers/hwmon/smsc47b397.c	2006-12-16 15:52:13.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-12-16 15:51:14.000000000 -0800
+++ g26/drivers/hwmon/smsc47m192.c	2006-12-16 15:52:13.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-12-16 15:52:02.000000000 -0800
+++ g26/drivers/hwmon/vt8231.c	2006-12-16 15:52:13.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;
 	}
 
Index: g26/drivers/hwmon/w83793.c
===================================================================
--- g26.orig/drivers/hwmon/w83793.c	2006-12-16 15:51:14.000000000 -0800
+++ g26/drivers/hwmon/w83793.c	2006-12-16 15:52:13.000000000 -0800
@@ -1244,7 +1244,8 @@ static int w83793_detect(struct i2c_adap
 			kind = w83793;
 		} else {
 			if (kind == 0)
-				dev_warn(&adapter->dev, "w83793: Ignoring "
+				dev_warn(adapter->class_dev.dev,
+					 "w83793: Ignoring "
 					 "'force' parameter for unknown chip "
 					 "at address 0x%02x\n", address);
 			err = -ENODEV;



More information about the i2c mailing list