public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Lukasz Majewski <l.majewski@samsung.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 1/3] dfu: unify mmc/nand read/write ops enum
Date: Tue, 10 Sep 2013 11:09:46 +0200	[thread overview]
Message-ID: <20130910110946.4416cb91@amdc308.digital.local> (raw)
In-Reply-To: <fcf828d043a9bdac29fb2c0eaba89e509f0d799c.1378780517.git.afzal.mohd.ma@gmail.com>

Hi Afzal,

> MMC and NAND independently defines same enumerators for read/write.
> Unify them by defining enum in dfu header. RAM support that is being
> added newly also can make use of it.
> 
> Signed-off-by: Afzal Mohammed <afzal.mohd.ma@gmail.com>
> Cc: Lukasz Majewski <l.majewski@samsung.com>
> Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
> ---
> 
> v2: new
> 
>  drivers/dfu/dfu_mmc.c  | 9 ++-------
>  drivers/dfu/dfu_nand.c | 7 +------
>  include/dfu.h          | 5 +++++
>  3 files changed, 8 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/dfu/dfu_mmc.c b/drivers/dfu/dfu_mmc.c
> index 0871a77..f942758 100644
> --- a/drivers/dfu/dfu_mmc.c
> +++ b/drivers/dfu/dfu_mmc.c
> @@ -13,16 +13,11 @@
>  #include <div64.h>
>  #include <dfu.h>
>  
> -enum dfu_mmc_op {
> -	DFU_OP_READ = 1,
> -	DFU_OP_WRITE,
> -};
> -
>  static unsigned char __aligned(CONFIG_SYS_CACHELINE_SIZE)
>  				dfu_file_buf[CONFIG_SYS_DFU_MAX_FILE_SIZE];
>  static long dfu_file_buf_len;
>  
> -static int mmc_block_op(enum dfu_mmc_op op, struct dfu_entity *dfu,
> +static int mmc_block_op(enum dfu_op op, struct dfu_entity *dfu,
>  			u64 offset, void *buf, long *len)
>  {
>  	char cmd_buf[DFU_CMD_BUF_SIZE];
> @@ -65,7 +60,7 @@ static int mmc_file_buffer(struct dfu_entity *dfu,
> void *buf, long *len) return 0;
>  }
>  
> -static int mmc_file_op(enum dfu_mmc_op op, struct dfu_entity *dfu,
> +static int mmc_file_op(enum dfu_op op, struct dfu_entity *dfu,
>  			void *buf, long *len)
>  {
>  	char cmd_buf[DFU_CMD_BUF_SIZE];
> diff --git a/drivers/dfu/dfu_nand.c b/drivers/dfu/dfu_nand.c
> index 0ec12cf..edbf5a9 100644
> --- a/drivers/dfu/dfu_nand.c
> +++ b/drivers/dfu/dfu_nand.c
> @@ -19,12 +19,7 @@
>  #include <jffs2/load_kernel.h>
>  #include <nand.h>
>  
> -enum dfu_nand_op {
> -	DFU_OP_READ = 1,
> -	DFU_OP_WRITE,
> -};
> -
> -static int nand_block_op(enum dfu_nand_op op, struct dfu_entity *dfu,
> +static int nand_block_op(enum dfu_op op, struct dfu_entity *dfu,
>  			u64 offset, void *buf, long *len)
>  {
>  	loff_t start, lim;
> diff --git a/include/dfu.h b/include/dfu.h
> index 47b9055..6115d90 100644
> --- a/include/dfu.h
> +++ b/include/dfu.h
> @@ -29,6 +29,11 @@ enum dfu_layout {
>  	DFU_FS_EXT4,
>  };
>  
> +enum dfu_op {
> +	DFU_OP_READ = 1,
> +	DFU_OP_WRITE,
> +};
> +
>  struct mmc_internal_data {
>  	/* RAW programming */
>  	unsigned int lba_start;


Acked-by: Lukasz Majewski <l.majewski@samsung.com>

-- 
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group

      parent reply	other threads:[~2013-09-10  9:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-10  2:44 [U-Boot] [PATCH v2 1/3] dfu: unify mmc/nand read/write ops enum Afzal Mohammed
2013-09-10  2:45 ` [U-Boot] [PATCH v2 2/3] dfu: ram support Afzal Mohammed
2013-09-10  9:21   ` Lukasz Majewski
2013-09-10 14:13     ` Afzal Mohammed
2013-09-10  2:45 ` [U-Boot] [PATCH v2 3/3] am335x_evm: enable DFU RAM Afzal Mohammed
2013-09-10  9:25   ` Lukasz Majewski
2013-09-10  9:09 ` Lukasz Majewski [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=20130910110946.4416cb91@amdc308.digital.local \
    --to=l.majewski@samsung.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