summaryrefslogtreecommitdiff
path: root/drivers/i2c/i2c-slave.c
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2011-02-11 17:50:38 +0530
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:41:51 -0800
commit3b7701624f15832aadf9fa120fd2b079682c1ed3 (patch)
tree1aed0fb3b6007aec4aa468d933bf2ad2d62008a4 /drivers/i2c/i2c-slave.c
parent3d6207d9466d462ae377d2f1cff0eefb3b74e21d (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> Original-Change-Id: I62ba2e474d15764eccb2174444b194502e771307 Rebase-Id: Re845b3bac0f08ac25d0aa330acf0ee267ea8fcd4
Diffstat (limited to 'drivers/i2c/i2c-slave.c')
-rwxr-xr-xdrivers/i2c/i2c-slave.c8
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;