From: Aswath Govindraju Date: Thu, 25 Mar 2021 11:41:37 +0530 Subject: [PATCH 2/2] mmc: mmc-uclass: Assign devnum as alias index in SPL too if CONFIG_SPL_DM_SEQ_ALIAS is enabled In-Reply-To: <20210315104826.14587-3-a-govindraju@ti.com> References: <20210315104826.14587-1-a-govindraju@ti.com> <20210315104826.14587-3-a-govindraju@ti.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi all, On 15/03/21 4:18 pm, Aswath Govindraju wrote: > Assign the nodes alias index as the device number in SPL too, if > CONFIG_SPL_DM_SEQ_ALIAS is enabled. > > Signed-off-by: Aswath Govindraju > --- > drivers/mmc/mmc-uclass.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c > index 53eabc9e612d..67fcba3c207c 100644 > --- a/drivers/mmc/mmc-uclass.c > +++ b/drivers/mmc/mmc-uclass.c > @@ -387,11 +387,11 @@ int mmc_bind(struct udevice *dev, struct mmc *mmc, const struct mmc_config *cfg) > > if (!mmc_get_ops(dev)) > return -ENOSYS; > -#ifndef CONFIG_SPL_BUILD > - /* Use the fixed index with aliase node's index */ > - ret = dev_read_alias_seq(dev, &devnum); > - debug("%s: alias ret=%d, devnum=%d\n", __func__, ret, devnum); > -#endif > + if (IS_ENABLED(CONFIG_SPL_DM_SEQ_ALIAS)) { > + /* Use the fixed index with aliase node's index */ > + ret = dev_read_alias_seq(dev, &devnum); > + debug("%s: alias ret=%d, devnum=%d\n", __func__, ret, devnum); > + } > > ret = blk_create_devicef(dev, "mmc_blk", "blk", IF_TYPE_MMC, > devnum, 512, 0, &bdev); > dev_read_alias_seq() has dependency on CONFIG_SPL_OF_LIBFDT. There is a possiblility that CONFIG_SPL_OF_LIBFDT is disabled and CONFIG_SPL_DM_SEQ_ALIAS is enabled, this would lead to break in builds. To remove this dependency dev_seq() can be used instead of dev_read_alias_seq(). I will be respining this series after making this change. Thanks, Aswath