[i2c] [patch 2.6.20-rc1 5/6] remove i2c_adapter.dev from i2c core and adapters

David Brownell david-b at pacbell.net
Mon Dec 18 22:21:21 CET 2006


Some I2C driver model core cleanup, removing:

  - Inappropriate "i2c_adapter.dev"; users of that should have used
    (or, for adapters, provided) i2c_adapter.class_dev.dev instead.

  - The non-class "i2c-adapter" driver, which should never have been
    needed given the i2c_adapter class.

And corresponding changes to all I2C adapter drivers:

  - LOTS of one-line updates to adapter init: don't set the parent of
    a no-longer-existing device, set i2c_adapter.class_dev.dev instead.

  - The "i2c-isa" driver needed somewhat larger changes, since it was
    directly mucking about with the stuff that was removed.

This shrinks the data footprint for each I2C adapter by a fair amount,
and i2c core code (and data) space by a bit.  Later, the core can shrink
more, removing lists and pointers duplicating more driver model functions.

To cope with incomplete driver model conversions in I2C bus drivers, if
there's no real device associated with the adapter, a warning is issued
and a "legacy_i2c_adapter" platform device is created.  One hopes all
the I2C bus drivers will be fixed over the next year or so, letting that
hack be removed.

Signed-off-by: David Brownell <dbrownell at users.sourceforge.net>

---
Updated to match feedback from Jean re previous patches.

 drivers/i2c/busses/i2c-ali1535.c           |    4 -
 drivers/i2c/busses/i2c-ali1563.c           |    2 
 drivers/i2c/busses/i2c-ali15x3.c           |    4 -
 drivers/i2c/busses/i2c-amd756.c            |    4 -
 drivers/i2c/busses/i2c-amd8111.c           |    4 -
 drivers/i2c/busses/i2c-at91.c              |    2 
 drivers/i2c/busses/i2c-hydra.c             |    2 
 drivers/i2c/busses/i2c-i801.c              |    4 -
 drivers/i2c/busses/i2c-i810.c              |    6 -
 drivers/i2c/busses/i2c-ibm_iic.c           |    1 
 drivers/i2c/busses/i2c-iop3xx.c            |    2 
 drivers/i2c/busses/i2c-isa.c               |   53 ++++++----------
 drivers/i2c/busses/i2c-ixp2000.c           |    2 
 drivers/i2c/busses/i2c-ixp4xx.c            |    2 
 drivers/i2c/busses/i2c-mpc.c               |    2 
 drivers/i2c/busses/i2c-mv64xxx.c           |    1 
 drivers/i2c/busses/i2c-nforce2.c           |    2 
 drivers/i2c/busses/i2c-ocores.c            |    2 
 drivers/i2c/busses/i2c-omap.c              |    2 
 drivers/i2c/busses/i2c-piix4.c             |    4 -
 drivers/i2c/busses/i2c-pnx.c               |    2 
 drivers/i2c/busses/i2c-powermac.c          |    2 
 drivers/i2c/busses/i2c-prosavage.c         |    2 
 drivers/i2c/busses/i2c-pxa.c               |    2 
 drivers/i2c/busses/i2c-s3c2410.c           |    2 
 drivers/i2c/busses/i2c-savage4.c           |    4 -
 drivers/i2c/busses/i2c-sis5595.c           |    4 -
 drivers/i2c/busses/i2c-sis630.c            |    4 -
 drivers/i2c/busses/i2c-sis96x.c            |    4 -
 drivers/i2c/busses/i2c-versatile.c         |    2 
 drivers/i2c/busses/i2c-via.c               |    4 -
 drivers/i2c/busses/i2c-viapro.c            |    2 
 drivers/i2c/busses/i2c-voodoo3.c           |    6 -
 drivers/i2c/i2c-core.c                     |   94 ++++++++++++-----------------
 drivers/media/common/saa7146_i2c.c         |    2 
 drivers/media/dvb/pluto2/pluto2.c          |    2 
 drivers/media/video/bt8xx/bttv-i2c.c       |    2 
 drivers/media/video/cx88/cx88-i2c.c        |    2 
 drivers/media/video/cx88/cx88-vp3054-i2c.c |    2 
 drivers/media/video/em28xx/em28xx-i2c.c    |    2 
 drivers/media/video/saa7134/saa7134-i2c.c  |    2 
 drivers/video/aty/radeon_i2c.c             |    2 
 drivers/video/i810/i810-i2c.c              |    2 
 drivers/video/intelfb/intelfb_i2c.c        |    2 
 drivers/video/nvidia/nv_i2c.c              |    2 
 drivers/video/riva/rivafb-i2c.c            |    2 
 drivers/video/savage/savagefb-i2c.c        |    2 
 include/linux/i2c.h                        |    9 +-
 48 files changed, 124 insertions(+), 150 deletions(-)

Index: g26/include/linux/i2c.h
===================================================================
--- g26.orig/include/linux/i2c.h	2006-12-18 12:15:26.000000000 -0800
+++ g26/include/linux/i2c.h	2006-12-18 13:05:40.000000000 -0800
@@ -37,8 +37,6 @@
 
 /* --- For i2c-isa ---------------------------------------------------- */
 
-extern void i2c_adapter_dev_release(struct device *dev);
-extern struct device_driver i2c_adapter_driver;
 extern struct class i2c_adapter_class;
 extern struct bus_type i2c_bus_type;
 
@@ -222,8 +220,9 @@ struct i2c_adapter {
 
 	int timeout;
 	int retries;
-	struct device dev;		/* the adapter device */
 	struct class_device class_dev;	/* the class device */
+	struct platform_device *legacy_hack;
+	void *adapdata;
 
 	int nr;
 	struct list_head clients;
@@ -237,12 +236,12 @@ struct i2c_adapter {
 
 static inline void *i2c_get_adapdata (struct i2c_adapter *dev)
 {
-	return dev_get_drvdata (&dev->dev);
+	return dev->adapdata;
 }
 
 static inline void i2c_set_adapdata (struct i2c_adapter *dev, void *data)
 {
-	dev_set_drvdata (&dev->dev, data);
+	dev->adapdata = data;
 }
 
 /*flags for the client struct: */
Index: g26/drivers/i2c/i2c-core.c
===================================================================
--- g26.orig/drivers/i2c/i2c-core.c	2006-12-18 12:48:50.000000000 -0800
+++ g26/drivers/i2c/i2c-core.c	2006-12-18 13:08:25.000000000 -0800
@@ -83,36 +83,29 @@ struct bus_type i2c_bus_type = {
 	.resume =       i2c_bus_resume,
 };
 
-void i2c_adapter_dev_release(struct device *dev)
-{
-	struct i2c_adapter *adap = dev_to_i2c_adapter(dev);
-	complete(&adap->dev_released);
-}
-
-struct device_driver i2c_adapter_driver = {
-	.owner = THIS_MODULE,
-	.name =	"i2c_adapter",
-	.bus = &i2c_bus_type,
-};
-
 static void i2c_adapter_class_dev_release(struct class_device *dev)
 {
 	struct i2c_adapter *adap = class_dev_to_i2c_adapter(dev);
 	complete(&adap->class_dev_released);
 }
 
-struct class i2c_adapter_class = {
-	.owner =	THIS_MODULE,
-	.name =		"i2c-adapter",
-	.release =	&i2c_adapter_class_dev_release,
-};
-
-static ssize_t show_adapter_name(struct device *dev, struct device_attribute *attr, char *buf)
+static ssize_t show_adapter_name(struct class_device *cdev, char *buf)
 {
-	struct i2c_adapter *adap = dev_to_i2c_adapter(dev);
+	struct i2c_adapter *adap = class_dev_to_i2c_adapter(cdev);
 	return sprintf(buf, "%s\n", adap->name);
 }
-static DEVICE_ATTR(name, S_IRUGO, show_adapter_name, NULL);
+
+static struct class_device_attribute adapter_attrs[] = {
+	__ATTR(name, S_IRUGO, show_adapter_name, NULL),
+	{ },
+};
+
+struct class i2c_adapter_class = {
+	.name =			"i2c-adapter",
+	.owner =		THIS_MODULE,
+	.class_dev_attrs =	adapter_attrs,
+	.release =		&i2c_adapter_class_dev_release,
+};
 
 
 static void i2c_client_release(struct device *dev)
@@ -172,30 +165,34 @@ int i2c_add_adapter(struct i2c_adapter *
 	list_add_tail(&adap->list,&adapters);
 	INIT_LIST_HEAD(&adap->clients);
 
-	/* Add the adapter to the driver core.
-	 * If the parent pointer is not set up,
-	 * we add this adapter to the host bus.
+	/* Caller must have zero-initialized adap->class_dev, then
+	 * initialized adap->class_dev.dev as the real device so we
+	 * can properly add this adapter to the i2c_adapter class.
+	 *
+	 * As a **TEMPORARY migration aid** we create a platform
+	 * device for drivers that don't yet use the driver model.
+	 * Expect this to vanish by January 2008.
 	 */
-	if (adap->dev.parent == NULL)
-		adap->dev.parent = &platform_bus;
-	sprintf(adap->dev.bus_id, "i2c-%d", adap->nr);
-	adap->dev.driver = &i2c_adapter_driver;
-	adap->dev.release = &i2c_adapter_dev_release;
-	res = device_register(&adap->dev);
-	if (res)
-		goto out_list;
-	res = device_create_file(&adap->dev, &dev_attr_name);
-	if (res)
-		goto out_unregister;
+	if (!dev) {
+		printk(KERN_WARNING "I2C bus '%s' has no device; "
+			"convert it to the driver model\n",
+			adap->name);
+		adap->legacy_hack = platform_device_register_simple(
+			"legacy_i2c_adapter", adap->nr, NULL, 0);
+		if (adap->legacy_hack) {
+			dev = &adap->legacy_hack->dev;
+			adap->class_dev.dev = dev;
+		} else {
+			res = -ENODEV;
+			goto out_unlock;
+		}
+	}
 
-	/* Add this adapter to the i2c_adapter class */
-	memset(&adap->class_dev, 0x00, sizeof(struct class_device));
-	adap->class_dev.dev = &adap->dev;
+	sprintf(adap->class_dev.class_id, "i2c-%d", adap->nr);
 	adap->class_dev.class = &i2c_adapter_class;
-	strlcpy(adap->class_dev.class_id, adap->dev.bus_id, BUS_ID_SIZE);
 	res = class_device_register(&adap->class_dev);
 	if (res)
-		goto out_remove_name;
+		goto out_list;
 
 	dev_dbg(dev, "adapter %s [%s] registered\n",
 			adap->class_dev.class_id, adap->name);
@@ -212,14 +209,9 @@ out_unlock:
 	mutex_unlock(&core_lists);
 	return res;
 
-out_remove_name:
-	device_remove_file(&adap->dev, &dev_attr_name);
-out_unregister:
-	init_completion(&adap->dev_released); /* Needed? */
-	device_unregister(&adap->dev);
-	wait_for_completion(&adap->dev_released);
 out_list:
 	list_del(&adap->list);
+	platform_device_put(adap->legacy_hack);
 	idr_remove(&i2c_adapter_idr, adap->nr);
 	goto out_unlock;
 }
@@ -276,8 +268,6 @@ int i2c_del_adapter(struct i2c_adapter *
 	init_completion(&adap->dev_released);
 	init_completion(&adap->class_dev_released);
 	class_device_unregister(&adap->class_dev);
-	device_remove_file(&adap->dev, &dev_attr_name);
-	device_unregister(&adap->dev);
 	list_del(&adap->list);
 
 	/* wait for sysfs to drop all references */
@@ -426,7 +416,7 @@ int i2c_attach_client(struct i2c_client 
 
 	client->usage_count = 0;
 
-	client->dev.parent = &client->adapter->dev;
+	client->dev.parent = adapter->class_dev.dev;
 	client->dev.driver = &client->driver->driver;
 	client->dev.bus = &i2c_bus_type;
 	client->dev.release = &i2c_client_release;
@@ -575,16 +565,12 @@ static int __init i2c_init(void)
 	retval = bus_register(&i2c_bus_type);
 	if (retval)
 		return retval;
-	retval = driver_register(&i2c_adapter_driver);
-	if (retval)
-		return retval;
 	return class_register(&i2c_adapter_class);
 }
 
 static void __exit i2c_exit(void)
 {
 	class_unregister(&i2c_adapter_class);
-	driver_unregister(&i2c_adapter_driver);
 	bus_unregister(&i2c_bus_type);
 }
 
@@ -1177,8 +1163,6 @@ s32 i2c_smbus_xfer(struct i2c_adapter * 
 
 
 /* Next four are needed by i2c-isa */
-EXPORT_SYMBOL_GPL(i2c_adapter_dev_release);
-EXPORT_SYMBOL_GPL(i2c_adapter_driver);
 EXPORT_SYMBOL_GPL(i2c_adapter_class);
 EXPORT_SYMBOL_GPL(i2c_bus_type);
 
Index: g26/drivers/i2c/busses/i2c-isa.c
===================================================================
--- g26.orig/drivers/i2c/busses/i2c-isa.c	2006-12-18 13:04:39.000000000 -0800
+++ g26/drivers/i2c/busses/i2c-isa.c	2006-12-18 13:05:40.000000000 -0800
@@ -56,21 +56,24 @@ static struct i2c_adapter isa_adapter = 
 	.name		= "ISA main adapter",
 };
 
-/* We can't do a thing... */
-static u32 isa_func(struct i2c_adapter *adapter)
+static void i2c_isa_dev_release(struct device *dev)
 {
-	return 0;
+	complete(&isa_adapter.dev_released);
 }
 
+static struct platform_device i2c_isa_dev = {
+	.name		= "i2c_isa",
+	.id		= -1,
+	.dev = {
+		.release = i2c_isa_dev_release,
+	},
+};
 
-/* Copied from i2c-core */
-static ssize_t show_adapter_name(struct device *dev,
-		struct device_attribute *attr, char *buf)
+/* We can't do a thing... */
+static u32 isa_func(struct i2c_adapter *adapter)
 {
-	struct i2c_adapter *adap = dev_to_i2c_adapter(dev);
-	return sprintf(buf, "%s\n", adap->name);
+	return 0;
 }
-static DEVICE_ATTR(name, S_IRUGO, show_adapter_name, NULL);
 
 
 /* We implement an interface which resembles i2c_{add,del}_driver,
@@ -137,44 +140,33 @@ static int __init i2c_isa_init(void)
 
 	mutex_init(&isa_adapter.clist_lock);
 	INIT_LIST_HEAD(&isa_adapter.clients);
+	init_completion(&isa_adapter.dev_released);
+	init_completion(&isa_adapter.class_dev_released);
 
 	isa_adapter.nr = ANY_I2C_ISA_BUS;
-	isa_adapter.dev.parent = &platform_bus;
-	sprintf(isa_adapter.dev.bus_id, "i2c-%d", isa_adapter.nr);
-	isa_adapter.dev.driver = &i2c_adapter_driver;
-	isa_adapter.dev.release = &i2c_adapter_dev_release;
-	err = device_register(&isa_adapter.dev);
+	sprintf(isa_adapter.class_dev.class_id, "i2c-%d", isa_adapter.nr);
+
+	err = platform_device_register(&i2c_isa_dev);
 	if (err) {
 		printk(KERN_ERR "i2c-isa: Failed to register device\n");
 		goto exit;
 	}
-	err = device_create_file(&isa_adapter.dev, &dev_attr_name);
-	if (err) {
-		printk(KERN_ERR "i2c-isa: Failed to create name file\n");
-		goto exit_unregister;
-	}
 
 	/* Add this adapter to the i2c_adapter class */
-	memset(&isa_adapter.class_dev, 0x00, sizeof(struct class_device));
-	isa_adapter.class_dev.dev = &isa_adapter.dev;
+	isa_adapter.class_dev.dev = &i2c_isa_dev.dev;
 	isa_adapter.class_dev.class = &i2c_adapter_class;
-	strlcpy(isa_adapter.class_dev.class_id, isa_adapter.dev.bus_id,
-		BUS_ID_SIZE);
 	err = class_device_register(&isa_adapter.class_dev);
 	if (err) {
 		printk(KERN_ERR "i2c-isa: Failed to register class device\n");
-		goto exit_remove_name;
+		goto exit_unregister;
 	}
 
 	dev_dbg(isa_adapter.class_dev.dev, "%s registered\n", isa_adapter.name);
 
 	return 0;
 
-exit_remove_name:
-	device_remove_file(&isa_adapter.dev, &dev_attr_name);
 exit_unregister:
-	init_completion(&isa_adapter.dev_released); /* Needed? */
-	device_unregister(&isa_adapter.dev);
+	platform_device_unregister(&i2c_isa_dev);
 	wait_for_completion(&isa_adapter.dev_released);
 exit:
 	return err;
@@ -203,11 +195,8 @@ static void __exit i2c_isa_exit(void)
 
 	/* Clean up the sysfs representation */
 	dev_dbg(isa_adapter.class_dev.dev, "Unregistering from sysfs\n");
-	init_completion(&isa_adapter.dev_released);
-	init_completion(&isa_adapter.class_dev_released);
 	class_device_unregister(&isa_adapter.class_dev);
-	device_remove_file(&isa_adapter.dev, &dev_attr_name);
-	device_unregister(&isa_adapter.dev);
+	platform_device_unregister(&i2c_isa_dev);
 
 	/* Wait for sysfs to drop all references */
 	dev_dbg(isa_adapter.class_dev.dev, "Waiting for sysfs completion\n");
Index: g26/drivers/i2c/busses/i2c-at91.c
===================================================================
--- g26.orig/drivers/i2c/busses/i2c-at91.c	2006-12-18 13:04:39.000000000 -0800
+++ g26/drivers/i2c/busses/i2c-at91.c	2006-12-18 13:05:40.000000000 -0800
@@ -229,7 +229,7 @@ static int __devinit at91_i2c_probe(stru
 	sprintf(adapter->name, "AT91");
 	adapter->algo = &at91_algorithm;
 	adapter->class = I2C_CLASS_HWMON;
-	adapter->dev.parent = &pdev->dev;
+	adapter->class_dev.dev = &pdev->dev;
 
 	platform_set_drvdata(pdev, adapter);
 
Index: g26/drivers/i2c/busses/i2c-ali1535.c
===================================================================
--- g26.orig/drivers/i2c/busses/i2c-ali1535.c	2006-12-18 13:04:39.000000000 -0800
+++ g26/drivers/i2c/busses/i2c-ali1535.c	2006-12-18 13:05:40.000000000 -0800
@@ -498,8 +498,8 @@ static int __devinit ali1535_probe(struc
 		return -ENODEV;
 	}
 
-	/* set up the driverfs linkage to our parent device */
-	ali1535_adapter.dev.parent = &dev->dev;
+	/* set up the driver model linkage to our parent device */
+	ali1535_adapter.class_dev.dev = &dev->dev;
 
 	snprintf(ali1535_adapter.name, I2C_NAME_SIZE, 
 		"SMBus ALI1535 adapter at %04x", ali1535_smba);
Index: g26/drivers/i2c/busses/i2c-ali1563.c
===================================================================
--- g26.orig/drivers/i2c/busses/i2c-ali1563.c	2006-12-18 13:04:39.000000000 -0800
+++ g26/drivers/i2c/busses/i2c-ali1563.c	2006-12-18 13:05:40.000000000 -0800
@@ -390,7 +390,7 @@ static int __devinit ali1563_probe(struc
 
 	if ((error = ali1563_setup(dev)))
 		return error;
-	ali1563_adapter.dev.parent = &dev->dev;
+	ali1563_adapter.class_dev.dev = &dev->dev;
 	sprintf(ali1563_adapter.name,"SMBus ALi 1563 Adapter @ %04x",
 		ali1563_smba);
 	if ((error = i2c_add_adapter(&ali1563_adapter)))
Index: g26/drivers/i2c/busses/i2c-ali15x3.c
===================================================================
--- g26.orig/drivers/i2c/busses/i2c-ali15x3.c	2006-12-18 13:04:39.000000000 -0800
+++ g26/drivers/i2c/busses/i2c-ali15x3.c	2006-12-18 13:05:40.000000000 -0800
@@ -495,8 +495,8 @@ static int __devinit ali15x3_probe(struc
 		return -ENODEV;
 	}
 
-	/* set up the driverfs linkage to our parent device */
-	ali15x3_adapter.dev.parent = &dev->dev;
+	/* set up the driver model linkage to our parent device */
+	ali15x3_adapter.class_dev.dev = &dev->dev;
 
 	snprintf(ali15x3_adapter.name, I2C_NAME_SIZE,
 		"SMBus ALI15X3 adapter at %04x", ali15x3_smba);
Index: g26/drivers/i2c/busses/i2c-amd756.c
===================================================================
--- g26.orig/drivers/i2c/busses/i2c-amd756.c	2006-12-18 13:04:39.000000000 -0800
+++ g26/drivers/i2c/busses/i2c-amd756.c	2006-12-18 13:05:40.000000000 -0800
@@ -379,8 +379,8 @@ static int __devinit amd756_probe(struct
 	dev_dbg(&pdev->dev, "SMBREV = 0x%X\n", temp);
 	dev_dbg(&pdev->dev, "AMD756_smba = 0x%X\n", amd756_ioport);
 
-	/* set up the driverfs linkage to our parent device */
-	amd756_smbus.dev.parent = &pdev->dev;
+	/* set up the driver model linkage to our parent device */
+	amd756_smbus.class_dev.dev = &pdev->dev;
 
 	sprintf(amd756_smbus.name, "SMBus %s adapter at %04x",
 		chipname[id->driver_data], amd756_ioport);
Index: g26/drivers/i2c/busses/i2c-amd8111.c
===================================================================
--- g26.orig/drivers/i2c/busses/i2c-amd8111.c	2006-12-18 13:04:39.000000000 -0800
+++ g26/drivers/i2c/busses/i2c-amd8111.c	2006-12-18 13:05:40.000000000 -0800
@@ -356,8 +356,8 @@ static int __devinit amd8111_probe(struc
 	smbus->adapter.algo = &smbus_algorithm;
 	smbus->adapter.algo_data = smbus;
 
-	/* set up the driverfs linkage to our parent device */
-	smbus->adapter.dev.parent = &dev->dev;
+	/* set up the driver model linkage to our parent device */
+	smbus->adapter.class_dev.dev = &dev->dev;
 
 	error = i2c_add_adapter(&smbus->adapter);
 	if (error)
Index: g26/drivers/i2c/busses/i2c-hydra.c
===================================================================
--- g26.orig/drivers/i2c/busses/i2c-hydra.c	2006-12-18 12:15:26.000000000 -0800
+++ g26/drivers/i2c/busses/i2c-hydra.c	2006-12-18 13:05:40.000000000 -0800
@@ -133,7 +133,7 @@ static int __devinit hydra_probe(struct 
 	}
 
 	pdregw(hydra_bit_data.data, 0);		/* clear SCLK_OE and SDAT_OE */
-	hydra_adap.dev.parent = &dev->dev;
+	hydra_adap.class_dev.dev = &dev->dev;
 	res = i2c_bit_add_bus(&hydra_adap);
 	if (res < 0) {
 		iounmap(hydra_bit_data.data);
Index: g26/drivers/i2c/busses/i2c-i801.c
===================================================================
--- g26.orig/drivers/i2c/busses/i2c-i801.c	2006-12-18 12:15:26.000000000 -0800
+++ g26/drivers/i2c/busses/i2c-i801.c	2006-12-18 13:05:40.000000000 -0800
@@ -522,8 +522,8 @@ static int __devinit i801_probe(struct p
 	else
 		dev_dbg(&dev->dev, "SMBus using PCI Interrupt\n");
 
-	/* set up the driverfs linkage to our parent device */
-	i801_adapter.dev.parent = &dev->dev;
+	/* set up the driver model linkage to our parent device */
+	i801_adapter.class_dev.dev = &dev->dev;
 
 	snprintf(i801_adapter.name, I2C_NAME_SIZE,
 		"SMBus I801 adapter at %04lx", i801_smba);
Index: g26/drivers/i2c/busses/i2c-i810.c
===================================================================
--- g26.orig/drivers/i2c/busses/i2c-i810.c	2006-12-18 12:15:26.000000000 -0800
+++ g26/drivers/i2c/busses/i2c-i810.c	2006-12-18 13:05:40.000000000 -0800
@@ -210,9 +210,9 @@ static int __devinit i810_probe(struct p
 		return retval;
 	dev_info(&dev->dev, "i810/i815 i2c device found.\n");
 
-	/* set up the sysfs linkage to our parent device */
-	i810_i2c_adapter.dev.parent = &dev->dev;
-	i810_ddc_adapter.dev.parent = &dev->dev;
+	/* set up the driver model linkage to our parent device */
+	i810_i2c_adapter.class_dev.dev = &dev->dev;
+	i810_ddc_adapter.class_dev.dev = &dev->dev;
 
 	retval = i2c_bit_add_bus(&i810_i2c_adapter);
 	if (retval)
Index: g26/drivers/i2c/busses/i2c-ibm_iic.c
===================================================================
--- g26.orig/drivers/i2c/busses/i2c-ibm_iic.c	2006-12-18 12:15:26.000000000 -0800
+++ g26/drivers/i2c/busses/i2c-ibm_iic.c	2006-12-18 13:05:40.000000000 -0800
@@ -727,6 +727,7 @@ static int __devinit iic_probe(struct oc
 	
 	/* Register it with i2c layer */
 	adap = &dev->adap;
+	adap->class_dev.dev = &ocp->dev;
 	strcpy(adap->name, "IBM IIC");
 	i2c_set_adapdata(adap, dev);
 	adap->id = I2C_HW_OCP;
Index: g26/drivers/i2c/busses/i2c-iop3xx.c
===================================================================
--- g26.orig/drivers/i2c/busses/i2c-iop3xx.c	2006-12-18 12:15:26.000000000 -0800
+++ g26/drivers/i2c/busses/i2c-iop3xx.c	2006-12-18 13:05:40.000000000 -0800
@@ -491,7 +491,7 @@ iop3xx_i2c_probe(struct platform_device 
 	memcpy(new_adapter->name, pdev->name, strlen(pdev->name));
 	new_adapter->id = I2C_HW_IOP3XX;
 	new_adapter->owner = THIS_MODULE;
-	new_adapter->dev.parent = &pdev->dev;
+	new_adapter->class_dev.dev = &pdev->dev;
 
 	/*
 	 * Default values...should these come in from board code?
Index: g26/drivers/i2c/busses/i2c-ixp2000.c
===================================================================
--- g26.orig/drivers/i2c/busses/i2c-ixp2000.c	2006-12-18 12:15:26.000000000 -0800
+++ g26/drivers/i2c/busses/i2c-ixp2000.c	2006-12-18 13:05:40.000000000 -0800
@@ -121,7 +121,7 @@ static int ixp2000_i2c_probe(struct plat
 		I2C_NAME_SIZE);
 	drv_data->adapter.algo_data = &drv_data->algo_data,
 
-	drv_data->adapter.dev.parent = &plat_dev->dev;
+	drv_data->adapter.class_dev.dev = &plat_dev->dev;
 
 	gpio_line_config(gpio->sda_pin, GPIO_IN);
 	gpio_line_config(gpio->scl_pin, GPIO_IN);
Index: g26/drivers/i2c/busses/i2c-ixp4xx.c
===================================================================
--- g26.orig/drivers/i2c/busses/i2c-ixp4xx.c	2006-12-18 12:15:26.000000000 -0800
+++ g26/drivers/i2c/busses/i2c-ixp4xx.c	2006-12-18 13:05:40.000000000 -0800
@@ -130,7 +130,7 @@ static int ixp4xx_i2c_probe(struct platf
 		I2C_NAME_SIZE);
 	drv_data->adapter.algo_data = &drv_data->algo_data;
 
-	drv_data->adapter.dev.parent = &plat_dev->dev;
+	drv_data->adapter.class_dev.dev = &plat_dev->dev;
 
 	gpio_line_config(gpio->scl_pin, IXP4XX_GPIO_IN);
 	gpio_line_config(gpio->sda_pin, IXP4XX_GPIO_IN);
Index: g26/drivers/i2c/busses/i2c-mpc.c
===================================================================
--- g26.orig/drivers/i2c/busses/i2c-mpc.c	2006-12-18 12:15:26.000000000 -0800
+++ g26/drivers/i2c/busses/i2c-mpc.c	2006-12-18 13:05:40.000000000 -0800
@@ -329,7 +329,7 @@ static int fsl_i2c_probe(struct platform
 
 	i2c->adap = mpc_ops;
 	i2c_set_adapdata(&i2c->adap, i2c);
-	i2c->adap.dev.parent = &pdev->dev;
+	i2c->adap.class_dev.dev = &pdev->dev;
 	if ((result = i2c_add_adapter(&i2c->adap)) < 0) {
 		printk(KERN_ERR "i2c-mpc - failed to add adapter\n");
 		goto fail_add;
Index: g26/drivers/i2c/busses/i2c-mv64xxx.c
===================================================================
--- g26.orig/drivers/i2c/busses/i2c-mv64xxx.c	2006-12-18 12:15:26.000000000 -0800
+++ g26/drivers/i2c/busses/i2c-mv64xxx.c	2006-12-18 13:05:40.000000000 -0800
@@ -520,6 +520,7 @@ mv64xxx_i2c_probe(struct platform_device
 		rc = -ENXIO;
 		goto exit_unmap_regs;
 	}
+	drv_data->adapter.class_dev.dev = &pd->dev;
 	drv_data->adapter.id = I2C_HW_MV64XXX;
 	drv_data->adapter.algo = &mv64xxx_i2c_algo;
 	drv_data->adapter.owner = THIS_MODULE;
Index: g26/drivers/i2c/busses/i2c-ocores.c
===================================================================
--- g26.orig/drivers/i2c/busses/i2c-ocores.c	2006-12-18 12:15:26.000000000 -0800
+++ g26/drivers/i2c/busses/i2c-ocores.c	2006-12-18 13:05:40.000000000 -0800
@@ -262,7 +262,7 @@ static int __devinit ocores_i2c_probe(st
 	platform_set_drvdata(pdev, i2c);
 	i2c->adap = ocores_adapter;
 	i2c_set_adapdata(&i2c->adap, i2c);
-	i2c->adap.dev.parent = &pdev->dev;
+	i2c->adap.class_dev.dev = &pdev->dev;
 
 	/* add i2c adapter to i2c tree */
 	ret = i2c_add_adapter(&i2c->adap);
Index: g26/drivers/i2c/busses/i2c-omap.c
===================================================================
--- g26.orig/drivers/i2c/busses/i2c-omap.c	2006-12-18 12:15:26.000000000 -0800
+++ g26/drivers/i2c/busses/i2c-omap.c	2006-12-18 13:05:40.000000000 -0800
@@ -602,7 +602,7 @@ omap_i2c_probe(struct platform_device *p
 	adap->class = I2C_CLASS_HWMON;
 	strncpy(adap->name, "OMAP I2C adapter", sizeof(adap->name));
 	adap->algo = &omap_i2c_algo;
-	adap->dev.parent = &pdev->dev;
+	adap->class_dev.dev = &pdev->dev;
 
 	/* i2c device drivers may be active on return from add_adapter() */
 	r = i2c_add_adapter(adap);
Index: g26/drivers/i2c/busses/i2c-piix4.c
===================================================================
--- g26.orig/drivers/i2c/busses/i2c-piix4.c	2006-12-18 13:04:39.000000000 -0800
+++ g26/drivers/i2c/busses/i2c-piix4.c	2006-12-18 13:05:40.000000000 -0800
@@ -428,8 +428,8 @@ static int __devinit piix4_probe(struct 
 	if (retval)
 		return retval;
 
-	/* set up the driverfs linkage to our parent device */
-	piix4_adapter.dev.parent = &dev->dev;
+	/* set up the driver model linkage to our parent device */
+	piix4_adapter.class_dev.dev = &dev->dev;
 
 	snprintf(piix4_adapter.name, I2C_NAME_SIZE,
 		"SMBus PIIX4 adapter at %04x", piix4_smba);
Index: g26/drivers/i2c/busses/i2c-powermac.c
===================================================================
--- g26.orig/drivers/i2c/busses/i2c-powermac.c	2006-12-18 12:15:26.000000000 -0800
+++ g26/drivers/i2c/busses/i2c-powermac.c	2006-12-18 13:05:40.000000000 -0800
@@ -250,7 +250,7 @@ static int __devexit i2c_powermac_probe(
 	strcpy(adapter->name, name);
 	adapter->algo = &i2c_powermac_algorithm;
 	i2c_set_adapdata(adapter, bus);
-	adapter->dev.parent = &dev->dev;
+	adapter->class_dev.dev = &dev->dev;
 	pmac_i2c_attach_adapter(bus, adapter);
 	rc = i2c_add_adapter(adapter);
 	if (rc) {
Index: g26/drivers/i2c/busses/i2c-prosavage.c
===================================================================
--- g26.orig/drivers/i2c/busses/i2c-prosavage.c	2006-12-18 12:15:26.000000000 -0800
+++ g26/drivers/i2c/busses/i2c-prosavage.c	2006-12-18 13:05:40.000000000 -0800
@@ -174,7 +174,7 @@ static int i2c_register_bus(struct pci_d
 	p->adap.owner	  = THIS_MODULE;
 	p->adap.id	  = I2C_HW_B_S3VIA;
 	p->adap.algo_data = &p->algo;
-	p->adap.dev.parent = &dev->dev;
+	p->adap.class_dev.dev = &dev->dev;
 	p->algo.setsda	  = bit_s3via_setsda;
 	p->algo.setscl	  = bit_s3via_setscl;
 	p->algo.getsda	  = bit_s3via_getsda;
Index: g26/drivers/i2c/busses/i2c-pxa.c
===================================================================
--- g26.orig/drivers/i2c/busses/i2c-pxa.c	2006-12-18 13:04:39.000000000 -0800
+++ g26/drivers/i2c/busses/i2c-pxa.c	2006-12-18 13:05:40.000000000 -0800
@@ -871,7 +871,7 @@ static int i2c_pxa_probe(struct platform
 	i2c_pxa_reset(i2c);
 
 	i2c->adap.algo_data = i2c;
-	i2c->adap.dev.parent = &dev->dev;
+	i2c->adap.class_dev.dev = &dev->dev;
 
 	ret = i2c_add_adapter(&i2c->adap);
 	if (ret < 0) {
Index: g26/drivers/i2c/busses/i2c-s3c2410.c
===================================================================
--- g26.orig/drivers/i2c/busses/i2c-s3c2410.c	2006-12-18 13:04:39.000000000 -0800
+++ g26/drivers/i2c/busses/i2c-s3c2410.c	2006-12-18 13:05:40.000000000 -0800
@@ -808,7 +808,7 @@ static int s3c24xx_i2c_probe(struct plat
 	/* setup info block for the i2c core */
 
 	i2c->adap.algo_data = i2c;
-	i2c->adap.dev.parent = &pdev->dev;
+	i2c->adap.class_dev.dev = &pdev->dev;
 
 	/* initialise the i2c controller */
 
Index: g26/drivers/i2c/busses/i2c-savage4.c
===================================================================
--- g26.orig/drivers/i2c/busses/i2c-savage4.c	2006-12-18 12:15:26.000000000 -0800
+++ g26/drivers/i2c/busses/i2c-savage4.c	2006-12-18 13:05:40.000000000 -0800
@@ -165,8 +165,8 @@ static int __devinit savage4_probe(struc
 	if (retval)
 		return retval;
 
-	/* set up the sysfs linkage to our parent device */
-	savage4_i2c_adapter.dev.parent = &dev->dev;
+	/* set up the driver model linkage to our parent device */
+	savage4_i2c_adapter.class_dev.dev = &dev->dev;
 
 	return i2c_bit_add_bus(&savage4_i2c_adapter);
 }
Index: g26/drivers/i2c/busses/i2c-sis5595.c
===================================================================
--- g26.orig/drivers/i2c/busses/i2c-sis5595.c	2006-12-18 13:04:39.000000000 -0800
+++ g26/drivers/i2c/busses/i2c-sis5595.c	2006-12-18 13:05:40.000000000 -0800
@@ -386,8 +386,8 @@ static int __devinit sis5595_probe(struc
 		return -ENODEV;
 	}
 
-	/* set up the driverfs linkage to our parent device */
-	sis5595_adapter.dev.parent = &dev->dev;
+	/* set up the driver model linkage to our parent device */
+	sis5595_adapter.class_dev.dev = &dev->dev;
 
 	sprintf(sis5595_adapter.name, "SMBus SIS5595 adapter at %04x",
 		sis5595_base + SMB_INDEX);
Index: g26/drivers/i2c/busses/i2c-sis630.c
===================================================================
--- g26.orig/drivers/i2c/busses/i2c-sis630.c	2006-12-18 13:04:39.000000000 -0800
+++ g26/drivers/i2c/busses/i2c-sis630.c	2006-12-18 13:05:40.000000000 -0800
@@ -490,8 +490,8 @@ static int __devinit sis630_probe(struct
 		return -ENODEV;
 	}
 
-	/* set up the driverfs linkage to our parent device */
-	sis630_adapter.dev.parent = &dev->dev;
+	/* set up the driver model linkage to our parent device */
+	sis630_adapter.class_dev.dev = &dev->dev;
 
 	sprintf(sis630_adapter.name, "SMBus SIS630 adapter at %04x",
 		acpi_base + SMB_STS);
Index: g26/drivers/i2c/busses/i2c-sis96x.c
===================================================================
--- g26.orig/drivers/i2c/busses/i2c-sis96x.c	2006-12-18 13:04:39.000000000 -0800
+++ g26/drivers/i2c/busses/i2c-sis96x.c	2006-12-18 13:05:40.000000000 -0800
@@ -302,8 +302,8 @@ static int __devinit sis96x_probe(struct
 		return -EINVAL;
 	}
 
-	/* set up the driverfs linkage to our parent device */
-	sis96x_adapter.dev.parent = &dev->dev;
+	/* set up the driver model linkage to our parent device */
+	sis96x_adapter.class_dev.dev = &dev->dev;
 
 	snprintf(sis96x_adapter.name, I2C_NAME_SIZE,
 		"SiS96x SMBus adapter at 0x%04x", sis96x_smbus_base);
Index: g26/drivers/i2c/busses/i2c-via.c
===================================================================
--- g26.orig/drivers/i2c/busses/i2c-via.c	2006-12-18 12:15:26.000000000 -0800
+++ g26/drivers/i2c/busses/i2c-via.c	2006-12-18 13:05:40.000000000 -0800
@@ -137,8 +137,8 @@ static int __devinit vt586b_probe(struct
 	outb(inb(I2C_DIR) & ~(I2C_SDA | I2C_SCL), I2C_DIR);
 	outb(inb(I2C_OUT) & ~(I2C_SDA | I2C_SCL), I2C_OUT);
 
-	/* set up the driverfs linkage to our parent device */
-	vt586b_adapter.dev.parent = &dev->dev;
+	/* set up the driver model linkage to our parent device */
+	vt586b_adapter.class_dev.dev = &dev->dev;
 
 	res = i2c_bit_add_bus(&vt586b_adapter);
 	if ( res < 0 ) {
Index: g26/drivers/i2c/busses/i2c-viapro.c
===================================================================
--- g26.orig/drivers/i2c/busses/i2c-viapro.c	2006-12-18 13:04:39.000000000 -0800
+++ g26/drivers/i2c/busses/i2c-viapro.c	2006-12-18 13:05:40.000000000 -0800
@@ -405,7 +405,7 @@ found:
 		break;
 	}
 
-	vt596_adapter.dev.parent = &pdev->dev;
+	vt596_adapter.class_dev.dev = &pdev->dev;
 	snprintf(vt596_adapter.name, I2C_NAME_SIZE,
 		 "SMBus Via Pro adapter at %04x", vt596_smba);
 
Index: g26/drivers/i2c/busses/i2c-voodoo3.c
===================================================================
--- g26.orig/drivers/i2c/busses/i2c-voodoo3.c	2006-12-18 12:15:26.000000000 -0800
+++ g26/drivers/i2c/busses/i2c-voodoo3.c	2006-12-18 13:05:40.000000000 -0800
@@ -202,9 +202,9 @@ static int __devinit voodoo3_probe(struc
 	if (retval)
 		return retval;
 
-	/* set up the sysfs linkage to our parent device */
-	voodoo3_i2c_adapter.dev.parent = &dev->dev;
-	voodoo3_ddc_adapter.dev.parent = &dev->dev;
+	/* set up the driver model linkage to our parent device */
+	voodoo3_i2c_adapter.class_dev.dev = &dev->dev;
+	voodoo3_ddc_adapter.class_dev.dev = &dev->dev;
 
 	retval = i2c_bit_add_bus(&voodoo3_i2c_adapter);
 	if (retval)
Index: g26/drivers/media/common/saa7146_i2c.c
===================================================================
--- g26.orig/drivers/media/common/saa7146_i2c.c	2006-12-18 12:15:26.000000000 -0800
+++ g26/drivers/media/common/saa7146_i2c.c	2006-12-18 13:05:40.000000000 -0800
@@ -409,7 +409,7 @@ int saa7146_i2c_adapter_prepare(struct s
 	if( NULL != i2c_adapter ) {
 		BUG_ON(!i2c_adapter->class);
 		i2c_set_adapdata(i2c_adapter,dev);
-		i2c_adapter->dev.parent    = &dev->pci->dev;
+		i2c_adapter->class_dev.dev = &dev->pci->dev;
 		i2c_adapter->algo	   = &saa7146_algo;
 		i2c_adapter->algo_data     = NULL;
 		i2c_adapter->id		   = I2C_HW_SAA7146;
Index: g26/drivers/media/dvb/pluto2/pluto2.c
===================================================================
--- g26.orig/drivers/media/dvb/pluto2/pluto2.c	2006-12-18 12:15:26.000000000 -0800
+++ g26/drivers/media/dvb/pluto2/pluto2.c	2006-12-18 13:05:40.000000000 -0800
@@ -629,7 +629,7 @@ static int __devinit pluto2_probe(struct
 	strcpy(pluto->i2c_adap.name, DRIVER_NAME);
 	pluto->i2c_adap.owner = THIS_MODULE;
 	pluto->i2c_adap.class = I2C_CLASS_TV_DIGITAL;
-	pluto->i2c_adap.dev.parent = &pdev->dev;
+	pluto->i2c_adap.class_dev.dev = &pdev->dev;
 	pluto->i2c_adap.algo_data = &pluto->i2c_bit;
 	pluto->i2c_bit.data = pluto;
 	pluto->i2c_bit.setsda = pluto_setsda;
Index: g26/drivers/media/video/bt8xx/bttv-i2c.c
===================================================================
--- g26.orig/drivers/media/video/bt8xx/bttv-i2c.c	2006-12-18 12:15:26.000000000 -0800
+++ g26/drivers/media/video/bt8xx/bttv-i2c.c	2006-12-18 13:05:40.000000000 -0800
@@ -449,7 +449,7 @@ int __devinit init_bttv_i2c(struct bttv 
 		btv->c.i2c_adap.algo_data = &btv->i2c_algo;
 	}
 
-	btv->c.i2c_adap.dev.parent = &btv->c.pci->dev;
+	btv->c.i2c_adap.class_dev.dev = &btv->c.pci->dev;
 	snprintf(btv->c.i2c_adap.name, sizeof(btv->c.i2c_adap.name),
 		 "bt%d #%d [%s]", btv->id, btv->c.nr,
 		 btv->use_i2c_hw ? "hw" : "sw");
Index: g26/drivers/media/video/cx88/cx88-i2c.c
===================================================================
--- g26.orig/drivers/media/video/cx88/cx88-i2c.c	2006-12-18 12:15:26.000000000 -0800
+++ g26/drivers/media/video/cx88/cx88-i2c.c	2006-12-18 13:05:40.000000000 -0800
@@ -223,7 +223,7 @@ int cx88_i2c_init(struct cx88_core *core
 	if (cx88_boards[core->board].mpeg & CX88_MPEG_DVB)
 		core->i2c_adap.class |= I2C_CLASS_TV_DIGITAL;
 
-	core->i2c_adap.dev.parent = &pci->dev;
+	core->i2c_adap.class_dev.dev = &pci->dev;
 	strlcpy(core->i2c_adap.name,core->name,sizeof(core->i2c_adap.name));
 	core->i2c_algo.data = core;
 	i2c_set_adapdata(&core->i2c_adap,core);
Index: g26/drivers/media/video/cx88/cx88-vp3054-i2c.c
===================================================================
--- g26.orig/drivers/media/video/cx88/cx88-vp3054-i2c.c	2006-12-18 12:15:26.000000000 -0800
+++ g26/drivers/media/video/cx88/cx88-vp3054-i2c.c	2006-12-18 13:05:40.000000000 -0800
@@ -138,7 +138,7 @@ int vp3054_i2c_probe(struct cx8802_dev *
 
 	vp3054_i2c->adap.class |= I2C_CLASS_TV_DIGITAL;
 
-	vp3054_i2c->adap.dev.parent = &dev->pci->dev;
+	vp3054_i2c->adap.class_dev.dev = &dev->pci->dev;
 	strlcpy(vp3054_i2c->adap.name, core->name,
 		sizeof(vp3054_i2c->adap.name));
 	vp3054_i2c->algo.data = dev;
Index: g26/drivers/media/video/em28xx/em28xx-i2c.c
===================================================================
--- g26.orig/drivers/media/video/em28xx/em28xx-i2c.c	2006-12-18 12:15:26.000000000 -0800
+++ g26/drivers/media/video/em28xx/em28xx-i2c.c	2006-12-18 13:05:40.000000000 -0800
@@ -552,7 +552,7 @@ int em28xx_i2c_register(struct em28xx *d
 	BUG_ON(!dev->em28xx_write_regs || !dev->em28xx_read_reg);
 	BUG_ON(!dev->em28xx_write_regs_req || !dev->em28xx_read_reg_req);
 	dev->i2c_adap = em28xx_adap_template;
-	dev->i2c_adap.dev.parent = &dev->udev->dev;
+	dev->i2c_adap.class_dev.dev = &dev->udev->dev;
 	strcpy(dev->i2c_adap.name, dev->name);
 	dev->i2c_adap.algo_data = dev;
 	i2c_add_adapter(&dev->i2c_adap);
Index: g26/drivers/media/video/saa7134/saa7134-i2c.c
===================================================================
--- g26.orig/drivers/media/video/saa7134/saa7134-i2c.c	2006-12-18 12:15:26.000000000 -0800
+++ g26/drivers/media/video/saa7134/saa7134-i2c.c	2006-12-18 13:05:40.000000000 -0800
@@ -465,7 +465,7 @@ void saa7134_i2c_call_clients(struct saa
 int saa7134_i2c_register(struct saa7134_dev *dev)
 {
 	dev->i2c_adap = saa7134_adap_template;
-	dev->i2c_adap.dev.parent = &dev->pci->dev;
+	dev->i2c_adap.class_dev.dev = &dev->pci->dev;
 	strcpy(dev->i2c_adap.name,dev->name);
 	dev->i2c_adap.algo_data = dev;
 	i2c_add_adapter(&dev->i2c_adap);
Index: g26/drivers/i2c/busses/i2c-nforce2.c
===================================================================
--- g26.orig/drivers/i2c/busses/i2c-nforce2.c	2006-12-18 13:04:39.000000000 -0800
+++ g26/drivers/i2c/busses/i2c-nforce2.c	2006-12-18 13:05:40.000000000 -0800
@@ -243,7 +243,7 @@ static int __devinit nforce2_probe_smb (
 	smbus->adapter.class = I2C_CLASS_HWMON;
 	smbus->adapter.algo = &smbus_algorithm;
 	smbus->adapter.algo_data = smbus;
-	smbus->adapter.dev.parent = &dev->dev;
+	smbus->adapter.class_dev.dev = &dev->dev;
 	snprintf(smbus->adapter.name, I2C_NAME_SIZE,
 		"SMBus nForce2 adapter at %04x", smbus->base);
 
Index: g26/drivers/i2c/busses/i2c-pnx.c
===================================================================
--- g26.orig/drivers/i2c/busses/i2c-pnx.c	2006-12-18 13:04:39.000000000 -0800
+++ g26/drivers/i2c/busses/i2c-pnx.c	2006-12-18 13:05:40.000000000 -0800
@@ -641,7 +641,7 @@ static int __devinit i2c_pnx_probe(struc
 		goto out_clock;
 
 	/* Register this adapter with the I2C subsystem */
-	i2c_pnx->adapter->dev.parent = &pdev->dev;
+	i2c_pnx->adapter->class_dev.dev = &pdev->dev;
 	ret = i2c_add_adapter(i2c_pnx->adapter);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "I2C: Failed to add bus\n");
Index: g26/drivers/i2c/busses/i2c-versatile.c
===================================================================
--- g26.orig/drivers/i2c/busses/i2c-versatile.c	2006-12-18 12:15:26.000000000 -0800
+++ g26/drivers/i2c/busses/i2c-versatile.c	2006-12-18 13:05:40.000000000 -0800
@@ -98,7 +98,7 @@ static int i2c_versatile_probe(struct pl
 	i2c->adap.owner = THIS_MODULE;
 	strlcpy(i2c->adap.name, "Versatile I2C adapter", sizeof(i2c->adap.name));
 	i2c->adap.algo_data = &i2c->algo;
-	i2c->adap.dev.parent = &dev->dev;
+	i2c->adap.class_dev.dev = &dev->dev;
 	i2c->algo = i2c_versatile_algo;
 	i2c->algo.data = i2c;
 
Index: g26/drivers/video/aty/radeon_i2c.c
===================================================================
--- g26.orig/drivers/video/aty/radeon_i2c.c	2006-12-18 12:15:26.000000000 -0800
+++ g26/drivers/video/aty/radeon_i2c.c	2006-12-18 13:05:40.000000000 -0800
@@ -74,7 +74,7 @@ static int radeon_setup_i2c_bus(struct r
 	chan->adapter.owner		= THIS_MODULE;
 	chan->adapter.id		= I2C_HW_B_RADEON;
 	chan->adapter.algo_data		= &chan->algo;
-	chan->adapter.dev.parent	= &chan->rinfo->pdev->dev;
+	chan->adapter.class_dev.dev	= &chan->rinfo->pdev->dev;
 	chan->algo.setsda		= radeon_gpio_setsda;
 	chan->algo.setscl		= radeon_gpio_setscl;
 	chan->algo.getsda		= radeon_gpio_getsda;
Index: g26/drivers/video/i810/i810-i2c.c
===================================================================
--- g26.orig/drivers/video/i810/i810-i2c.c	2006-12-18 12:15:26.000000000 -0800
+++ g26/drivers/video/i810/i810-i2c.c	2006-12-18 13:05:40.000000000 -0800
@@ -90,7 +90,7 @@ static int i810_setup_i2c_bus(struct i81
         strcpy(chan->adapter.name, name);
         chan->adapter.owner             = THIS_MODULE;
         chan->adapter.algo_data         = &chan->algo;
-        chan->adapter.dev.parent        = &chan->par->dev->dev;
+        chan->adapter.class_dev.dev     = &chan->par->dev->dev;
 	chan->adapter.id                = I2C_HW_B_I810;
 	chan->algo.setsda               = i810i2c_setsda;
 	chan->algo.setscl               = i810i2c_setscl;
Index: g26/drivers/video/intelfb/intelfb_i2c.c
===================================================================
--- g26.orig/drivers/video/intelfb/intelfb_i2c.c	2006-12-18 12:15:26.000000000 -0800
+++ g26/drivers/video/intelfb/intelfb_i2c.c	2006-12-18 13:05:40.000000000 -0800
@@ -109,7 +109,7 @@ static int intelfb_setup_i2c_bus(struct 
 	chan->adapter.owner			= THIS_MODULE;
 	chan->adapter.id			= I2C_HW_B_INTELFB;
 	chan->adapter.algo_data		= &chan->algo;
-	chan->adapter.dev.parent	= &chan->dinfo->pdev->dev;
+	chan->adapter.class_dev.dev	= &chan->dinfo->pdev->dev;
 	chan->algo.setsda			= intelfb_gpio_setsda;
 	chan->algo.setscl			= intelfb_gpio_setscl;
 	chan->algo.getsda			= intelfb_gpio_getsda;
Index: g26/drivers/video/nvidia/nv_i2c.c
===================================================================
--- g26.orig/drivers/video/nvidia/nv_i2c.c	2006-12-18 12:15:26.000000000 -0800
+++ g26/drivers/video/nvidia/nv_i2c.c	2006-12-18 13:05:40.000000000 -0800
@@ -97,7 +97,7 @@ static int nvidia_setup_i2c_bus(struct n
 	chan->adapter.owner = THIS_MODULE;
 	chan->adapter.id = I2C_HW_B_NVIDIA;
 	chan->adapter.algo_data = &chan->algo;
-	chan->adapter.dev.parent = &chan->par->pci_dev->dev;
+	chan->adapter.class_dev.dev = &chan->par->pci_dev->dev;
 	chan->algo.setsda = nvidia_gpio_setsda;
 	chan->algo.setscl = nvidia_gpio_setscl;
 	chan->algo.getsda = nvidia_gpio_getsda;
Index: g26/drivers/video/riva/rivafb-i2c.c
===================================================================
--- g26.orig/drivers/video/riva/rivafb-i2c.c	2006-12-18 12:15:26.000000000 -0800
+++ g26/drivers/video/riva/rivafb-i2c.c	2006-12-18 13:05:40.000000000 -0800
@@ -97,7 +97,7 @@ static int riva_setup_i2c_bus(struct riv
 	chan->adapter.owner		= THIS_MODULE;
 	chan->adapter.id		= I2C_HW_B_RIVA;
 	chan->adapter.algo_data		= &chan->algo;
-	chan->adapter.dev.parent	= &chan->par->pdev->dev;
+	chan->adapter.class_dev.dev	= &chan->par->pdev->dev;
 	chan->algo.setsda		= riva_gpio_setsda;
 	chan->algo.setscl		= riva_gpio_setscl;
 	chan->algo.getsda		= riva_gpio_getsda;
Index: g26/drivers/video/savage/savagefb-i2c.c
===================================================================
--- g26.orig/drivers/video/savage/savagefb-i2c.c	2006-12-18 12:15:26.000000000 -0800
+++ g26/drivers/video/savage/savagefb-i2c.c	2006-12-18 13:05:40.000000000 -0800
@@ -146,7 +146,7 @@ static int savage_setup_i2c_bus(struct s
 		chan->adapter.owner		= THIS_MODULE;
 		chan->adapter.id		= I2C_HW_B_SAVAGE;
 		chan->adapter.algo_data		= &chan->algo;
-		chan->adapter.dev.parent	= &chan->par->pcidev->dev;
+		chan->adapter.class_dev.dev	= &chan->par->pcidev->dev;
 		chan->algo.udelay		= 40;
 		chan->algo.timeout		= 20;
 		chan->algo.data 		= chan;



More information about the i2c mailing list