From: Jaehoon Chung Date: Tue, 24 Jan 2017 15:21:02 +0900 Subject: [U-Boot] [PATCH v4 01/17] dm: mmc: Set up the MMC device when controller is probed In-Reply-To: <20170120140752.16296-2-sjg@chromium.org> References: <20170120140752.16296-1-sjg@chromium.org> <20170120140752.16296-2-sjg@chromium.org> Message-ID: <20bfbdfe-2dcb-d1d2-35c6-4f8f68b93cff@samsung.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 01/20/2017 11:07 PM, Simon Glass wrote: > When an MMC controller is set up we should probe the device to find out > what it is. This includes finding its capacity and reading its partition > table. > > Signed-off-by: Simon Glass Reviewed-by: Jaehoon Chung Best Regards, Jaehoon Chung > --- > > Changes in v4: None > Changes in v3: None > > drivers/mmc/mmc-uclass.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c > index 2fe5d61e263..a5286541c1c 100644 > --- a/drivers/mmc/mmc-uclass.c > +++ b/drivers/mmc/mmc-uclass.c > @@ -232,6 +232,15 @@ int mmc_unbind(struct udevice *dev) > return 0; > } > > +#ifdef CONFIG_BLK > +static int mmc_post_probe(struct udevice *dev) > +{ > + struct mmc *mmc = mmc_get_mmc_dev(dev); > + > + return mmc_init(mmc); > +} > +#endif > + > static int mmc_select_hwpart(struct udevice *bdev, int hwpart) > { > struct udevice *mmc_dev = dev_get_parent(bdev); > @@ -273,4 +282,7 @@ UCLASS_DRIVER(mmc) = { > .name = "mmc", > .flags = DM_UC_FLAG_SEQ_ALIAS, > .per_device_auto_alloc_size = sizeof(struct mmc_uclass_priv), > +#ifdef CONFIG_BLK > + .post_probe = mmc_post_probe, > +#endif > }; >