[U-Boot] [PATCH v2 4/7] i2c: at91_i2c: Remove unneccessary clock calling
Heiko Schocher
hs at denx.de
Mon Sep 19 07:58:05 CEST 2016
Hello Wenyou Yang,
Am 18.09.2016 um 08:53 schrieb Wenyou Yang:
> Due to the peripheral clock driver improvement, remove the
> unneccessary clock calling.
>
> Signed-off-by: Wenyou Yang <wenyou.yang at atmel.com>
> ---
>
> Changes in v2: None
>
> drivers/i2c/at91_i2c.c | 16 ----------------
> 1 file changed, 16 deletions(-)
Reviewed-by: Heiko Schocher <hs at denx.de>
bye,
Heiko
>
> diff --git a/drivers/i2c/at91_i2c.c b/drivers/i2c/at91_i2c.c
> index 8e9c3ad..73f29e3 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;
>
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
More information about the U-Boot
mailing list