aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManu Abraham <abraham.manu@gmail.com>2009-12-03 05:46:06 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-01-17 11:55:30 -0200
commit8154bad4c488c1a23fb504a6e751d71a39733b76 (patch)
tree5db0b2997a27c3833f6027eb108b9aced1ec2ebf
parent33c79630dd9fb7658dbb885a22e3a8127b16a38a (diff)
V4L/DVB (13715): [Mantis] Kernel I2C changes: use PCI parent device
Signed-off-by: Manu Abraham <manu@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/dvb/mantis/mantis_common.h2
-rw-r--r--drivers/media/dvb/mantis/mantis_i2c.c10
2 files changed, 8 insertions, 4 deletions
diff --git a/drivers/media/dvb/mantis/mantis_common.h b/drivers/media/dvb/mantis/mantis_common.h
index d4865e4f346..34d2389f312 100644
--- a/drivers/media/dvb/mantis/mantis_common.h
+++ b/drivers/media/dvb/mantis/mantis_common.h
@@ -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;
diff --git a/drivers/media/dvb/mantis/mantis_i2c.c b/drivers/media/dvb/mantis/mantis_i2c.c
index 39fabe572c2..005df1e90a1 100644
--- a/drivers/media/dvb/mantis/mantis_i2c.c
+++ b/drivers/media/dvb/mantis/mantis_i2c.c
@@ -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;