All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wenyou Yang <wenyou.yang@atmel.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 7/7] mmc: atmel_sdhci: Remove unnecessary clock calling
Date: Tue, 27 Sep 2016 11:00:34 +0800	[thread overview]
Message-ID: <1474945234-30540-8-git-send-email-wenyou.yang@atmel.com> (raw)
In-Reply-To: <1474945234-30540-1-git-send-email-wenyou.yang@atmel.com>

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

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
---

Changes in v3:
 - Fix typo, unneccessary -> unnecessary.
 - Add Reviewed-by tag.

Changes in v2: None

 drivers/mmc/atmel_sdhci.c | 27 ++-------------------------
 1 file changed, 2 insertions(+), 25 deletions(-)

diff --git a/drivers/mmc/atmel_sdhci.c b/drivers/mmc/atmel_sdhci.c
index d8f8087..080a0a1 100644
--- a/drivers/mmc/atmel_sdhci.c
+++ b/drivers/mmc/atmel_sdhci.c
@@ -51,29 +51,6 @@ struct atmel_sdhci_plat {
 	struct mmc mmc;
 };
 
-static int atmel_sdhci_get_clk(struct udevice *dev, int index, struct clk *clk)
-{
-	struct udevice *dev_clk;
-	int periph, ret;
-
-	ret = clk_get_by_index(dev, index, clk);
-	if (ret)
-		return ret;
-
-	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;
-
-	return 0;
-}
-
 static int atmel_sdhci_probe(struct udevice *dev)
 {
 	struct mmc_uclass_priv *upriv = dev_get_uclass_priv(dev);
@@ -86,7 +63,7 @@ static int atmel_sdhci_probe(struct udevice *dev)
 	struct clk clk;
 	int ret;
 
-	ret = atmel_sdhci_get_clk(dev, 0, &clk);
+	ret = clk_get_by_index(dev, 0, &clk);
 	if (ret)
 		return ret;
 
@@ -107,7 +84,7 @@ static int atmel_sdhci_probe(struct udevice *dev)
 	clk_mul = (caps_1 & SDHCI_CLOCK_MUL_MASK) >> SDHCI_CLOCK_MUL_SHIFT;
 	gck_rate = clk_base * 1000000 * (clk_mul + 1);
 
-	ret = atmel_sdhci_get_clk(dev, 1, &clk);
+	ret = clk_get_by_index(dev, 1, &clk);
 	if (ret)
 		return ret;
 
-- 
2.7.4

  parent reply	other threads:[~2016-09-27  3:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-27  3:00 [U-Boot] [PATCH v3 0/7] clk: at91: Improve the clock implementation Wenyou Yang
2016-09-27  3:00 ` [U-Boot] [PATCH v3 1/7] clk: clk-uclass: Assign clk->dev before call .of_xlate Wenyou Yang
2016-09-27 17:55   ` Simon Glass
2016-10-28 16:49   ` [U-Boot] [U-Boot, v3, " Andreas Bießmann
2016-09-27  3:00 ` [U-Boot] [PATCH v3 2/7] clk: at91: Improve the clock implementation Wenyou Yang
2016-10-28 16:49   ` [U-Boot] [U-Boot, v3, " Andreas Bießmann
2016-09-27  3:00 ` [U-Boot] [PATCH v3 3/7] gpio: atmel_pio4: Remove unnecessary clock calling Wenyou Yang
2016-10-28 16:49   ` [U-Boot] [U-Boot, v3, " Andreas Bießmann
2016-09-27  3:00 ` [U-Boot] [PATCH v3 4/7] i2c: at91_i2c: " Wenyou Yang
2016-10-28 16:49   ` [U-Boot] [U-Boot, v3, " Andreas Bießmann
2016-09-27  3:00 ` [U-Boot] [PATCH v3 5/7] i2c: at91_i2c: Change error return -ENODEV to -EINVAL Wenyou Yang
2016-10-28 16:49   ` [U-Boot] [U-Boot, v3, " Andreas Bießmann
2016-09-27  3:00 ` [U-Boot] [PATCH v3 6/7] usb: ehci-atmel: Remove unnecessary clock calling Wenyou Yang
2016-10-28 10:37   ` [U-Boot] [U-Boot, v3, " Andreas Bießmann
2016-10-28 16:49   ` Andreas Bießmann
2016-09-27  3:00 ` Wenyou Yang [this message]
2016-10-28 16:49   ` [U-Boot] [U-Boot, v3, 7/7] mmc: atmel_sdhci: " Andreas Bießmann

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=1474945234-30540-8-git-send-email-wenyou.yang@atmel.com \
    --to=wenyou.yang@atmel.com \
    --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.