diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2015-10-15 09:08:44 -0400 |
---|---|---|
committer | Brian Norris <computersforpeace@gmail.com> | 2015-11-10 20:56:05 -0500 |
commit | a486d11f5d71b88eb235fdfc035eebca5f35f120 (patch) | |
tree | 3d93b485aa4c76c3b0193a997fa82b9645a7ece9 | |
parent | 89a41cbba6610b48e793ce6ac5bd46031c7531cc (diff) |
mtd: afs: rename structs and functions for v1
Since we're gonna add the v2 version of flash information
structure and we want to avoid confusion, rename the old
functions to *v1. Cut the word "structure" from the struct
name, it is pretty obvious that it is a struct already from
the keyword.
Cc: Ryan Harkin <ryan.harkin@linaro.org>
Cc: Liviu Dudau <liviu.dudau@arm.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
-rw-r--r-- | drivers/mtd/afs.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/mtd/afs.c b/drivers/mtd/afs.c index 96a33e3f7b00..9af00528586f 100644 --- a/drivers/mtd/afs.c +++ b/drivers/mtd/afs.c | |||
@@ -34,7 +34,7 @@ | |||
34 | #include <linux/mtd/map.h> | 34 | #include <linux/mtd/map.h> |
35 | #include <linux/mtd/partitions.h> | 35 | #include <linux/mtd/partitions.h> |
36 | 36 | ||
37 | struct footer_struct { | 37 | struct footer_v1 { |
38 | u32 image_info_base; /* Address of first word of ImageFooter */ | 38 | u32 image_info_base; /* Address of first word of ImageFooter */ |
39 | u32 image_start; /* Start of area reserved by this footer */ | 39 | u32 image_start; /* Start of area reserved by this footer */ |
40 | u32 signature; /* 'Magic' number proves it's a footer */ | 40 | u32 signature; /* 'Magic' number proves it's a footer */ |
@@ -42,7 +42,7 @@ struct footer_struct { | |||
42 | u32 checksum; /* Just this structure */ | 42 | u32 checksum; /* Just this structure */ |
43 | }; | 43 | }; |
44 | 44 | ||
45 | struct image_info_struct { | 45 | struct image_info_v1 { |
46 | u32 bootFlags; /* Boot flags, compression etc. */ | 46 | u32 bootFlags; /* Boot flags, compression etc. */ |
47 | u32 imageNumber; /* Unique number, selects for boot etc. */ | 47 | u32 imageNumber; /* Unique number, selects for boot etc. */ |
48 | u32 loadAddress; /* Address program should be loaded to */ | 48 | u32 loadAddress; /* Address program should be loaded to */ |
@@ -67,10 +67,10 @@ static u32 word_sum(void *words, int num) | |||
67 | } | 67 | } |
68 | 68 | ||
69 | static int | 69 | static int |
70 | afs_read_footer(struct mtd_info *mtd, u_int *img_start, u_int *iis_start, | 70 | afs_read_footer_v1(struct mtd_info *mtd, u_int *img_start, u_int *iis_start, |
71 | u_int off, u_int mask) | 71 | u_int off, u_int mask) |
72 | { | 72 | { |
73 | struct footer_struct fs; | 73 | struct footer_v1 fs; |
74 | u_int ptr = off + mtd->erasesize - sizeof(fs); | 74 | u_int ptr = off + mtd->erasesize - sizeof(fs); |
75 | size_t sz; | 75 | size_t sz; |
76 | int ret; | 76 | int ret; |
@@ -126,7 +126,7 @@ afs_read_footer(struct mtd_info *mtd, u_int *img_start, u_int *iis_start, | |||
126 | } | 126 | } |
127 | 127 | ||
128 | static int | 128 | static int |
129 | afs_read_iis(struct mtd_info *mtd, struct image_info_struct *iis, u_int ptr) | 129 | afs_read_iis_v1(struct mtd_info *mtd, struct image_info_v1 *iis, u_int ptr) |
130 | { | 130 | { |
131 | size_t sz; | 131 | size_t sz; |
132 | int ret, i; | 132 | int ret, i; |
@@ -182,16 +182,16 @@ static int parse_afs_partitions(struct mtd_info *mtd, | |||
182 | * the strings. | 182 | * the strings. |
183 | */ | 183 | */ |
184 | for (idx = off = sz = 0; off < mtd->size; off += mtd->erasesize) { | 184 | for (idx = off = sz = 0; off < mtd->size; off += mtd->erasesize) { |
185 | struct image_info_struct iis; | 185 | struct image_info_v1 iis; |
186 | u_int iis_ptr, img_ptr; | 186 | u_int iis_ptr, img_ptr; |
187 | 187 | ||
188 | ret = afs_read_footer(mtd, &img_ptr, &iis_ptr, off, mask); | 188 | ret = afs_read_footer_v1(mtd, &img_ptr, &iis_ptr, off, mask); |
189 | if (ret < 0) | 189 | if (ret < 0) |
190 | break; | 190 | break; |
191 | if (ret == 0) | 191 | if (ret == 0) |
192 | continue; | 192 | continue; |
193 | 193 | ||
194 | ret = afs_read_iis(mtd, &iis, iis_ptr); | 194 | ret = afs_read_iis_v1(mtd, &iis, iis_ptr); |
195 | if (ret < 0) | 195 | if (ret < 0) |
196 | break; | 196 | break; |
197 | if (ret == 0) | 197 | if (ret == 0) |
@@ -215,18 +215,18 @@ static int parse_afs_partitions(struct mtd_info *mtd, | |||
215 | * Identify the partitions | 215 | * Identify the partitions |
216 | */ | 216 | */ |
217 | for (idx = off = 0; off < mtd->size; off += mtd->erasesize) { | 217 | for (idx = off = 0; off < mtd->size; off += mtd->erasesize) { |
218 | struct image_info_struct iis; | 218 | struct image_info_v1 iis; |
219 | u_int iis_ptr, img_ptr; | 219 | u_int iis_ptr, img_ptr; |
220 | 220 | ||
221 | /* Read the footer. */ | 221 | /* Read the footer. */ |
222 | ret = afs_read_footer(mtd, &img_ptr, &iis_ptr, off, mask); | 222 | ret = afs_read_footer_v1(mtd, &img_ptr, &iis_ptr, off, mask); |
223 | if (ret < 0) | 223 | if (ret < 0) |
224 | break; | 224 | break; |
225 | if (ret == 0) | 225 | if (ret == 0) |
226 | continue; | 226 | continue; |
227 | 227 | ||
228 | /* Read the image info block */ | 228 | /* Read the image info block */ |
229 | ret = afs_read_iis(mtd, &iis, iis_ptr); | 229 | ret = afs_read_iis_v1(mtd, &iis, iis_ptr); |
230 | if (ret < 0) | 230 | if (ret < 0) |
231 | break; | 231 | break; |
232 | if (ret == 0) | 232 | if (ret == 0) |