lkml.org 
[lkml]   [2019]   [May]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 2/2] mtd: concat: implement _is_locked mtd operation
On Wed, May 22, 2019 at 2:08 AM Chris Packham
<chris.packham@alliedtelesis.co.nz> wrote:
>
> Add an implementation of the _is_locked operation for concatenated mtd
> devices. As with concat_lock/concat_unlock this can simply use the
> common helper and pass mtd_is_locked as the operation.
>
> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
> ---
> drivers/mtd/mtdconcat.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/mtd/mtdconcat.c b/drivers/mtd/mtdconcat.c
> index 9514cd2db63c..0e919f3423af 100644
> --- a/drivers/mtd/mtdconcat.c
> +++ b/drivers/mtd/mtdconcat.c
> @@ -496,6 +496,11 @@ static int concat_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len)
> return __concat_xxlock(mtd, ofs, len, mtd_unlock);
> }
>
> +static int concat_is_locked(struct mtd_info *mtd, loff_t ofs, uint64_t len)
> +{
> + return __concat_xxlock(mtd, ofs, len, mtd_is_locked);
> +}

Hmm, here you start abusing your own new API. :(

Did you verify that the unlock/lock-functions deal correctly with all
semantics from mtd_is_locked?
i.e. mtd_is_locked() with len = 0 returns 1 for spi-nor.

\
 
 \ /
  Last update: 2019-05-22 22:45    [W:0.222 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site