mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-21 04:14:34 +00:00
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>
This commit is contained in:
parent
d85d92ae7b
commit
2ccc07bbdc
1 changed files with 0 additions and 16 deletions
|
@ -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)
|
static int at91_i2c_enable_clk(struct udevice *dev)
|
||||||
{
|
{
|
||||||
struct at91_i2c_bus *bus = dev_get_priv(dev);
|
struct at91_i2c_bus *bus = dev_get_priv(dev);
|
||||||
struct udevice *dev_clk;
|
|
||||||
struct clk clk;
|
struct clk clk;
|
||||||
ulong clk_rate;
|
ulong clk_rate;
|
||||||
int periph;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = clk_get_by_index(dev, 0, &clk);
|
ret = clk_get_by_index(dev, 0, &clk);
|
||||||
if (ret)
|
if (ret)
|
||||||
return -EINVAL;
|
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);
|
ret = clk_enable(&clk);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
ret = clk_get_by_index(dev_clk, 0, &clk);
|
|
||||||
if (ret)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
clk_rate = clk_get_rate(&clk);
|
clk_rate = clk_get_rate(&clk);
|
||||||
if (!clk_rate)
|
if (!clk_rate)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
Loading…
Add table
Reference in a new issue