uboot-mediatek: update to U-Boot 2023.01
[openwrt/staging/nbd.git] / package / boot / uboot-mediatek / patches / 100-24-cmd-ubi-make-volume-find-create-remove-APIs-public.patch
1 From dd66fc817f7ab7a4fcab9836a9251a8f64f329df Mon Sep 17 00:00:00 2001
2 From: Weijie Gao <weijie.gao@mediatek.com>
3 Date: Mon, 25 Jul 2022 16:58:36 +0800
4 Subject: [PATCH 59/71] cmd: ubi: make volume find/create/remove APIs public
5
6 Export ubi_create_vol/ubi_find_volume/ubi_remove_vol to public so that they
7 can be used by other programs.
8
9 Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
10 ---
11 cmd/ubi.c | 8 ++++----
12 include/ubi_uboot.h | 4 ++++
13 2 files changed, 8 insertions(+), 4 deletions(-)
14
15 --- a/cmd/ubi.c
16 +++ b/cmd/ubi.c
17 @@ -213,8 +213,8 @@ bad:
18 return err;
19 }
20
21 -static int ubi_create_vol(char *volume, int64_t size, int dynamic, int vol_id,
22 - bool skipcheck)
23 +int ubi_create_vol(char *volume, int64_t size, int dynamic, int vol_id,
24 + bool skipcheck)
25 {
26 struct ubi_mkvol_req req;
27 int err;
28 @@ -247,7 +247,7 @@ static int ubi_create_vol(char *volume,
29 return ubi_create_volume(ubi, &req);
30 }
31
32 -static struct ubi_volume *ubi_find_volume(char *volume)
33 +struct ubi_volume *ubi_find_volume(char *volume)
34 {
35 struct ubi_volume *vol = NULL;
36 int i;
37 @@ -262,7 +262,7 @@ static struct ubi_volume *ubi_find_volum
38 return NULL;
39 }
40
41 -static int ubi_remove_vol(char *volume)
42 +int ubi_remove_vol(char *volume)
43 {
44 int err, reserved_pebs, i;
45 struct ubi_volume *vol;
46 --- a/include/ubi_uboot.h
47 +++ b/include/ubi_uboot.h
48 @@ -73,6 +73,10 @@ extern void ubi_exit(void);
49 extern int ubi_part(char *part_name, const char *vid_header_offset);
50 extern int ubi_volume_write(char *volume, void *buf, size_t size);
51 extern int ubi_volume_read(char *volume, char *buf, size_t size);
52 +extern int ubi_create_vol(char *volume, int64_t size, int dynamic, int vol_id,
53 + bool skipcheck);
54 +extern struct ubi_volume *ubi_find_volume(char *volume);
55 +extern int ubi_remove_vol(char *volume);
56
57 extern struct ubi_device *ubi_devices[];
58 int cmd_ubifs_mount(char *vol_name);