public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/3] dm: mmc: Avoid probing block devices in find_mmc_device()
Date: Sun, 28 May 2017 07:43:45 -0400	[thread overview]
Message-ID: <20170528114345.GF10782@bill-the-cat> (raw)
In-Reply-To: <20170527173719.25679-4-sjg@chromium.org>

On Sat, May 27, 2017 at 11:37:19AM -0600, Simon Glass wrote:

> 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 4dc3925fe6..994d2686f4 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;

We should declare new variables at the top of the function here, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170528/b4186341/attachment.sig>

  reply	other threads:[~2017-05-28 11:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20170527173728epcas1p21e089a94bc187a94c282bb9ed160787a@epcas1p2.samsung.com>
2017-05-27 17:37 ` [U-Boot] [PATCH 0/3] dm: mmc: Tidy up use of block devices Simon Glass
2017-05-27 17:37   ` [U-Boot] [PATCH 1/3] dm: blk: Add a way to obtain a block device from its parent Simon Glass
2017-05-28 11:43     ` Tom Rini
2017-06-07  3:49     ` Jaehoon Chung
2017-06-09  3:06       ` Simon Glass
2017-06-09  3:38         ` Jaehoon Chung
2017-06-21  1:49           ` Simon Glass
2017-05-27 17:37   ` [U-Boot] [PATCH 2/3] dm: mmc: Ensure that block device is probed Simon Glass
2017-05-28 11:43     ` Tom Rini
2017-05-27 17:37   ` [U-Boot] [PATCH 3/3] dm: mmc: Avoid probing block devices in find_mmc_device() Simon Glass
2017-05-28 11:43     ` Tom Rini [this message]
2017-06-02  3:18   ` [U-Boot] [PATCH 0/3] dm: mmc: Tidy up use of block devices Jaehoon Chung
2017-06-02  3:29     ` Simon Glass

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=20170528114345.GF10782@bill-the-cat \
    --to=trini@konsulko.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox