public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Eugeniu Rosca <roscaeugeniu@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 2/2] avb2.0: use block API in AVB ops
Date: Wed, 18 Jul 2018 00:26:13 +0200	[thread overview]
Message-ID: <20180717222613.GB21624@x230> (raw)
In-Reply-To: <1531827206-16158-3-git-send-email-igor.opaniuk@linaro.org>

On Tue, Jul 17, 2018 at 02:33:26PM +0300, Igor Opaniuk wrote:
> Use blk_dread()/blk_dwrite() in mmc_read()/mmc_write() AVB operation
> implementations. This fixes compilation issues when CONFIG_BLK is
> enabled.
> 
> Signed-off-by: Igor Opaniuk <igor.opaniuk@linaro.org>
> ---
>  common/avb_verify.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/common/avb_verify.c b/common/avb_verify.c
> index f9a00f8..20e35ad 100644
> --- a/common/avb_verify.c
> +++ b/common/avb_verify.c
> @@ -5,6 +5,7 @@
>   */
>  
>  #include <avb_verify.h>
> +#include <blk.h>
>  #include <fastboot.h>
>  #include <image.h>
>  #include <malloc.h>
> @@ -288,8 +289,8 @@ static unsigned long mmc_read_and_flush(struct mmc_part *part,
>  		tmp_buf = buffer;
>  	}
>  
> -	blks = part->mmc->block_dev.block_read(part->mmc_blk,
> -				start, sectors, tmp_buf);
> +	blks = blk_dread(part->mmc_blk,
> +			 start, sectors, tmp_buf);
>  	/* flush cache after read */
>  	flush_cache((ulong)tmp_buf, sectors * part->info.blksz);
>  
> @@ -327,8 +328,8 @@ static unsigned long mmc_write(struct mmc_part *part, lbaint_t start,
>  		tmp_buf = buffer;
>  	}
>  
> -	return part->mmc->block_dev.block_write(part->mmc_blk,
> -				start, sectors, tmp_buf);
> +	return blk_dwrite(part->mmc_blk,
> +			  start, sectors, tmp_buf);
>  }
>  
>  static struct mmc_part *get_partition(AvbOps *ops, const char *partition)
> -- 
> 2.7.4
> 

I confirm this patch fixes below compilation failure on sandbox
(LIBAVB=y, AVB_VERIFY=y, FASTBOOT=y, BLK=y):

common/avb_verify.c: In function ‘mmc_read_and_flush’:
common/avb_verify.c:291:18: error: ‘struct mmc’ has no member named ‘block_dev’
  blks = part->mmc->block_dev.block_read(part->mmc_blk,
                  ^~
common/avb_verify.c: In function ‘mmc_write’:
common/avb_verify.c:330:18: error: ‘struct mmc’ has no member named ‘block_dev’
  return part->mmc->block_dev.block_write(part->mmc_blk,

With this patch, avb_verify compiles equally well with BLK=y and BLK=n.

Tested-by: Eugeniu Rosca <rosca.eugeniu@gmail.com>

Thanks,
Eugeniu.

  reply	other threads:[~2018-07-17 22:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-17 11:33 [U-Boot] [PATCH v2 0/2] avb2.0: fix multiple compilation issues in sandbox Igor Opaniuk
2018-07-17 11:33 ` [U-Boot] [PATCH v2 1/2] avb2.0: add proper dependencies Igor Opaniuk
2018-07-17 22:08   ` Eugeniu Rosca
2018-07-26 19:54   ` [U-Boot] [U-Boot,v2,1/2] " Tom Rini
2018-07-17 11:33 ` [U-Boot] [PATCH v2 2/2] avb2.0: use block API in AVB ops Igor Opaniuk
2018-07-17 22:26   ` Eugeniu Rosca [this message]
2018-07-26 19:54   ` [U-Boot] [U-Boot,v2,2/2] " Tom Rini

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=20180717222613.GB21624@x230 \
    --to=roscaeugeniu@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox