diff options
author | Jean Delvare <khali@linux-fr.org> | 2007-02-13 16:09:03 -0500 |
---|---|---|
committer | Jean Delvare <khali@arrakis.delvare> | 2007-02-13 16:09:03 -0500 |
commit | 12a917f69d1468c91d646dbad8408dd0d39d6207 (patch) | |
tree | 3336f373d174600d0981d8a34de4cf0e26eab79f /drivers/i2c | |
parent | beb58aa39e6e5a52875defe12c7697b0bfa95d4c (diff) |
i2c: Declare more i2c_adapter parent devices
Declare the parent device of i2c_adapter devices each time we can
easily do so. It makes the i2c_adapter appear at the right place in
the device tree, rather than as a platform device.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Len Brown <len.brown@intel.com>
Cc: Jordan Crouse <jordan.crouse@amd.com>
Cc: Jody McIntyre <scjody@modernduck.com>
Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: v4l-dvb-maintainer@linuxtv.org
Cc: Petr Vandrovec <vandrove@vc.cvut.cz>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/i2c-amd756-s4882.c | 2 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-ibm_iic.c | 1 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-mv64xxx.c | 1 | ||||
-rw-r--r-- | drivers/i2c/busses/scx200_acb.c | 7 |
4 files changed, 8 insertions, 3 deletions
diff --git a/drivers/i2c/busses/i2c-amd756-s4882.c b/drivers/i2c/busses/i2c-amd756-s4882.c index 08e915730caf..e5e96c817566 100644 --- a/drivers/i2c/busses/i2c-amd756-s4882.c +++ b/drivers/i2c/busses/i2c-amd756-s4882.c | |||
@@ -184,12 +184,14 @@ static int __init amd756_s4882_init(void) | |||
184 | s4882_algo[0].smbus_xfer = amd756_access_virt0; | 184 | s4882_algo[0].smbus_xfer = amd756_access_virt0; |
185 | s4882_adapter[0] = amd756_smbus; | 185 | s4882_adapter[0] = amd756_smbus; |
186 | s4882_adapter[0].algo = s4882_algo; | 186 | s4882_adapter[0].algo = s4882_algo; |
187 | s4882_adapter[0].dev.parent = amd756_smbus.dev.parent; | ||
187 | for (i = 1; i < 5; i++) { | 188 | for (i = 1; i < 5; i++) { |
188 | s4882_algo[i] = *(amd756_smbus.algo); | 189 | s4882_algo[i] = *(amd756_smbus.algo); |
189 | s4882_adapter[i] = amd756_smbus; | 190 | s4882_adapter[i] = amd756_smbus; |
190 | sprintf(s4882_adapter[i].name, | 191 | sprintf(s4882_adapter[i].name, |
191 | "SMBus 8111 adapter (CPU%d)", i-1); | 192 | "SMBus 8111 adapter (CPU%d)", i-1); |
192 | s4882_adapter[i].algo = s4882_algo+i; | 193 | s4882_adapter[i].algo = s4882_algo+i; |
194 | s4882_adapter[i].dev.parent = amd756_smbus.dev.parent; | ||
193 | } | 195 | } |
194 | s4882_algo[1].smbus_xfer = amd756_access_virt1; | 196 | s4882_algo[1].smbus_xfer = amd756_access_virt1; |
195 | s4882_algo[2].smbus_xfer = amd756_access_virt2; | 197 | s4882_algo[2].smbus_xfer = amd756_access_virt2; |
diff --git a/drivers/i2c/busses/i2c-ibm_iic.c b/drivers/i2c/busses/i2c-ibm_iic.c index 1898e9987021..8b14d14e60ca 100644 --- a/drivers/i2c/busses/i2c-ibm_iic.c +++ b/drivers/i2c/busses/i2c-ibm_iic.c | |||
@@ -727,6 +727,7 @@ static int __devinit iic_probe(struct ocp_device *ocp){ | |||
727 | 727 | ||
728 | /* Register it with i2c layer */ | 728 | /* Register it with i2c layer */ |
729 | adap = &dev->adap; | 729 | adap = &dev->adap; |
730 | adap->dev.parent = &ocp->dev; | ||
730 | strcpy(adap->name, "IBM IIC"); | 731 | strcpy(adap->name, "IBM IIC"); |
731 | i2c_set_adapdata(adap, dev); | 732 | i2c_set_adapdata(adap, dev); |
732 | adap->id = I2C_HW_OCP; | 733 | adap->id = I2C_HW_OCP; |
diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c index 490173611d6b..a3283b907eb8 100644 --- a/drivers/i2c/busses/i2c-mv64xxx.c +++ b/drivers/i2c/busses/i2c-mv64xxx.c | |||
@@ -520,6 +520,7 @@ mv64xxx_i2c_probe(struct platform_device *pd) | |||
520 | rc = -ENXIO; | 520 | rc = -ENXIO; |
521 | goto exit_unmap_regs; | 521 | goto exit_unmap_regs; |
522 | } | 522 | } |
523 | drv_data->adapter.dev.parent = &pd->dev; | ||
523 | drv_data->adapter.id = I2C_HW_MV64XXX; | 524 | drv_data->adapter.id = I2C_HW_MV64XXX; |
524 | drv_data->adapter.algo = &mv64xxx_i2c_algo; | 525 | drv_data->adapter.algo = &mv64xxx_i2c_algo; |
525 | drv_data->adapter.owner = THIS_MODULE; | 526 | drv_data->adapter.owner = THIS_MODULE; |
diff --git a/drivers/i2c/busses/scx200_acb.c b/drivers/i2c/busses/scx200_acb.c index 714bae780953..0b082c5a0195 100644 --- a/drivers/i2c/busses/scx200_acb.c +++ b/drivers/i2c/busses/scx200_acb.c | |||
@@ -428,7 +428,7 @@ static __init int scx200_acb_probe(struct scx200_acb_iface *iface) | |||
428 | } | 428 | } |
429 | 429 | ||
430 | static __init struct scx200_acb_iface *scx200_create_iface(const char *text, | 430 | static __init struct scx200_acb_iface *scx200_create_iface(const char *text, |
431 | int index) | 431 | struct device *dev, int index) |
432 | { | 432 | { |
433 | struct scx200_acb_iface *iface; | 433 | struct scx200_acb_iface *iface; |
434 | struct i2c_adapter *adapter; | 434 | struct i2c_adapter *adapter; |
@@ -446,6 +446,7 @@ static __init struct scx200_acb_iface *scx200_create_iface(const char *text, | |||
446 | adapter->id = I2C_HW_SMBUS_SCX200; | 446 | adapter->id = I2C_HW_SMBUS_SCX200; |
447 | adapter->algo = &scx200_acb_algorithm; | 447 | adapter->algo = &scx200_acb_algorithm; |
448 | adapter->class = I2C_CLASS_HWMON; | 448 | adapter->class = I2C_CLASS_HWMON; |
449 | adapter->dev.parent = dev; | ||
449 | 450 | ||
450 | mutex_init(&iface->mutex); | 451 | mutex_init(&iface->mutex); |
451 | 452 | ||
@@ -486,7 +487,7 @@ static __init int scx200_create_pci(const char *text, struct pci_dev *pdev, | |||
486 | struct scx200_acb_iface *iface; | 487 | struct scx200_acb_iface *iface; |
487 | int rc; | 488 | int rc; |
488 | 489 | ||
489 | iface = scx200_create_iface(text, 0); | 490 | iface = scx200_create_iface(text, &pdev->dev, 0); |
490 | 491 | ||
491 | if (iface == NULL) | 492 | if (iface == NULL) |
492 | return -ENOMEM; | 493 | return -ENOMEM; |
@@ -524,7 +525,7 @@ static int __init scx200_create_isa(const char *text, unsigned long base, | |||
524 | struct scx200_acb_iface *iface; | 525 | struct scx200_acb_iface *iface; |
525 | int rc; | 526 | int rc; |
526 | 527 | ||
527 | iface = scx200_create_iface(text, index); | 528 | iface = scx200_create_iface(text, NULL, index); |
528 | 529 | ||
529 | if (iface == NULL) | 530 | if (iface == NULL) |
530 | return -ENOMEM; | 531 | return -ENOMEM; |