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>
This commit is contained in:

committed by
Jean Delvare

parent
beb58aa39e
commit
12a917f69d
@@ -184,12 +184,14 @@ static int __init amd756_s4882_init(void)
|
||||
s4882_algo[0].smbus_xfer = amd756_access_virt0;
|
||||
s4882_adapter[0] = amd756_smbus;
|
||||
s4882_adapter[0].algo = s4882_algo;
|
||||
s4882_adapter[0].dev.parent = amd756_smbus.dev.parent;
|
||||
for (i = 1; i < 5; i++) {
|
||||
s4882_algo[i] = *(amd756_smbus.algo);
|
||||
s4882_adapter[i] = amd756_smbus;
|
||||
sprintf(s4882_adapter[i].name,
|
||||
"SMBus 8111 adapter (CPU%d)", i-1);
|
||||
s4882_adapter[i].algo = s4882_algo+i;
|
||||
s4882_adapter[i].dev.parent = amd756_smbus.dev.parent;
|
||||
}
|
||||
s4882_algo[1].smbus_xfer = amd756_access_virt1;
|
||||
s4882_algo[2].smbus_xfer = amd756_access_virt2;
|
||||
|
@@ -727,6 +727,7 @@ static int __devinit iic_probe(struct ocp_device *ocp){
|
||||
|
||||
/* Register it with i2c layer */
|
||||
adap = &dev->adap;
|
||||
adap->dev.parent = &ocp->dev;
|
||||
strcpy(adap->name, "IBM IIC");
|
||||
i2c_set_adapdata(adap, dev);
|
||||
adap->id = I2C_HW_OCP;
|
||||
|
@@ -520,6 +520,7 @@ mv64xxx_i2c_probe(struct platform_device *pd)
|
||||
rc = -ENXIO;
|
||||
goto exit_unmap_regs;
|
||||
}
|
||||
drv_data->adapter.dev.parent = &pd->dev;
|
||||
drv_data->adapter.id = I2C_HW_MV64XXX;
|
||||
drv_data->adapter.algo = &mv64xxx_i2c_algo;
|
||||
drv_data->adapter.owner = THIS_MODULE;
|
||||
|
@@ -428,7 +428,7 @@ static __init int scx200_acb_probe(struct scx200_acb_iface *iface)
|
||||
}
|
||||
|
||||
static __init struct scx200_acb_iface *scx200_create_iface(const char *text,
|
||||
int index)
|
||||
struct device *dev, int index)
|
||||
{
|
||||
struct scx200_acb_iface *iface;
|
||||
struct i2c_adapter *adapter;
|
||||
@@ -446,6 +446,7 @@ static __init struct scx200_acb_iface *scx200_create_iface(const char *text,
|
||||
adapter->id = I2C_HW_SMBUS_SCX200;
|
||||
adapter->algo = &scx200_acb_algorithm;
|
||||
adapter->class = I2C_CLASS_HWMON;
|
||||
adapter->dev.parent = dev;
|
||||
|
||||
mutex_init(&iface->mutex);
|
||||
|
||||
@@ -486,7 +487,7 @@ static __init int scx200_create_pci(const char *text, struct pci_dev *pdev,
|
||||
struct scx200_acb_iface *iface;
|
||||
int rc;
|
||||
|
||||
iface = scx200_create_iface(text, 0);
|
||||
iface = scx200_create_iface(text, &pdev->dev, 0);
|
||||
|
||||
if (iface == NULL)
|
||||
return -ENOMEM;
|
||||
@@ -524,7 +525,7 @@ static int __init scx200_create_isa(const char *text, unsigned long base,
|
||||
struct scx200_acb_iface *iface;
|
||||
int rc;
|
||||
|
||||
iface = scx200_create_iface(text, index);
|
||||
iface = scx200_create_iface(text, NULL, index);
|
||||
|
||||
if (iface == NULL)
|
||||
return -ENOMEM;
|
||||
|
Reference in New Issue
Block a user