From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Sun, 28 May 2017 07:43:45 -0400 Subject: [U-Boot] [PATCH 3/3] dm: mmc: Avoid probing block devices in find_mmc_device() In-Reply-To: <20170527173719.25679-4-sjg@chromium.org> References: <20170527173719.25679-1-sjg@chromium.org> <20170527173719.25679-4-sjg@chromium.org> Message-ID: <20170528114345.GF10782@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 > --- > > 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: