All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aswath Govindraju <a-govindraju@ti.com>
To: u-boot@lists.denx.de
Subject: [PATCH 2/2] mmc: mmc-uclass: Assign devnum as alias index in SPL too if CONFIG_SPL_DM_SEQ_ALIAS is enabled
Date: Thu, 25 Mar 2021 11:41:37 +0530	[thread overview]
Message-ID: <e6c8a65c-1767-071c-828e-cbf44002ee4c@ti.com> (raw)
In-Reply-To: <20210315104826.14587-3-a-govindraju@ti.com>

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 <a-govindraju@ti.com>
> ---
>  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

      parent reply	other threads:[~2021-03-25  6:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-15 10:48 [PATCH 0/2] mmc: Add support for checking device number against alias index Aswath Govindraju
2021-03-15 10:48 ` [PATCH 1/2] mmc: Check for device with a seq number equal to num before checking against index Aswath Govindraju
2021-03-16  5:48   ` Lokesh Vutla
2021-03-16 21:40   ` Jaehoon Chung
2021-03-15 10:48 ` [PATCH 2/2] mmc: mmc-uclass: Assign devnum as alias index in SPL too if CONFIG_SPL_DM_SEQ_ALIAS is enabled Aswath Govindraju
2021-03-16  5:48   ` Lokesh Vutla
2021-03-16 21:40   ` Jaehoon Chung
2021-03-25  6:11   ` Aswath Govindraju [this message]

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=e6c8a65c-1767-071c-828e-cbf44002ee4c@ti.com \
    --to=a-govindraju@ti.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 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.