Message ID | 20180322215350.3631-1-sjoerd.simons@collabora.co.uk |
---|---|
State | Accepted |
Commit | d48b8d1138a45ee88f2af0a883d87a1a93ae0592 |
Headers | show |
Series | env: Properly check for BLK support | expand |
On 23 March 2018 at 05:53, Sjoerd Simons <sjoerd.simons@collabora.co.uk> wrote: > Use CONFIG_IS_ENABLED to see if CONFIG_BLK is enabled. Otherwise > SPL compilation breaks on boards which do have CONFIG_BLK enabled but > not DM_MMC for the SPL as follows: > > env/mmc.c: In function ‘init_mmc_for_env’: > env/mmc.c:164:6: warning: implicit declaration of function ‘blk_get_from_parent’; did you mean ‘efi_get_ram_base’? [-Wimplicit-function-declaration] > if (blk_get_from_parent(mmc->dev, &dev)) > ^~~~~~~~~~~~~~~~~~~ > efi_get_ram_base > env/mmc.c:164:29: error: ‘struct mmc’ has no member named ‘dev’ > if (blk_get_from_parent(mmc->dev, &dev)) > ^~ > > Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk> > --- > > env/mmc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Simon Glass <sjg@chromium.org>
On Thu, Mar 22, 2018 at 10:53:50PM +0100, Sjoerd Simons wrote: > Use CONFIG_IS_ENABLED to see if CONFIG_BLK is enabled. Otherwise > SPL compilation breaks on boards which do have CONFIG_BLK enabled but > not DM_MMC for the SPL as follows: > > env/mmc.c: In function ‘init_mmc_for_env’: > env/mmc.c:164:6: warning: implicit declaration of function ‘blk_get_from_parent’; did you mean ‘efi_get_ram_base’? [-Wimplicit-function-declaration] > if (blk_get_from_parent(mmc->dev, &dev)) > ^~~~~~~~~~~~~~~~~~~ > efi_get_ram_base > env/mmc.c:164:29: error: ‘struct mmc’ has no member named ‘dev’ > if (blk_get_from_parent(mmc->dev, &dev)) > ^~ > > Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk> > Reviewed-by: Simon Glass <sjg@chromium.org> Applied to u-boot/master, thanks! -- Tom
diff --git a/env/mmc.c b/env/mmc.c index 6f11deccb1..bf7015cd14 100644 --- a/env/mmc.c +++ b/env/mmc.c @@ -158,7 +158,7 @@ static const char *init_mmc_for_env(struct mmc *mmc) if (!mmc) return "!No MMC card found"; -#ifdef CONFIG_BLK +#if CONFIG_IS_ENABLED(BLK) struct udevice *dev; if (blk_get_from_parent(mmc->dev, &dev))
Use CONFIG_IS_ENABLED to see if CONFIG_BLK is enabled. Otherwise SPL compilation breaks on boards which do have CONFIG_BLK enabled but not DM_MMC for the SPL as follows: env/mmc.c: In function ‘init_mmc_for_env’: env/mmc.c:164:6: warning: implicit declaration of function ‘blk_get_from_parent’; did you mean ‘efi_get_ram_base’? [-Wimplicit-function-declaration] if (blk_get_from_parent(mmc->dev, &dev)) ^~~~~~~~~~~~~~~~~~~ efi_get_ram_base env/mmc.c:164:29: error: ‘struct mmc’ has no member named ‘dev’ if (blk_get_from_parent(mmc->dev, &dev)) ^~ Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk> --- env/mmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)