diff options
author | Laxman Dewangan <ldewangan@nvidia.com> | 2011-02-11 17:50:38 +0530 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-04-26 15:52:04 -0700 |
commit | a1f17d92a8add42bf061bead6ac5bf9387ff0b2a (patch) | |
tree | 2704a07cc13f85299b825ee2050990d25e0ca316 /drivers/i2c/i2c-slave.c | |
parent | f230e7096c251955df201fc96ba6b3d62560067f (diff) |
i2c: tegra: i2c-slave: Fixing initialization seq
Following are changes:
- Using the sysinit_call to initialize the driver.
- Using device from master adapter for slave adpter.
Original-Change-Id: I4dd0725694008a6aaee9a1d3a92d370a5c46de31
Reviewed-on: http://git-master/r/19249
Reviewed-by: Krishna Thota <kthota@nvidia.com>
Tested-by: Krishna Thota <kthota@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Change-Id: I62ba2e474d15764eccb2174444b194502e771307
Diffstat (limited to 'drivers/i2c/i2c-slave.c')
-rwxr-xr-x | drivers/i2c/i2c-slave.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/i2c/i2c-slave.c b/drivers/i2c/i2c-slave.c index 755a51944869..a1cd4b220c23 100755 --- a/drivers/i2c/i2c-slave.c +++ b/drivers/i2c/i2c-slave.c @@ -246,7 +246,7 @@ int i2c_add_slave_adapter(struct i2c_slave_adapter *slv_adap, bool force_nr) priv->master_adap.id = slv_adap->id; priv->master_adap.algo = &priv->master_algo; priv->master_adap.algo_data = priv; - priv->master_adap.dev.parent = &slv_adap->dev; + priv->master_adap.dev.parent = slv_adap->parent_dev; if (force_nr) { priv->master_adap.nr = slv_adap->nr; @@ -255,13 +255,13 @@ int i2c_add_slave_adapter(struct i2c_slave_adapter *slv_adap, bool force_nr) ret = i2c_add_adapter(&priv->master_adap); } if (ret < 0) { - dev_err(&slv_adap->dev, + dev_err(slv_adap->parent_dev, "failed to add slave-adapter (error=%d)\n", ret); kfree(priv); return ret; } - - dev_info(&slv_adap->dev, "Added slave i2c bus %d\n", + slv_adap->dev = &priv->master_adap.dev; + dev_info(slv_adap->parent_dev, "Added slave i2c bus %d\n", i2c_adapter_id(&priv->master_adap)); return 0; |