diff options
author | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2012-05-16 12:29:04 -0400 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2012-05-20 13:26:01 -0400 |
commit | 97d6104bac24c30258748e200065559cd53b4b02 (patch) | |
tree | f9c9c4772f33bc469a040e2a034964dd580c5d10 | |
parent | e2986827d5d0759788d00f3759bcd46fc28f96c5 (diff) |
UBI: rename few functions for consistency
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
-rw-r--r-- | drivers/mtd/ubi/debug.h | 5 | ||||
-rw-r--r-- | drivers/mtd/ubi/io.c | 20 | ||||
-rw-r--r-- | drivers/mtd/ubi/wl.c | 4 |
3 files changed, 15 insertions, 14 deletions
diff --git a/drivers/mtd/ubi/debug.h b/drivers/mtd/ubi/debug.h index 449937431f42..4d0a4cdc9e3b 100644 --- a/drivers/mtd/ubi/debug.h +++ b/drivers/mtd/ubi/debug.h | |||
@@ -62,9 +62,8 @@ void ubi_dump_vtbl_record(const struct ubi_vtbl_record *r, int idx); | |||
62 | void ubi_dump_sv(const struct ubi_scan_volume *sv); | 62 | void ubi_dump_sv(const struct ubi_scan_volume *sv); |
63 | void ubi_dump_seb(const struct ubi_scan_leb *seb, int type); | 63 | void ubi_dump_seb(const struct ubi_scan_leb *seb, int type); |
64 | void ubi_dump_mkvol_req(const struct ubi_mkvol_req *req); | 64 | void ubi_dump_mkvol_req(const struct ubi_mkvol_req *req); |
65 | int ubi_dbg_check_all_ff(struct ubi_device *ubi, int pnum, int offset, int len); | 65 | int ubi_self_check_all_ff(struct ubi_device *ubi, int pnum, int offset, |
66 | int ubi_dbg_check_write(struct ubi_device *ubi, const void *buf, int pnum, | 66 | int len); |
67 | int offset, int len); | ||
68 | int ubi_debugging_init_dev(struct ubi_device *ubi); | 67 | int ubi_debugging_init_dev(struct ubi_device *ubi); |
69 | void ubi_debugging_exit_dev(struct ubi_device *ubi); | 68 | void ubi_debugging_exit_dev(struct ubi_device *ubi); |
70 | int ubi_debugfs_init(void); | 69 | int ubi_debugfs_init(void); |
diff --git a/drivers/mtd/ubi/io.c b/drivers/mtd/ubi/io.c index 8a83962a940b..c37298577789 100644 --- a/drivers/mtd/ubi/io.c +++ b/drivers/mtd/ubi/io.c | |||
@@ -98,6 +98,8 @@ static int self_check_ec_hdr(const struct ubi_device *ubi, int pnum, | |||
98 | static int self_check_peb_vid_hdr(const struct ubi_device *ubi, int pnum); | 98 | static int self_check_peb_vid_hdr(const struct ubi_device *ubi, int pnum); |
99 | static int self_check_vid_hdr(const struct ubi_device *ubi, int pnum, | 99 | static int self_check_vid_hdr(const struct ubi_device *ubi, int pnum, |
100 | const struct ubi_vid_hdr *vid_hdr); | 100 | const struct ubi_vid_hdr *vid_hdr); |
101 | static int self_check_write(struct ubi_device *ubi, const void *buf, int pnum, | ||
102 | int offset, int len); | ||
101 | 103 | ||
102 | /** | 104 | /** |
103 | * ubi_io_read - read data from a physical eraseblock. | 105 | * ubi_io_read - read data from a physical eraseblock. |
@@ -254,7 +256,7 @@ int ubi_io_write(struct ubi_device *ubi, const void *buf, int pnum, int offset, | |||
254 | return err; | 256 | return err; |
255 | 257 | ||
256 | /* The area we are writing to has to contain all 0xFF bytes */ | 258 | /* The area we are writing to has to contain all 0xFF bytes */ |
257 | err = ubi_dbg_check_all_ff(ubi, pnum, offset, len); | 259 | err = ubi_self_check_all_ff(ubi, pnum, offset, len); |
258 | if (err) | 260 | if (err) |
259 | return err; | 261 | return err; |
260 | 262 | ||
@@ -289,7 +291,7 @@ int ubi_io_write(struct ubi_device *ubi, const void *buf, int pnum, int offset, | |||
289 | ubi_assert(written == len); | 291 | ubi_assert(written == len); |
290 | 292 | ||
291 | if (!err) { | 293 | if (!err) { |
292 | err = ubi_dbg_check_write(ubi, buf, pnum, offset, len); | 294 | err = self_check_write(ubi, buf, pnum, offset, len); |
293 | if (err) | 295 | if (err) |
294 | return err; | 296 | return err; |
295 | 297 | ||
@@ -300,7 +302,7 @@ int ubi_io_write(struct ubi_device *ubi, const void *buf, int pnum, int offset, | |||
300 | offset += len; | 302 | offset += len; |
301 | len = ubi->peb_size - offset; | 303 | len = ubi->peb_size - offset; |
302 | if (len) | 304 | if (len) |
303 | err = ubi_dbg_check_all_ff(ubi, pnum, offset, len); | 305 | err = ubi_self_check_all_ff(ubi, pnum, offset, len); |
304 | } | 306 | } |
305 | 307 | ||
306 | return err; | 308 | return err; |
@@ -382,7 +384,7 @@ retry: | |||
382 | return -EIO; | 384 | return -EIO; |
383 | } | 385 | } |
384 | 386 | ||
385 | err = ubi_dbg_check_all_ff(ubi, pnum, 0, ubi->peb_size); | 387 | err = ubi_self_check_all_ff(ubi, pnum, 0, ubi->peb_size); |
386 | if (err) | 388 | if (err) |
387 | return err; | 389 | return err; |
388 | 390 | ||
@@ -1316,7 +1318,7 @@ exit: | |||
1316 | } | 1318 | } |
1317 | 1319 | ||
1318 | /** | 1320 | /** |
1319 | * ubi_dbg_check_write - make sure write succeeded. | 1321 | * self_check_write - make sure write succeeded. |
1320 | * @ubi: UBI device description object | 1322 | * @ubi: UBI device description object |
1321 | * @buf: buffer with data which were written | 1323 | * @buf: buffer with data which were written |
1322 | * @pnum: physical eraseblock number the data were written to | 1324 | * @pnum: physical eraseblock number the data were written to |
@@ -1327,8 +1329,8 @@ exit: | |||
1327 | * the original data buffer - the data have to match. Returns zero if the data | 1329 | * the original data buffer - the data have to match. Returns zero if the data |
1328 | * match and a negative error code if not or in case of failure. | 1330 | * match and a negative error code if not or in case of failure. |
1329 | */ | 1331 | */ |
1330 | int ubi_dbg_check_write(struct ubi_device *ubi, const void *buf, int pnum, | 1332 | static int self_check_write(struct ubi_device *ubi, const void *buf, int pnum, |
1331 | int offset, int len) | 1333 | int offset, int len) |
1332 | { | 1334 | { |
1333 | int err, i; | 1335 | int err, i; |
1334 | size_t read; | 1336 | size_t read; |
@@ -1382,7 +1384,7 @@ out_free: | |||
1382 | } | 1384 | } |
1383 | 1385 | ||
1384 | /** | 1386 | /** |
1385 | * ubi_dbg_check_all_ff - check that a region of flash is empty. | 1387 | * ubi_self_check_all_ff - check that a region of flash is empty. |
1386 | * @ubi: UBI device description object | 1388 | * @ubi: UBI device description object |
1387 | * @pnum: the physical eraseblock number to check | 1389 | * @pnum: the physical eraseblock number to check |
1388 | * @offset: the starting offset within the physical eraseblock to check | 1390 | * @offset: the starting offset within the physical eraseblock to check |
@@ -1392,7 +1394,7 @@ out_free: | |||
1392 | * @offset of the physical eraseblock @pnum, and a negative error code if not | 1394 | * @offset of the physical eraseblock @pnum, and a negative error code if not |
1393 | * or if an error occurred. | 1395 | * or if an error occurred. |
1394 | */ | 1396 | */ |
1395 | int ubi_dbg_check_all_ff(struct ubi_device *ubi, int pnum, int offset, int len) | 1397 | int ubi_self_check_all_ff(struct ubi_device *ubi, int pnum, int offset, int len) |
1396 | { | 1398 | { |
1397 | size_t read; | 1399 | size_t read; |
1398 | int err; | 1400 | int err; |
diff --git a/drivers/mtd/ubi/wl.c b/drivers/mtd/ubi/wl.c index 75d2c1f7c3a8..b847f5529ba6 100644 --- a/drivers/mtd/ubi/wl.c +++ b/drivers/mtd/ubi/wl.c | |||
@@ -414,8 +414,8 @@ retry: | |||
414 | prot_queue_add(ubi, e); | 414 | prot_queue_add(ubi, e); |
415 | spin_unlock(&ubi->wl_lock); | 415 | spin_unlock(&ubi->wl_lock); |
416 | 416 | ||
417 | err = ubi_dbg_check_all_ff(ubi, e->pnum, ubi->vid_hdr_aloffset, | 417 | err = ubi_self_check_all_ff(ubi, e->pnum, ubi->vid_hdr_aloffset, |
418 | ubi->peb_size - ubi->vid_hdr_aloffset); | 418 | ubi->peb_size - ubi->vid_hdr_aloffset); |
419 | if (err) { | 419 | if (err) { |
420 | ubi_err("new PEB %d does not contain all 0xFF bytes", e->pnum); | 420 | ubi_err("new PEB %d does not contain all 0xFF bytes", e->pnum); |
421 | return err; | 421 | return err; |