[i2c] [patch 2.6.20-rc1 5/6] remove i2c_adapter.dev from i2c core and adapters
David Brownell
david-b at pacbell.net
Fri Dec 29 06:09:25 CET 2006
> I'd say: prepare a patch #0 which adds the classdev .name attribute, so
> that user-space can start using it, and announcing that the
> i2c_adapter.dev .name attribute will be deprecated soon (say June
> 2007.) I could push this patch quickly into 2.6.20.
I just sent that to you, combined with two related migration aids:
(a) adapter drivers can pass the physical device node using
i2c_adapter.class_dev.dev not i2c_adapter.dev.parent,
so that most of #5 can merge as is ... "#5A", appended;
(b) issue a warning when no physical device node is passed,
so we can safely drop the "legacy_i2c_adapter" part of #5
> Then we keep patches #1 to #4 stacked for 2.6.21. Patch #5 will need
> some rework, I need to test some more things, as discussed above,
> before I decide exactly what is acceptable and what isn't.
As stated in the previous mail, #1-4, #5A, and your "#4.5", all
seem ready to go at any time after that migration patch. Even
potentially 2.6.20, though clearly there's no particular need to
get those changes in "soon" beyond avoiding bit-rot and conflicts
with other patches. (All they do is make sure i2c_adapter.dev has
virtually no users in the current tree.)
> Patch #6 and
> later, I didn't have the time to review yet, so I can't tell. Odds are,
> a part will be OK for 2.6.21, and a part might be too late. But we'll
> see.
Based on the feedback to the original version of #6 I didn't think
there would be anything holding it back. So I'll refresh that, and
send it tomorrow. (An x86 "allyesconfig" is taking several hours,
mostly I think reordering things in the linker... slooooowwwww.)
> > > > + * 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 we really do this, then this must be documented in
> > > Documentation/feature-removal-schedule.txt, not just here. But as I
> > > said above, I don't think we need to introduce these fake devices.
> >
> > If you don't want to do that, so be it. I'd make this block of code
> > report a fatal error then, for the reasons I sketched above.
>
> Give me some time to see exactly what the possibilities are, and I'll
> get back to you with my decision when I'm done. I wonder if we could
> keep i2c_adapter.dev for now, while still killing i2c_adapter_driver;
> that would allow some cleanups in parallel.
I don't see that working very smoothly. So the "#5A" patch doesn't
touch i2c_adapter.dev or i2c_adapter_driver; it'll all get removed
together with i2c_adapter.list, sometime in July.
That should be AFTER the "new style" driver probing support gets
merged and deployed.
> OK, I understand the idea. What I'm not sure about is when exactly we
> are supposed to call init_completion() and wait_for_completion(), and
> what these functions do.
Call init_completion() when the data structure is initialized. In this
case, wait_for_completion() gets called when something wants to wait
till the memory gets freed. (The need for which reflects design issues.)
> Likewise, I don't know when the .release
> callback will be called. I assume that wait_for_completion(x) blocks
> until someone (presumably the driver core) calls complete(x)?
The release() callback is called when the last refcount on a device
goes away; for hotpluggable devices that'd usually be when the device
is physically unplugged, but sometimes a reference lingers later. And
sysfs is a good source of lingering references.
- Dave
================= CUT HERE (for patch "#5A/6")
Change init of most I2C adapter drivers: stop using i2c_adapter.dev.parent
and set i2c_adapter.class_dev.dev instead. Along with previous patches,
this means almost all uses of i2c_adapter.dev are gone; so the eventual
patch to remove that field will be much smaller.
Signed-off-by: David Brownell <dbrownell at users.sourceforge.net>
Index: pxa/drivers/i2c/busses/i2c-prosavage.c
===================================================================
--- pxa.orig/drivers/i2c/busses/i2c-prosavage.c 2006-12-27 13:38:42.000000000 -0800
+++ pxa/drivers/i2c/busses/i2c-prosavage.c 2006-12-28 20:11:21.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: pxa/drivers/i2c/busses/i2c-i801.c
===================================================================
--- pxa.orig/drivers/i2c/busses/i2c-i801.c 2006-12-27 13:38:42.000000000 -0800
+++ pxa/drivers/i2c/busses/i2c-i801.c 2006-12-28 20:11:21.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: pxa/drivers/i2c/busses/i2c-at91.c
===================================================================
--- pxa.orig/drivers/i2c/busses/i2c-at91.c 2006-12-28 20:08:22.000000000 -0800
+++ pxa/drivers/i2c/busses/i2c-at91.c 2006-12-28 20:11:20.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: pxa/drivers/media/common/saa7146_i2c.c
===================================================================
--- pxa.orig/drivers/media/common/saa7146_i2c.c 2006-12-27 13:38:42.000000000 -0800
+++ pxa/drivers/media/common/saa7146_i2c.c 2006-12-28 20:11:21.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: pxa/drivers/i2c/busses/i2c-ibm_iic.c
===================================================================
--- pxa.orig/drivers/i2c/busses/i2c-ibm_iic.c 2006-12-27 13:38:42.000000000 -0800
+++ pxa/drivers/i2c/busses/i2c-ibm_iic.c 2006-12-28 20:11:21.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: pxa/drivers/video/aty/radeon_i2c.c
===================================================================
--- pxa.orig/drivers/video/aty/radeon_i2c.c 2006-12-27 13:38:43.000000000 -0800
+++ pxa/drivers/video/aty/radeon_i2c.c 2006-12-28 20:11:21.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: pxa/drivers/i2c/busses/i2c-savage4.c
===================================================================
--- pxa.orig/drivers/i2c/busses/i2c-savage4.c 2006-12-27 13:38:42.000000000 -0800
+++ pxa/drivers/i2c/busses/i2c-savage4.c 2006-12-28 20:11:21.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: pxa/drivers/i2c/busses/i2c-ixp2000.c
===================================================================
--- pxa.orig/drivers/i2c/busses/i2c-ixp2000.c 2006-12-27 13:38:42.000000000 -0800
+++ pxa/drivers/i2c/busses/i2c-ixp2000.c 2006-12-28 20:11:21.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: pxa/drivers/media/video/cx88/cx88-vp3054-i2c.c
===================================================================
--- pxa.orig/drivers/media/video/cx88/cx88-vp3054-i2c.c 2006-12-27 13:38:42.000000000 -0800
+++ pxa/drivers/media/video/cx88/cx88-vp3054-i2c.c 2006-12-28 20:11:21.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: pxa/drivers/i2c/busses/i2c-hydra.c
===================================================================
--- pxa.orig/drivers/i2c/busses/i2c-hydra.c 2006-12-27 13:38:42.000000000 -0800
+++ pxa/drivers/i2c/busses/i2c-hydra.c 2006-12-28 20:11:21.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: pxa/drivers/i2c/busses/i2c-piix4.c
===================================================================
--- pxa.orig/drivers/i2c/busses/i2c-piix4.c 2006-12-28 20:08:22.000000000 -0800
+++ pxa/drivers/i2c/busses/i2c-piix4.c 2006-12-28 20:11:21.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: pxa/drivers/i2c/busses/i2c-amd756.c
===================================================================
--- pxa.orig/drivers/i2c/busses/i2c-amd756.c 2006-12-28 20:08:22.000000000 -0800
+++ pxa/drivers/i2c/busses/i2c-amd756.c 2006-12-28 20:11:20.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: pxa/drivers/i2c/busses/i2c-iop3xx.c
===================================================================
--- pxa.orig/drivers/i2c/busses/i2c-iop3xx.c 2006-12-10 01:31:25.000000000 -0800
+++ pxa/drivers/i2c/busses/i2c-iop3xx.c 2006-12-28 20:11:21.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: pxa/drivers/i2c/busses/i2c-omap.c
===================================================================
--- pxa.orig/drivers/i2c/busses/i2c-omap.c 2006-12-27 13:38:42.000000000 -0800
+++ pxa/drivers/i2c/busses/i2c-omap.c 2006-12-28 20:11:21.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: pxa/drivers/i2c/busses/i2c-pnx.c
===================================================================
--- pxa.orig/drivers/i2c/busses/i2c-pnx.c 2006-12-28 20:08:22.000000000 -0800
+++ pxa/drivers/i2c/busses/i2c-pnx.c 2006-12-28 20:11:21.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: pxa/drivers/i2c/busses/i2c-voodoo3.c
===================================================================
--- pxa.orig/drivers/i2c/busses/i2c-voodoo3.c 2006-12-27 13:38:42.000000000 -0800
+++ pxa/drivers/i2c/busses/i2c-voodoo3.c 2006-12-28 20:11:21.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: pxa/drivers/media/video/cx88/cx88-i2c.c
===================================================================
--- pxa.orig/drivers/media/video/cx88/cx88-i2c.c 2006-12-10 01:31:37.000000000 -0800
+++ pxa/drivers/media/video/cx88/cx88-i2c.c 2006-12-28 20:11:21.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: pxa/drivers/i2c/busses/i2c-viapro.c
===================================================================
--- pxa.orig/drivers/i2c/busses/i2c-viapro.c 2006-12-28 20:08:22.000000000 -0800
+++ pxa/drivers/i2c/busses/i2c-viapro.c 2006-12-28 20:11:21.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: pxa/drivers/i2c/busses/i2c-mv64xxx.c
===================================================================
--- pxa.orig/drivers/i2c/busses/i2c-mv64xxx.c 2006-12-10 01:31:25.000000000 -0800
+++ pxa/drivers/i2c/busses/i2c-mv64xxx.c 2006-12-28 20:11:21.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: pxa/drivers/media/video/saa7134/saa7134-i2c.c
===================================================================
--- pxa.orig/drivers/media/video/saa7134/saa7134-i2c.c 2006-12-27 13:38:42.000000000 -0800
+++ pxa/drivers/media/video/saa7134/saa7134-i2c.c 2006-12-28 20:11:21.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: pxa/drivers/i2c/busses/i2c-nforce2.c
===================================================================
--- pxa.orig/drivers/i2c/busses/i2c-nforce2.c 2006-12-28 20:08:22.000000000 -0800
+++ pxa/drivers/i2c/busses/i2c-nforce2.c 2006-12-28 20:11:21.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: pxa/drivers/i2c/busses/i2c-pxa.c
===================================================================
--- pxa.orig/drivers/i2c/busses/i2c-pxa.c 2006-12-28 20:08:22.000000000 -0800
+++ pxa/drivers/i2c/busses/i2c-pxa.c 2006-12-28 20:11:21.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: pxa/drivers/i2c/busses/i2c-ali1563.c
===================================================================
--- pxa.orig/drivers/i2c/busses/i2c-ali1563.c 2006-12-28 20:08:22.000000000 -0800
+++ pxa/drivers/i2c/busses/i2c-ali1563.c 2006-12-28 20:11:20.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: pxa/drivers/i2c/busses/i2c-ali15x3.c
===================================================================
--- pxa.orig/drivers/i2c/busses/i2c-ali15x3.c 2006-12-28 20:08:22.000000000 -0800
+++ pxa/drivers/i2c/busses/i2c-ali15x3.c 2006-12-28 20:11:20.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: pxa/drivers/video/intelfb/intelfb_i2c.c
===================================================================
--- pxa.orig/drivers/video/intelfb/intelfb_i2c.c 2006-12-27 13:38:44.000000000 -0800
+++ pxa/drivers/video/intelfb/intelfb_i2c.c 2006-12-28 20:11:21.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: pxa/drivers/i2c/busses/i2c-versatile.c
===================================================================
--- pxa.orig/drivers/i2c/busses/i2c-versatile.c 2006-12-27 13:38:42.000000000 -0800
+++ pxa/drivers/i2c/busses/i2c-versatile.c 2006-12-28 20:11:21.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: pxa/drivers/i2c/busses/i2c-ali1535.c
===================================================================
--- pxa.orig/drivers/i2c/busses/i2c-ali1535.c 2006-12-28 20:08:22.000000000 -0800
+++ pxa/drivers/i2c/busses/i2c-ali1535.c 2006-12-28 20:11:20.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: pxa/drivers/media/video/em28xx/em28xx-i2c.c
===================================================================
--- pxa.orig/drivers/media/video/em28xx/em28xx-i2c.c 2006-12-10 01:31:37.000000000 -0800
+++ pxa/drivers/media/video/em28xx/em28xx-i2c.c 2006-12-28 20:11:21.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: pxa/drivers/video/riva/rivafb-i2c.c
===================================================================
--- pxa.orig/drivers/video/riva/rivafb-i2c.c 2006-12-27 13:38:44.000000000 -0800
+++ pxa/drivers/video/riva/rivafb-i2c.c 2006-12-28 20:11:21.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: pxa/drivers/i2c/busses/i2c-sis630.c
===================================================================
--- pxa.orig/drivers/i2c/busses/i2c-sis630.c 2006-12-28 20:08:22.000000000 -0800
+++ pxa/drivers/i2c/busses/i2c-sis630.c 2006-12-28 20:11:21.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: pxa/drivers/i2c/busses/i2c-powermac.c
===================================================================
--- pxa.orig/drivers/i2c/busses/i2c-powermac.c 2006-12-10 01:31:25.000000000 -0800
+++ pxa/drivers/i2c/busses/i2c-powermac.c 2006-12-28 20:11:21.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: pxa/drivers/i2c/busses/i2c-ixp4xx.c
===================================================================
--- pxa.orig/drivers/i2c/busses/i2c-ixp4xx.c 2006-12-27 13:38:42.000000000 -0800
+++ pxa/drivers/i2c/busses/i2c-ixp4xx.c 2006-12-28 20:11:21.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: pxa/drivers/i2c/busses/i2c-via.c
===================================================================
--- pxa.orig/drivers/i2c/busses/i2c-via.c 2006-12-27 13:38:42.000000000 -0800
+++ pxa/drivers/i2c/busses/i2c-via.c 2006-12-28 20:11:21.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: pxa/drivers/media/video/bt8xx/bttv-i2c.c
===================================================================
--- pxa.orig/drivers/media/video/bt8xx/bttv-i2c.c 2006-12-27 13:38:42.000000000 -0800
+++ pxa/drivers/media/video/bt8xx/bttv-i2c.c 2006-12-28 20:11:21.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: pxa/drivers/video/savage/savagefb-i2c.c
===================================================================
--- pxa.orig/drivers/video/savage/savagefb-i2c.c 2006-12-27 13:38:44.000000000 -0800
+++ pxa/drivers/video/savage/savagefb-i2c.c 2006-12-28 20:11:21.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;
Index: pxa/drivers/i2c/busses/i2c-s3c2410.c
===================================================================
--- pxa.orig/drivers/i2c/busses/i2c-s3c2410.c 2006-12-28 20:08:22.000000000 -0800
+++ pxa/drivers/i2c/busses/i2c-s3c2410.c 2006-12-28 20:11:21.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: pxa/drivers/video/nvidia/nv_i2c.c
===================================================================
--- pxa.orig/drivers/video/nvidia/nv_i2c.c 2006-12-27 13:38:44.000000000 -0800
+++ pxa/drivers/video/nvidia/nv_i2c.c 2006-12-28 20:11:21.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: pxa/drivers/i2c/busses/i2c-mpc.c
===================================================================
--- pxa.orig/drivers/i2c/busses/i2c-mpc.c 2006-12-10 01:31:25.000000000 -0800
+++ pxa/drivers/i2c/busses/i2c-mpc.c 2006-12-28 20:11:21.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: pxa/drivers/i2c/busses/i2c-ocores.c
===================================================================
--- pxa.orig/drivers/i2c/busses/i2c-ocores.c 2006-12-10 01:31:25.000000000 -0800
+++ pxa/drivers/i2c/busses/i2c-ocores.c 2006-12-28 20:11:21.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: pxa/drivers/i2c/busses/i2c-sis96x.c
===================================================================
--- pxa.orig/drivers/i2c/busses/i2c-sis96x.c 2006-12-28 20:08:22.000000000 -0800
+++ pxa/drivers/i2c/busses/i2c-sis96x.c 2006-12-28 20:11:21.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: pxa/drivers/video/i810/i810-i2c.c
===================================================================
--- pxa.orig/drivers/video/i810/i810-i2c.c 2006-12-27 13:38:44.000000000 -0800
+++ pxa/drivers/video/i810/i810-i2c.c 2006-12-28 20:11:21.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: pxa/drivers/i2c/busses/i2c-i810.c
===================================================================
--- pxa.orig/drivers/i2c/busses/i2c-i810.c 2006-12-27 13:38:42.000000000 -0800
+++ pxa/drivers/i2c/busses/i2c-i810.c 2006-12-28 20:11:21.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: pxa/drivers/i2c/busses/i2c-amd8111.c
===================================================================
--- pxa.orig/drivers/i2c/busses/i2c-amd8111.c 2006-12-28 20:08:22.000000000 -0800
+++ pxa/drivers/i2c/busses/i2c-amd8111.c 2006-12-28 20:11:20.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: pxa/drivers/media/dvb/pluto2/pluto2.c
===================================================================
--- pxa.orig/drivers/media/dvb/pluto2/pluto2.c 2006-12-27 13:38:42.000000000 -0800
+++ pxa/drivers/media/dvb/pluto2/pluto2.c 2006-12-28 20:11:21.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: pxa/drivers/i2c/busses/i2c-sis5595.c
===================================================================
--- pxa.orig/drivers/i2c/busses/i2c-sis5595.c 2006-12-28 20:08:22.000000000 -0800
+++ pxa/drivers/i2c/busses/i2c-sis5595.c 2006-12-28 20:11:21.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);
More information about the i2c
mailing list