diff options
author | Tom Rini <trini@konsulko.com> | 2016-10-28 14:14:18 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2016-10-28 14:14:18 -0400 |
commit | 1df182ddf700de49fb4400ba67c3029278ea88e7 (patch) | |
tree | c709e8a79950a29f1d12fc09fbf52b293bd54092 /drivers/i2c | |
parent | 4f892924d238cc415891dbea336a0fdaff2f853b (diff) | |
parent | 0eafd4b77615efdd948e698d83be746dcf026a53 (diff) | |
download | u-boot-imx-1df182ddf700de49fb4400ba67c3029278ea88e7.zip u-boot-imx-1df182ddf700de49fb4400ba67c3029278ea88e7.tar.gz u-boot-imx-1df182ddf700de49fb4400ba67c3029278ea88e7.tar.bz2 |
Merge branch 'master' of git://git.denx.de/u-boot-atmel
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/at91_i2c.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/drivers/i2c/at91_i2c.c b/drivers/i2c/at91_i2c.c index d71f75c..4bc54ee 100644 --- a/drivers/i2c/at91_i2c.c +++ b/drivers/i2c/at91_i2c.c @@ -176,37 +176,21 @@ 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; + return -EINVAL; bus->bus_clk_rate = clk_rate; |