From: Wenyou Yang <wenyou.yang@atmel.com>
Date: Tue, 27 Sep 2016 03:00:31 +0000 (+0800)
Subject: i2c: at91_i2c: Remove unnecessary clock calling
X-Git-Tag: v2025.01-rc5-pxa1908~8260^2~10
X-Git-Url: http://git.dujemihanovic.xyz/%22/icons/right.gif/static/%7B%7B%20.Permalink%20%7D%7D?a=commitdiff_plain;h=2ccc07bbdcd85878aa02cf4afb8aa5ed7ef1b446;p=u-boot.git

i2c: at91_i2c: Remove unnecessary clock calling

Due to the peripheral clock driver improvement, remove the
unnecessary clock calling.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
---

diff --git a/drivers/i2c/at91_i2c.c b/drivers/i2c/at91_i2c.c
index d71f75c5fa..dcd3ce8627 100644
--- a/drivers/i2c/at91_i2c.c
+++ b/drivers/i2c/at91_i2c.c
@@ -176,34 +176,18 @@ static void at91_calc_i2c_clock(struct udevice *dev, int i2c_clk)
 static int at91_i2c_enable_clk(struct udevice *dev)
 {
 	struct at91_i2c_bus *bus = dev_get_priv(dev);
-	struct udevice *dev_clk;
 	struct clk clk;
 	ulong clk_rate;
-	int periph;
 	int ret;
 
 	ret = clk_get_by_index(dev, 0, &clk);
 	if (ret)
 		return -EINVAL;
 
-	periph = fdtdec_get_uint(gd->fdt_blob, clk.dev->of_offset, "reg", -1);
-	if (periph < 0)
-		return -EINVAL;
-
-	dev_clk = dev_get_parent(clk.dev);
-	ret = clk_request(dev_clk, &clk);
-	if (ret)
-		return ret;
-
-	clk.id = periph;
 	ret = clk_enable(&clk);
 	if (ret)
 		return ret;
 
-	ret = clk_get_by_index(dev_clk, 0, &clk);
-	if (ret)
-		return ret;
-
 	clk_rate = clk_get_rate(&clk);
 	if (!clk_rate)
 		return -ENODEV;