All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 5/8] dm: mmc: Avoid probing block devices in find_mmc_device()
Date: Sun, 23 Apr 2017 20:02:08 -0600	[thread overview]
Message-ID: <20170424020211.20690-6-sjg@chromium.org> (raw)
In-Reply-To: <20170424020211.20690-1-sjg@chromium.org>

We do not need to probe the block device here, so avoid doing so. The MMC
device itself must be active, but the block device can come later.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 drivers/mmc/mmc-uclass.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c
index 9c07871d3a..1a84a033ae 100644
--- a/drivers/mmc/mmc-uclass.c
+++ b/drivers/mmc/mmc-uclass.c
@@ -97,7 +97,7 @@ struct mmc *find_mmc_device(int dev_num)
 	struct udevice *dev, *mmc_dev;
 	int ret;
 
-	ret = blk_get_device(IF_TYPE_MMC, dev_num, &dev);
+	ret = blk_find_device(IF_TYPE_MMC, dev_num, &dev);
 
 	if (ret) {
 #if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
@@ -108,7 +108,9 @@ struct mmc *find_mmc_device(int dev_num)
 
 	mmc_dev = dev_get_parent(dev);
 
-	return mmc_get_mmc_dev(mmc_dev);
+	struct mmc *mmc = mmc_get_mmc_dev(mmc_dev);
+
+	return mmc;
 }
 
 int get_mmc_num(void)
-- 
2.12.2.816.g2cccc81164-goog

  parent reply	other threads:[~2017-04-24  2:02 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-24  2:02 [U-Boot] [PATCH 0/8] dm: mmc: Tidy up handling of block devices Simon Glass
2017-04-24  2:02 ` [U-Boot] [PATCH 1/8] dm: mmc: Don't re-init when accessing environment Simon Glass
2017-04-24  8:55   ` Jean-Jacques Hiblot
2017-04-29  0:27     ` Simon Glass
2017-05-03  2:35       ` Simon Glass
2017-05-03 13:05         ` Jean-Jacques Hiblot
2017-04-24  2:02 ` [U-Boot] [PATCH 2/8] dm: blk: Allow finding block devices without probing Simon Glass
2017-05-18 16:01   ` sjg at google.com
2017-04-24  2:02 ` [U-Boot] [PATCH 3/8] dm: blk: Add a function to find the next block device number Simon Glass
2017-04-24  8:04   ` Andy Shevchenko
2017-05-03  2:36     ` Simon Glass
2017-05-03 19:11       ` Andy Shevchenko
2017-05-18 16:01         ` sjg at google.com
2017-05-20  2:28           ` Simon Glass
2017-04-24  2:02 ` [U-Boot] [PATCH 4/8] dm: blk: Improve block device claiming Simon Glass
2017-05-18 16:01   ` sjg at google.com
2017-04-24  2:02 ` Simon Glass [this message]
2017-05-18 16:01   ` [U-Boot] [PATCH 5/8] dm: mmc: Avoid probing block devices in find_mmc_device() sjg at google.com
2017-04-24  2:02 ` [U-Boot] [PATCH 6/8] dm: mmc: Check that drivers have operations Simon Glass
2017-05-18 16:01   ` sjg at google.com
2017-04-24  2:02 ` [U-Boot] [PATCH 7/8] dm: mmc: Rewrite mmc_blk_probe() Simon Glass
2017-05-18 16:01   ` sjg at google.com
2017-04-24  2:02 ` [U-Boot] [PATCH 8/8] tegra: Convert MMC to use driver model for operations Simon Glass
2017-05-18 16:01   ` sjg at google.com
2017-05-18 16:33     ` Tom Warren
2017-05-18 16:35       ` Simon Glass
2017-05-29 14:49         ` Marcel Ziswiler
2017-06-02  2:56           ` Simon Glass
2017-04-24  8:09 ` [U-Boot] [PATCH 0/8] dm: mmc: Tidy up handling of block devices Andy Shevchenko

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=20170424020211.20690-6-sjg@chromium.org \
    --to=sjg@chromium.org \
    --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.