All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 4/7] i2c: at91_i2c: Remove unneccessary clock calling
Date: Mon, 19 Sep 2016 07:58:05 +0200	[thread overview]
Message-ID: <57DF7E6D.8090400@denx.de> (raw)
In-Reply-To: <1474181594-2868-5-git-send-email-wenyou.yang@atmel.com>

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@atmel.com>
> ---
>
> Changes in v2: None
>
>   drivers/i2c/at91_i2c.c | 16 ----------------
>   1 file changed, 16 deletions(-)

Reviewed-by: Heiko Schocher <hs@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

  reply	other threads:[~2016-09-19  5:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-18  6:53 [U-Boot] [PATCH v2 0/7] clk: at91: Improve the clock implementation Wenyou Yang
2016-09-18  6:53 ` [U-Boot] [PATCH v2 1/7] clk: clk-uclass: Assign clk->dev before call .of_xlate Wenyou Yang
2016-09-18  6:53 ` [U-Boot] [PATCH v2 2/7] clk: at91: Improve the clock implementation Wenyou Yang
2016-09-20 21:27   ` Stephen Warren
2016-09-18  6:53 ` [U-Boot] [PATCH v2 3/7] gpio: atmel_pio4: Remove unneccessary clock calling Wenyou Yang
2016-09-18  6:53 ` [U-Boot] [PATCH v2 4/7] i2c: at91_i2c: " Wenyou Yang
2016-09-19  5:58   ` Heiko Schocher [this message]
2016-09-18  6:53 ` [U-Boot] [PATCH v2 5/7] i2c: at91_i2c: Change error return -ENODEV to -EINVAL Wenyou Yang
2016-09-19  5:58   ` Heiko Schocher
2016-09-18  6:53 ` [U-Boot] [PATCH v2 6/7] usb: ehci-atmel: Remove unneccessary clock calling Wenyou Yang
2016-09-18  6:53 ` [U-Boot] [PATCH v2 7/7] mmc: atmel_sdhci: " Wenyou Yang
2016-09-20  7:20   ` Jaehoon Chung

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=57DF7E6D.8090400@denx.de \
    --to=hs@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.