All of lore.kernel.org
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: Richard Cochran <richardcochran@gmail.com>
Cc: linux-mtd@lists.infradead.org
Subject: Re: [PATCH] mtd: Added an ioctl to query the lock status of a flash sector.
Date: Sun, 13 Jun 2010 12:05:03 +0300	[thread overview]
Message-ID: <1276419903.19028.180.camel@localhost> (raw)
In-Reply-To: <20100531131214.GA15887@riccoc20.at.omicron.at>

On Mon, 2010-05-31 at 15:12 +0200, Richard Cochran wrote:
> This patchs adds a way for user space programs to find out whether a
> flash sector is locked. An optional driver method in the mtd_info struct
> provides the information.
> 
> Signed-off-by: Richard Cochran <richard.cochran@omicron.at>
> ---
>  drivers/mtd/chips/cfi_cmdset_0001.c |    8 ++++++++
>  drivers/mtd/mtdchar.c               |   14 ++++++++++++++
>  drivers/mtd/mtdpart.c               |   10 ++++++++++
>  include/linux/mtd/mtd.h             |    1 +
>  include/mtd/mtd-abi.h               |    1 +
>  5 files changed, 34 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c
> index 5fbf29e..67caca7 100644
> --- a/drivers/mtd/chips/cfi_cmdset_0001.c
> +++ b/drivers/mtd/chips/cfi_cmdset_0001.c
> @@ -63,6 +63,7 @@ static int cfi_intelext_erase_varsize(struct mtd_info *, struct erase_info *);
>  static void cfi_intelext_sync (struct mtd_info *);
>  static int cfi_intelext_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
>  static int cfi_intelext_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
> +static int cfi_intelext_locked(struct mtd_info *mtd, loff_t ofs, uint64_t len);
>  #ifdef CONFIG_MTD_OTP
>  static int cfi_intelext_read_fact_prot_reg (struct mtd_info *, loff_t, size_t, size_t *, u_char *);
>  static int cfi_intelext_read_user_prot_reg (struct mtd_info *, loff_t, size_t, size_t *, u_char *);
> @@ -448,6 +449,7 @@ struct mtd_info *cfi_cmdset_0001(struct map_info *map, int primary)
>  	mtd->sync    = cfi_intelext_sync;
>  	mtd->lock    = cfi_intelext_lock;
>  	mtd->unlock  = cfi_intelext_unlock;
> +	mtd->locked  = cfi_intelext_locked;
>  	mtd->suspend = cfi_intelext_suspend;
>  	mtd->resume  = cfi_intelext_resume;
>  	mtd->flags   = MTD_CAP_NORFLASH;

I think it is tiny bit nicer to name 'is_locked', which is a bit more
consistent with the already existing 'block_isbad'?

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

  reply	other threads:[~2010-06-13  9:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-31 13:12 [PATCH] mtd: Added an ioctl to query the lock status of a flash sector Richard Cochran
2010-06-13  9:05 ` Artem Bityutskiy [this message]
2010-06-14 16:10   ` Richard Cochran
2010-06-29  6:42     ` Artem Bityutskiy
2010-07-01  3:44     ` Artem Bityutskiy

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=1276419903.19028.180.camel@localhost \
    --to=dedekind1@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=richardcochran@gmail.com \
    /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.