diff options
author | Laxman Dewangan <ldewangan@nvidia.com> | 2011-04-27 19:11:08 +0530 |
---|---|---|
committer | Varun Colbert <vcolbert@nvidia.com> | 2011-04-28 19:53:21 -0700 |
commit | 54e13987ee759d29607394ef446b966e769bd781 (patch) | |
tree | 355f254a1309b1c6540f56a53d698886e51edf8e /drivers/i2c | |
parent | be220d5fa55408fedec59f194c59eb95dc2d1573 (diff) |
i2c: clock: tegra: Removing unnecessary clock entry
The clock table have two different entry for a given i2c controller.
The second entry is not required and hence removing from table.
Also removing the reference of this entry from driver.
Change-Id: Iab5f79bf5d1fea9363ef524258fb3ec262547691
Reviewed-on: http://git-master/r/29629
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Tested-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Scott Williams <scwilliams@nvidia.com>
Reviewed-by: Daniel Willemsen <dwillemsen@nvidia.com>
Reviewed-by: Aleksandr Frid <afrid@nvidia.com>
Reviewed-by: Narendra Damahe <ndamahe@nvidia.com>
Diffstat (limited to 'drivers/i2c')
-rwxr-xr-x | drivers/i2c/busses/i2c-slave-tegra.c | 18 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-tegra.c | 15 |
2 files changed, 4 insertions, 29 deletions
diff --git a/drivers/i2c/busses/i2c-slave-tegra.c b/drivers/i2c/busses/i2c-slave-tegra.c index bd2b3781257c..c621f4e5cf34 100755 --- a/drivers/i2c/busses/i2c-slave-tegra.c +++ b/drivers/i2c/busses/i2c-slave-tegra.c @@ -180,7 +180,6 @@ struct tegra_i2c_slave_bus { struct tegra_i2c_slave_dev { struct device *dev; struct clk *clk; - struct clk *i2c_clk; struct resource *iomem; void __iomem *base; int cont_id; @@ -652,7 +651,7 @@ static int tegra_i2c_slave_start(struct i2c_slave_adapter *slv_adap, int addr, get_packet_headers(i2c_dev, 4096, 0, &i2c_dev->rx_pack_hdr1, &i2c_dev->rx_pack_hdr2, &i2c_dev->rx_pack_hdr3); - clk_enable(i2c_dev->i2c_clk); + clk_enable(i2c_dev->clk); configure_i2c_slave_packet_mode(i2c_dev); configure_i2c_slave_address(i2c_dev); do_tx_fifo_empty(i2c_dev, NULL); @@ -692,7 +691,7 @@ static void tegra_i2c_slave_stop(struct i2c_slave_adapter *slv_adap, writel(0, i2c_dev->base + I2C_INT_MASK); i2c_dev->curr_transfer = 0; i2c_dev->is_slave_started = false; - clk_disable(i2c_dev->i2c_clk); + clk_disable(i2c_dev->clk); if (is_buffer_clear) { i2c_dev->rx_msg_head = 0; i2c_dev->rx_msg_tail = 0; @@ -910,7 +909,6 @@ static int tegra_i2c_slave_probe(struct platform_device *pdev) struct resource *res; struct resource *iomem; struct clk *clk; - struct clk *i2c_clk; void *base; int irq; int ret = 0; @@ -958,24 +956,17 @@ static int tegra_i2c_slave_probe(struct platform_device *pdev) goto err_release_region; } - i2c_clk = clk_get(&pdev->dev, "i2c"); - if (!i2c_clk) { - ret = -ENODEV; - goto err_clk_put; - } - rx_buffer_size = (pdata->max_rx_buffer_size)?:4096; tx_buffer_size = (pdata->max_tx_buffer_size)?:4096; i2c_dev = kzalloc(sizeof(struct tegra_i2c_slave_dev) + rx_buffer_size + tx_buffer_size, GFP_KERNEL); if (!i2c_dev) { ret = -ENOMEM; - goto err_i2c_clk_put; + goto err_clk_put; } i2c_dev->base = base; i2c_dev->clk = clk; - i2c_dev->i2c_clk = i2c_clk; i2c_dev->iomem = iomem; i2c_dev->irq = irq; i2c_dev->cont_id = pdev->id; @@ -1034,8 +1025,6 @@ err_free_irq: free_irq(i2c_dev->irq, i2c_dev); err_free: kfree(i2c_dev); -err_i2c_clk_put: - clk_put(i2c_clk); err_clk_put: clk_put(clk); err_release_region: @@ -1052,7 +1041,6 @@ static int tegra_i2c_slave_remove(struct platform_device *pdev) i2c_del_slave_adapter(&i2c_dev->bus.slv_adap); free_irq(i2c_dev->irq, i2c_dev); - clk_put(i2c_dev->i2c_clk); clk_put(i2c_dev->clk); release_mem_region(i2c_dev->iomem->start, resource_size(i2c_dev->iomem)); diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c index d2351182b7eb..0ef60184d4fc 100644 --- a/drivers/i2c/busses/i2c-tegra.c +++ b/drivers/i2c/busses/i2c-tegra.c @@ -120,7 +120,6 @@ struct tegra_i2c_bus { struct tegra_i2c_dev { struct device *dev; struct clk *clk; - struct clk *i2c_clk; struct resource *iomem; struct rt_mutex dev_lock; void __iomem *base; @@ -641,7 +640,6 @@ static int tegra_i2c_probe(struct platform_device *pdev) struct resource *res; struct resource *iomem; struct clk *clk; - struct clk *i2c_clk; void *base; int irq; int nbus; @@ -692,22 +690,15 @@ static int tegra_i2c_probe(struct platform_device *pdev) goto err_release_region; } - i2c_clk = clk_get(&pdev->dev, "i2c"); - if (IS_ERR_OR_NULL(i2c_clk)) { - ret = -ENOMEM; - goto err_clk_put; - } - i2c_dev = kzalloc(sizeof(struct tegra_i2c_dev) + (nbus-1) * sizeof(struct tegra_i2c_bus), GFP_KERNEL); if (!i2c_dev) { ret = -ENOMEM; - goto err_i2c_clk_put; + goto err_clk_put; } i2c_dev->base = base; i2c_dev->clk = clk; - i2c_dev->i2c_clk = i2c_clk; i2c_dev->iomem = iomem; i2c_dev->irq = irq; i2c_dev->cont_id = pdev->id; @@ -727,7 +718,6 @@ static int tegra_i2c_probe(struct platform_device *pdev) platform_set_drvdata(pdev, i2c_dev); - clk_enable(i2c_dev->i2c_clk); if (i2c_dev->is_clkon_always) clk_enable(i2c_dev->clk); @@ -784,8 +774,6 @@ err_del_bus: free_irq(i2c_dev->irq, i2c_dev); err_free: kfree(i2c_dev); -err_i2c_clk_put: - clk_put(i2c_clk); err_clk_put: clk_put(clk); err_release_region: @@ -805,7 +793,6 @@ static int tegra_i2c_remove(struct platform_device *pdev) clk_disable(i2c_dev->clk); free_irq(i2c_dev->irq, i2c_dev); - clk_put(i2c_dev->i2c_clk); clk_put(i2c_dev->clk); release_mem_region(i2c_dev->iomem->start, resource_size(i2c_dev->iomem)); |