public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/4] dfu: Find DFU alt setting number by passing its name
Date: Tue, 10 Sep 2013 16:32:53 +0200	[thread overview]
Message-ID: <201309101632.53970.marex@denx.de> (raw)
In-Reply-To: <1378819765-20159-4-git-send-email-l.majewski@samsung.com>

Dear Lukasz Majewski,

> New function - dfu_get_alt() has been added to dfu core. If proper
> alt setting is present, this function returns its number
> corresponding to passed name.
> 
> Change-Id: Icd75f3aa3a6f6e306c77b28cabe620e4e6a253ea
> Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
> ---
>  drivers/dfu/dfu.c |   12 ++++++++++++
>  include/dfu.h     |    1 +
>  2 files changed, 13 insertions(+)
> 
> diff --git a/drivers/dfu/dfu.c b/drivers/dfu/dfu.c
> index 2f1e2af..180d083 100644
> --- a/drivers/dfu/dfu.c
> +++ b/drivers/dfu/dfu.c
> @@ -414,3 +414,15 @@ struct dfu_entity *dfu_get_entity(int alt)
> 
>  	return NULL;
>  }
> +
> +int dfu_get_alt(const char *name)
> +{
> +	struct dfu_entity *dfu;
> +
> +	list_for_each_entry(dfu, &dfu_list, list) {
> +		if (!strncmp(dfu->name, name, strlen(dfu->name)))
> +			return dfu->alt;
> +	}
> +
> +	return -ENODEV;
> +}
> diff --git a/include/dfu.h b/include/dfu.h
> index 7779710..8838f9c 100644
> --- a/include/dfu.h
> +++ b/include/dfu.h
> @@ -112,6 +112,7 @@ const char *dfu_get_layout(enum dfu_layout l);
>  struct dfu_entity *dfu_get_entity(int alt);
>  char *dfu_extract_token(char** e, int *n);
>  void dfu_trigger_reset(void);
> +int dfu_get_alt(const char *name);
>  bool dfu_reset(void);
> 
>  int dfu_read(struct dfu_entity *de, void *buf, int size, int blk_seq_num);

Is this code used anywhere ?

Best regards,
Marek Vasut

  reply	other threads:[~2013-09-10 14:32 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-10 13:29 [U-Boot] [PATCH 0/4] dfu: Various fixes and code optimizations Lukasz Majewski
2013-09-10 13:29 ` [U-Boot] [PATCH 1/4] dfu:cosmetic: Fix printf text for buffer overflow condition Lukasz Majewski
2013-09-11  4:38   ` Heiko Schocher
2013-09-10 13:29 ` [U-Boot] [PATCH 2/4] dfu: Make maximum DFU file size equal to default DFU data buffer Lukasz Majewski
2013-09-11  4:38   ` Heiko Schocher
2013-09-10 13:29 ` [U-Boot] [PATCH 3/4] dfu: Find DFU alt setting number by passing its name Lukasz Majewski
2013-09-10 14:32   ` Marek Vasut [this message]
2013-09-10 15:13     ` Lukasz Majewski
2013-09-10 21:20       ` Marek Vasut
2013-09-11  4:42         ` Heiko Schocher
2013-09-11  7:16           ` Lukasz Majewski
2013-09-10 13:29 ` [U-Boot] [PATCH 4/4] dfu: Extract common DFU code to handle "dfu_alt_info" environment variable Lukasz Majewski
2013-09-11  4:39   ` Heiko Schocher
2013-09-11  7:19   ` Marek Vasut
2013-09-11  9:09     ` Lukasz Majewski
2013-09-11 10:04       ` Marek Vasut
2013-09-11 11:30         ` Lukasz Majewski
2013-09-11 11:52           ` Marek Vasut
2013-09-11 12:53   ` [U-Boot] [PATCH 4/4 v2] " Lukasz Majewski
2013-09-12 10:37     ` Marek Vasut

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=201309101632.53970.marex@denx.de \
    --to=marex@denx.de \
    --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