Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 106066
b: refs/heads/master
c: a5bf619
h: refs/heads/master
v: v3
  • Loading branch information
Artem Bityutskiy authored and Artem Bityutskiy committed Jul 24, 2008
1 parent 9187094 commit 652b1d1
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 73789a3d9fd8e500e121c1d4a5a2b16dd748ab5f
refs/heads/master: a5bf6190417cbbf80443a9f71c65b653e13e9982
24 changes: 24 additions & 0 deletions trunk/drivers/mtd/ubi/kapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -632,3 +632,27 @@ int ubi_is_mapped(struct ubi_volume_desc *desc, int lnum)
return vol->eba_tbl[lnum] >= 0;
}
EXPORT_SYMBOL_GPL(ubi_is_mapped);

/**
* ubi_sync - synchronize UBI device buffers.
* @ubi_num: UBI device to synchronize
*
* The underlying MTD device may cache data in hardware or in software. This
* function ensures the caches are flushed. Returns zero in case of success and
* a negative error code in case of failure.
*/
int ubi_sync(int ubi_num)
{
struct ubi_device *ubi;

ubi = ubi_get_device(ubi_num);
if (!ubi)
return -ENODEV;

if (ubi->mtd->sync)
ubi->mtd->sync(ubi->mtd);

ubi_put_device(ubi);
return 0;
}
EXPORT_SYMBOL_GPL(ubi_sync);
1 change: 1 addition & 0 deletions trunk/include/linux/mtd/ubi.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ int ubi_leb_erase(struct ubi_volume_desc *desc, int lnum);
int ubi_leb_unmap(struct ubi_volume_desc *desc, int lnum);
int ubi_leb_map(struct ubi_volume_desc *desc, int lnum, int dtype);
int ubi_is_mapped(struct ubi_volume_desc *desc, int lnum);
int ubi_sync(int ubi_num);

/*
* This function is the same as the 'ubi_leb_read()' function, but it does not
Expand Down

0 comments on commit 652b1d1

Please sign in to comment.