V4L/DVB (13715): [Mantis] Kernel I2C changes: use PCI parent device
authorManu Abraham <abraham.manu@gmail.com>
Thu, 3 Dec 2009 08:46:06 +0000 (05:46 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sun, 17 Jan 2010 13:55:30 +0000 (11:55 -0200)
Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/mantis/mantis_common.h
drivers/media/dvb/mantis/mantis_i2c.c

index d4865e4..34d2389 100644 (file)
@@ -83,7 +83,7 @@ struct mantis_pci {
 
        u8                      latency;
 
-       struct                  pci_dev *pdev;
+       struct pci_dev          *pdev;
 
        unsigned long           mantis_addr;
        volatile void __iomem   *mantis_mmio;
index 39fabe5..005df1e 100644 (file)
@@ -161,11 +161,15 @@ static struct i2c_adapter mantis_i2c_adapter = {
 int __devinit mantis_i2c_init(struct mantis_pci *mantis)
 {
        u32 intstat, intmask;
+       struct i2c_adapter *i2c_adapter = &mantis->adapter;
+       struct pci_dev *pdev            = mantis->pdev;
 
        mutex_init(&mantis->i2c_lock);
-       memcpy(&mantis->adapter, &mantis_i2c_adapter, sizeof (mantis_i2c_adapter));
-       i2c_set_adapdata(&mantis->adapter, mantis);
-       mantis->i2c_rc = i2c_add_adapter(&mantis->adapter);
+       memcpy(i2c_adapter, &mantis_i2c_adapter, sizeof (mantis_i2c_adapter));
+       i2c_set_adapdata(i2c_adapter, mantis);
+
+       i2c_adapter->dev.parent = &pdev->dev;
+       mantis->i2c_rc          = i2c_add_adapter(i2c_adapter);
        if (mantis->i2c_rc < 0)
                return mantis->i2c_rc;