diff options
author | Boris Brezillon <boris.brezillon@free-electrons.com> | 2016-09-16 16:59:23 +0200 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2016-10-02 22:48:14 +0200 |
commit | 7554769641da272ea8821194c2efda08a11014b0 (patch) | |
tree | b6d086adee9f4b35879e85e435e9585222193b5a /drivers/mtd/ubi/kapi.c | |
parent | 9a5f09ac0ab83e4a965a24edd6cf7cb0303c6dc9 (diff) | |
download | linux-7554769641da272ea8821194c2efda08a11014b0.tar.bz2 |
UBI: provide an helper to check whether a LEB is mapped or not
This is part of the process of hiding UBI EBA's internal to other part of
the UBI implementation, so that we can add new information to the EBA
table without having to patch different places in the UBI code.
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'drivers/mtd/ubi/kapi.c')
-rw-r--r-- | drivers/mtd/ubi/kapi.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mtd/ubi/kapi.c b/drivers/mtd/ubi/kapi.c index cec7f65beb9e..88b1897aeb40 100644 --- a/drivers/mtd/ubi/kapi.c +++ b/drivers/mtd/ubi/kapi.c @@ -722,7 +722,7 @@ int ubi_leb_map(struct ubi_volume_desc *desc, int lnum) if (vol->upd_marker) return -EBADF; - if (vol->eba_tbl[lnum] >= 0) + if (ubi_eba_is_mapped(vol, lnum)) return -EBADMSG; return ubi_eba_write_leb(ubi, vol, lnum, NULL, 0, 0); @@ -757,7 +757,7 @@ int ubi_is_mapped(struct ubi_volume_desc *desc, int lnum) if (vol->upd_marker) return -EBADF; - return vol->eba_tbl[lnum] >= 0; + return ubi_eba_is_mapped(vol, lnum); } EXPORT_SYMBOL_GPL(ubi_is_mapped); |