diff options
| -rw-r--r-- | drivers/mtd/ubi/build.c | 8 | ||||
| -rw-r--r-- | drivers/mtd/ubi/cdev.c | 24 | ||||
| -rw-r--r-- | drivers/mtd/ubi/debug.h | 2 | ||||
| -rw-r--r-- | drivers/mtd/ubi/io.c | 36 | ||||
| -rw-r--r-- | drivers/mtd/ubi/kapi.c | 2 | ||||
| -rw-r--r-- | drivers/mtd/ubi/scan.c | 10 | ||||
| -rw-r--r-- | drivers/mtd/ubi/vmt.c | 18 | ||||
| -rw-r--r-- | drivers/mtd/ubi/vtbl.c | 6 |
8 files changed, 52 insertions, 54 deletions
diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c index 0fde9fc7d2e5..2d5728294a66 100644 --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c | |||
| @@ -881,7 +881,7 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num, int vid_hdr_offset) | |||
| 881 | for (i = 0; i < UBI_MAX_DEVICES; i++) { | 881 | for (i = 0; i < UBI_MAX_DEVICES; i++) { |
| 882 | ubi = ubi_devices[i]; | 882 | ubi = ubi_devices[i]; |
| 883 | if (ubi && mtd->index == ubi->mtd->index) { | 883 | if (ubi && mtd->index == ubi->mtd->index) { |
| 884 | dbg_err("mtd%d is already attached to ubi%d", | 884 | ubi_err("mtd%d is already attached to ubi%d", |
| 885 | mtd->index, i); | 885 | mtd->index, i); |
| 886 | return -EEXIST; | 886 | return -EEXIST; |
| 887 | } | 887 | } |
| @@ -907,7 +907,7 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num, int vid_hdr_offset) | |||
| 907 | if (!ubi_devices[ubi_num]) | 907 | if (!ubi_devices[ubi_num]) |
| 908 | break; | 908 | break; |
| 909 | if (ubi_num == UBI_MAX_DEVICES) { | 909 | if (ubi_num == UBI_MAX_DEVICES) { |
| 910 | dbg_err("only %d UBI devices may be created", | 910 | ubi_err("only %d UBI devices may be created", |
| 911 | UBI_MAX_DEVICES); | 911 | UBI_MAX_DEVICES); |
| 912 | return -ENFILE; | 912 | return -ENFILE; |
| 913 | } | 913 | } |
| @@ -917,7 +917,7 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num, int vid_hdr_offset) | |||
| 917 | 917 | ||
| 918 | /* Make sure ubi_num is not busy */ | 918 | /* Make sure ubi_num is not busy */ |
| 919 | if (ubi_devices[ubi_num]) { | 919 | if (ubi_devices[ubi_num]) { |
| 920 | dbg_err("ubi%d already exists", ubi_num); | 920 | ubi_err("ubi%d already exists", ubi_num); |
| 921 | return -EEXIST; | 921 | return -EEXIST; |
| 922 | } | 922 | } |
| 923 | } | 923 | } |
| @@ -955,7 +955,7 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num, int vid_hdr_offset) | |||
| 955 | 955 | ||
| 956 | err = attach_by_scanning(ubi); | 956 | err = attach_by_scanning(ubi); |
| 957 | if (err) { | 957 | if (err) { |
| 958 | dbg_err("failed to attach by scanning, error %d", err); | 958 | ubi_err("failed to attach by scanning, error %d", err); |
| 959 | goto out_debugging; | 959 | goto out_debugging; |
| 960 | } | 960 | } |
| 961 | 961 | ||
diff --git a/drivers/mtd/ubi/cdev.c b/drivers/mtd/ubi/cdev.c index 633ac82bbd22..2364c00f66d0 100644 --- a/drivers/mtd/ubi/cdev.c +++ b/drivers/mtd/ubi/cdev.c | |||
| @@ -63,7 +63,7 @@ static int get_exclusive(struct ubi_volume_desc *desc) | |||
| 63 | users = vol->readers + vol->writers + vol->exclusive; | 63 | users = vol->readers + vol->writers + vol->exclusive; |
| 64 | ubi_assert(users > 0); | 64 | ubi_assert(users > 0); |
| 65 | if (users > 1) { | 65 | if (users > 1) { |
| 66 | dbg_err("%d users for volume %d", users, vol->vol_id); | 66 | ubi_err("%d users for volume %d", users, vol->vol_id); |
| 67 | err = -EBUSY; | 67 | err = -EBUSY; |
| 68 | } else { | 68 | } else { |
| 69 | vol->readers = vol->writers = 0; | 69 | vol->readers = vol->writers = 0; |
| @@ -159,7 +159,7 @@ static loff_t vol_cdev_llseek(struct file *file, loff_t offset, int origin) | |||
| 159 | 159 | ||
| 160 | if (vol->updating) { | 160 | if (vol->updating) { |
| 161 | /* Update is in progress, seeking is prohibited */ | 161 | /* Update is in progress, seeking is prohibited */ |
| 162 | dbg_err("updating"); | 162 | ubi_err("updating"); |
| 163 | return -EBUSY; | 163 | return -EBUSY; |
| 164 | } | 164 | } |
| 165 | 165 | ||
| @@ -178,7 +178,7 @@ static loff_t vol_cdev_llseek(struct file *file, loff_t offset, int origin) | |||
| 178 | } | 178 | } |
| 179 | 179 | ||
| 180 | if (new_offset < 0 || new_offset > vol->used_bytes) { | 180 | if (new_offset < 0 || new_offset > vol->used_bytes) { |
| 181 | dbg_err("bad seek %lld", new_offset); | 181 | ubi_err("bad seek %lld", new_offset); |
| 182 | return -EINVAL; | 182 | return -EINVAL; |
| 183 | } | 183 | } |
| 184 | 184 | ||
| @@ -216,11 +216,11 @@ static ssize_t vol_cdev_read(struct file *file, __user char *buf, size_t count, | |||
| 216 | count, *offp, vol->vol_id); | 216 | count, *offp, vol->vol_id); |
| 217 | 217 | ||
| 218 | if (vol->updating) { | 218 | if (vol->updating) { |
| 219 | dbg_err("updating"); | 219 | ubi_err("updating"); |
| 220 | return -EBUSY; | 220 | return -EBUSY; |
| 221 | } | 221 | } |
| 222 | if (vol->upd_marker) { | 222 | if (vol->upd_marker) { |
| 223 | dbg_err("damaged volume, update marker is set"); | 223 | ubi_err("damaged volume, update marker is set"); |
| 224 | return -EBADF; | 224 | return -EBADF; |
| 225 | } | 225 | } |
| 226 | if (*offp == vol->used_bytes || count == 0) | 226 | if (*offp == vol->used_bytes || count == 0) |
| @@ -300,7 +300,7 @@ static ssize_t vol_cdev_direct_write(struct file *file, const char __user *buf, | |||
| 300 | 300 | ||
| 301 | lnum = div_u64_rem(*offp, vol->usable_leb_size, &off); | 301 | lnum = div_u64_rem(*offp, vol->usable_leb_size, &off); |
| 302 | if (off & (ubi->min_io_size - 1)) { | 302 | if (off & (ubi->min_io_size - 1)) { |
| 303 | dbg_err("unaligned position"); | 303 | ubi_err("unaligned position"); |
| 304 | return -EINVAL; | 304 | return -EINVAL; |
| 305 | } | 305 | } |
| 306 | 306 | ||
| @@ -309,7 +309,7 @@ static ssize_t vol_cdev_direct_write(struct file *file, const char __user *buf, | |||
| 309 | 309 | ||
| 310 | /* We can write only in fractions of the minimum I/O unit */ | 310 | /* We can write only in fractions of the minimum I/O unit */ |
| 311 | if (count & (ubi->min_io_size - 1)) { | 311 | if (count & (ubi->min_io_size - 1)) { |
| 312 | dbg_err("unaligned write length"); | 312 | ubi_err("unaligned write length"); |
| 313 | return -EINVAL; | 313 | return -EINVAL; |
| 314 | } | 314 | } |
| 315 | 315 | ||
| @@ -643,7 +643,7 @@ static int verify_mkvol_req(const struct ubi_device *ubi, | |||
| 643 | return 0; | 643 | return 0; |
| 644 | 644 | ||
| 645 | bad: | 645 | bad: |
| 646 | dbg_err("bad volume creation request"); | 646 | ubi_err("bad volume creation request"); |
| 647 | ubi_dump_mkvol_req(req); | 647 | ubi_dump_mkvol_req(req); |
| 648 | return err; | 648 | return err; |
| 649 | } | 649 | } |
| @@ -709,12 +709,12 @@ static int rename_volumes(struct ubi_device *ubi, | |||
| 709 | for (i = 0; i < req->count - 1; i++) { | 709 | for (i = 0; i < req->count - 1; i++) { |
| 710 | for (n = i + 1; n < req->count; n++) { | 710 | for (n = i + 1; n < req->count; n++) { |
| 711 | if (req->ents[i].vol_id == req->ents[n].vol_id) { | 711 | if (req->ents[i].vol_id == req->ents[n].vol_id) { |
| 712 | dbg_err("duplicated volume id %d", | 712 | ubi_err("duplicated volume id %d", |
| 713 | req->ents[i].vol_id); | 713 | req->ents[i].vol_id); |
| 714 | return -EINVAL; | 714 | return -EINVAL; |
| 715 | } | 715 | } |
| 716 | if (!strcmp(req->ents[i].name, req->ents[n].name)) { | 716 | if (!strcmp(req->ents[i].name, req->ents[n].name)) { |
| 717 | dbg_err("duplicated volume name \"%s\"", | 717 | ubi_err("duplicated volume name \"%s\"", |
| 718 | req->ents[i].name); | 718 | req->ents[i].name); |
| 719 | return -EINVAL; | 719 | return -EINVAL; |
| 720 | } | 720 | } |
| @@ -737,7 +737,7 @@ static int rename_volumes(struct ubi_device *ubi, | |||
| 737 | re->desc = ubi_open_volume(ubi->ubi_num, vol_id, UBI_EXCLUSIVE); | 737 | re->desc = ubi_open_volume(ubi->ubi_num, vol_id, UBI_EXCLUSIVE); |
| 738 | if (IS_ERR(re->desc)) { | 738 | if (IS_ERR(re->desc)) { |
| 739 | err = PTR_ERR(re->desc); | 739 | err = PTR_ERR(re->desc); |
| 740 | dbg_err("cannot open volume %d, error %d", vol_id, err); | 740 | ubi_err("cannot open volume %d, error %d", vol_id, err); |
| 741 | kfree(re); | 741 | kfree(re); |
| 742 | goto out_free; | 742 | goto out_free; |
| 743 | } | 743 | } |
| @@ -796,7 +796,7 @@ static int rename_volumes(struct ubi_device *ubi, | |||
| 796 | continue; | 796 | continue; |
| 797 | 797 | ||
| 798 | /* The volume exists but busy, or an error occurred */ | 798 | /* The volume exists but busy, or an error occurred */ |
| 799 | dbg_err("cannot open volume \"%s\", error %d", | 799 | ubi_err("cannot open volume \"%s\", error %d", |
| 800 | re->new_name, err); | 800 | re->new_name, err); |
| 801 | goto out_free; | 801 | goto out_free; |
| 802 | } | 802 | } |
diff --git a/drivers/mtd/ubi/debug.h b/drivers/mtd/ubi/debug.h index 3e5b60f3fdf1..449937431f42 100644 --- a/drivers/mtd/ubi/debug.h +++ b/drivers/mtd/ubi/debug.h | |||
| @@ -35,8 +35,6 @@ void ubi_dump_vid_hdr(const struct ubi_vid_hdr *vid_hdr); | |||
| 35 | } \ | 35 | } \ |
| 36 | } while (0) | 36 | } while (0) |
| 37 | 37 | ||
| 38 | #define dbg_err(fmt, ...) ubi_err(fmt, ##__VA_ARGS__) | ||
| 39 | |||
| 40 | #define ubi_dbg_print_hex_dump(l, ps, pt, r, g, b, len, a) \ | 38 | #define ubi_dbg_print_hex_dump(l, ps, pt, r, g, b, len, a) \ |
| 41 | print_hex_dump(l, ps, pt, r, g, b, len, a) | 39 | print_hex_dump(l, ps, pt, r, g, b, len, a) |
| 42 | 40 | ||
diff --git a/drivers/mtd/ubi/io.c b/drivers/mtd/ubi/io.c index 6843264840ad..8a83962a940b 100644 --- a/drivers/mtd/ubi/io.c +++ b/drivers/mtd/ubi/io.c | |||
| @@ -272,7 +272,7 @@ int ubi_io_write(struct ubi_device *ubi, const void *buf, int pnum, int offset, | |||
| 272 | } | 272 | } |
| 273 | 273 | ||
| 274 | if (ubi_dbg_is_write_failure(ubi)) { | 274 | if (ubi_dbg_is_write_failure(ubi)) { |
| 275 | dbg_err("cannot write %d bytes to PEB %d:%d " | 275 | ubi_err("cannot write %d bytes to PEB %d:%d " |
| 276 | "(emulated)", len, pnum, offset); | 276 | "(emulated)", len, pnum, offset); |
| 277 | dump_stack(); | 277 | dump_stack(); |
| 278 | return -EIO; | 278 | return -EIO; |
| @@ -387,7 +387,7 @@ retry: | |||
| 387 | return err; | 387 | return err; |
| 388 | 388 | ||
| 389 | if (ubi_dbg_is_erase_failure(ubi)) { | 389 | if (ubi_dbg_is_erase_failure(ubi)) { |
| 390 | dbg_err("cannot erase PEB %d (emulated)", pnum); | 390 | ubi_err("cannot erase PEB %d (emulated)", pnum); |
| 391 | return -EIO; | 391 | return -EIO; |
| 392 | } | 392 | } |
| 393 | 393 | ||
| @@ -895,40 +895,40 @@ static int validate_vid_hdr(const struct ubi_device *ubi, | |||
| 895 | int usable_leb_size = ubi->leb_size - data_pad; | 895 | int usable_leb_size = ubi->leb_size - data_pad; |
| 896 | 896 | ||
| 897 | if (copy_flag != 0 && copy_flag != 1) { | 897 | if (copy_flag != 0 && copy_flag != 1) { |
| 898 | dbg_err("bad copy_flag"); | 898 | ubi_err("bad copy_flag"); |
| 899 | goto bad; | 899 | goto bad; |
| 900 | } | 900 | } |
| 901 | 901 | ||
| 902 | if (vol_id < 0 || lnum < 0 || data_size < 0 || used_ebs < 0 || | 902 | if (vol_id < 0 || lnum < 0 || data_size < 0 || used_ebs < 0 || |
| 903 | data_pad < 0) { | 903 | data_pad < 0) { |
| 904 | dbg_err("negative values"); | 904 | ubi_err("negative values"); |
| 905 | goto bad; | 905 | goto bad; |
| 906 | } | 906 | } |
| 907 | 907 | ||
| 908 | if (vol_id >= UBI_MAX_VOLUMES && vol_id < UBI_INTERNAL_VOL_START) { | 908 | if (vol_id >= UBI_MAX_VOLUMES && vol_id < UBI_INTERNAL_VOL_START) { |
| 909 | dbg_err("bad vol_id"); | 909 | ubi_err("bad vol_id"); |
| 910 | goto bad; | 910 | goto bad; |
| 911 | } | 911 | } |
| 912 | 912 | ||
| 913 | if (vol_id < UBI_INTERNAL_VOL_START && compat != 0) { | 913 | if (vol_id < UBI_INTERNAL_VOL_START && compat != 0) { |
| 914 | dbg_err("bad compat"); | 914 | ubi_err("bad compat"); |
| 915 | goto bad; | 915 | goto bad; |
| 916 | } | 916 | } |
| 917 | 917 | ||
| 918 | if (vol_id >= UBI_INTERNAL_VOL_START && compat != UBI_COMPAT_DELETE && | 918 | if (vol_id >= UBI_INTERNAL_VOL_START && compat != UBI_COMPAT_DELETE && |
| 919 | compat != UBI_COMPAT_RO && compat != UBI_COMPAT_PRESERVE && | 919 | compat != UBI_COMPAT_RO && compat != UBI_COMPAT_PRESERVE && |
| 920 | compat != UBI_COMPAT_REJECT) { | 920 | compat != UBI_COMPAT_REJECT) { |
| 921 | dbg_err("bad compat"); | 921 | ubi_err("bad compat"); |
| 922 | goto bad; | 922 | goto bad; |
| 923 | } | 923 | } |
| 924 | 924 | ||
| 925 | if (vol_type != UBI_VID_DYNAMIC && vol_type != UBI_VID_STATIC) { | 925 | if (vol_type != UBI_VID_DYNAMIC && vol_type != UBI_VID_STATIC) { |
| 926 | dbg_err("bad vol_type"); | 926 | ubi_err("bad vol_type"); |
| 927 | goto bad; | 927 | goto bad; |
| 928 | } | 928 | } |
| 929 | 929 | ||
| 930 | if (data_pad >= ubi->leb_size / 2) { | 930 | if (data_pad >= ubi->leb_size / 2) { |
| 931 | dbg_err("bad data_pad"); | 931 | ubi_err("bad data_pad"); |
| 932 | goto bad; | 932 | goto bad; |
| 933 | } | 933 | } |
| 934 | 934 | ||
| @@ -940,45 +940,45 @@ static int validate_vid_hdr(const struct ubi_device *ubi, | |||
| 940 | * mapped logical eraseblocks. | 940 | * mapped logical eraseblocks. |
| 941 | */ | 941 | */ |
| 942 | if (used_ebs == 0) { | 942 | if (used_ebs == 0) { |
| 943 | dbg_err("zero used_ebs"); | 943 | ubi_err("zero used_ebs"); |
| 944 | goto bad; | 944 | goto bad; |
| 945 | } | 945 | } |
| 946 | if (data_size == 0) { | 946 | if (data_size == 0) { |
| 947 | dbg_err("zero data_size"); | 947 | ubi_err("zero data_size"); |
| 948 | goto bad; | 948 | goto bad; |
| 949 | } | 949 | } |
| 950 | if (lnum < used_ebs - 1) { | 950 | if (lnum < used_ebs - 1) { |
| 951 | if (data_size != usable_leb_size) { | 951 | if (data_size != usable_leb_size) { |
| 952 | dbg_err("bad data_size"); | 952 | ubi_err("bad data_size"); |
| 953 | goto bad; | 953 | goto bad; |
| 954 | } | 954 | } |
| 955 | } else if (lnum == used_ebs - 1) { | 955 | } else if (lnum == used_ebs - 1) { |
| 956 | if (data_size == 0) { | 956 | if (data_size == 0) { |
| 957 | dbg_err("bad data_size at last LEB"); | 957 | ubi_err("bad data_size at last LEB"); |
| 958 | goto bad; | 958 | goto bad; |
| 959 | } | 959 | } |
| 960 | } else { | 960 | } else { |
| 961 | dbg_err("too high lnum"); | 961 | ubi_err("too high lnum"); |
| 962 | goto bad; | 962 | goto bad; |
| 963 | } | 963 | } |
| 964 | } else { | 964 | } else { |
| 965 | if (copy_flag == 0) { | 965 | if (copy_flag == 0) { |
| 966 | if (data_crc != 0) { | 966 | if (data_crc != 0) { |
| 967 | dbg_err("non-zero data CRC"); | 967 | ubi_err("non-zero data CRC"); |
| 968 | goto bad; | 968 | goto bad; |
| 969 | } | 969 | } |
| 970 | if (data_size != 0) { | 970 | if (data_size != 0) { |
| 971 | dbg_err("non-zero data_size"); | 971 | ubi_err("non-zero data_size"); |
| 972 | goto bad; | 972 | goto bad; |
| 973 | } | 973 | } |
| 974 | } else { | 974 | } else { |
| 975 | if (data_size == 0) { | 975 | if (data_size == 0) { |
| 976 | dbg_err("zero data_size of copy"); | 976 | ubi_err("zero data_size of copy"); |
| 977 | goto bad; | 977 | goto bad; |
| 978 | } | 978 | } |
| 979 | } | 979 | } |
| 980 | if (used_ebs != 0) { | 980 | if (used_ebs != 0) { |
| 981 | dbg_err("bad used_ebs"); | 981 | ubi_err("bad used_ebs"); |
| 982 | goto bad; | 982 | goto bad; |
| 983 | } | 983 | } |
| 984 | } | 984 | } |
diff --git a/drivers/mtd/ubi/kapi.c b/drivers/mtd/ubi/kapi.c index 33ede23769db..d76fe47477e5 100644 --- a/drivers/mtd/ubi/kapi.c +++ b/drivers/mtd/ubi/kapi.c | |||
| @@ -221,7 +221,7 @@ out_free: | |||
| 221 | kfree(desc); | 221 | kfree(desc); |
| 222 | out_put_ubi: | 222 | out_put_ubi: |
| 223 | ubi_put_device(ubi); | 223 | ubi_put_device(ubi); |
| 224 | dbg_err("cannot open device %d, volume %d, error %d", | 224 | ubi_err("cannot open device %d, volume %d, error %d", |
| 225 | ubi_num, vol_id, err); | 225 | ubi_num, vol_id, err); |
| 226 | return ERR_PTR(err); | 226 | return ERR_PTR(err); |
| 227 | } | 227 | } |
diff --git a/drivers/mtd/ubi/scan.c b/drivers/mtd/ubi/scan.c index 17fc6e556b38..dc7f9dba5cce 100644 --- a/drivers/mtd/ubi/scan.c +++ b/drivers/mtd/ubi/scan.c | |||
| @@ -197,7 +197,7 @@ static int validate_vid_hdr(const struct ubi_vid_hdr *vid_hdr, | |||
| 197 | */ | 197 | */ |
| 198 | 198 | ||
| 199 | if (vol_id != sv->vol_id) { | 199 | if (vol_id != sv->vol_id) { |
| 200 | dbg_err("inconsistent vol_id"); | 200 | ubi_err("inconsistent vol_id"); |
| 201 | goto bad; | 201 | goto bad; |
| 202 | } | 202 | } |
| 203 | 203 | ||
| @@ -207,17 +207,17 @@ static int validate_vid_hdr(const struct ubi_vid_hdr *vid_hdr, | |||
| 207 | sv_vol_type = UBI_VID_DYNAMIC; | 207 | sv_vol_type = UBI_VID_DYNAMIC; |
| 208 | 208 | ||
| 209 | if (vol_type != sv_vol_type) { | 209 | if (vol_type != sv_vol_type) { |
| 210 | dbg_err("inconsistent vol_type"); | 210 | ubi_err("inconsistent vol_type"); |
| 211 | goto bad; | 211 | goto bad; |
| 212 | } | 212 | } |
| 213 | 213 | ||
| 214 | if (used_ebs != sv->used_ebs) { | 214 | if (used_ebs != sv->used_ebs) { |
| 215 | dbg_err("inconsistent used_ebs"); | 215 | ubi_err("inconsistent used_ebs"); |
| 216 | goto bad; | 216 | goto bad; |
| 217 | } | 217 | } |
| 218 | 218 | ||
| 219 | if (data_pad != sv->data_pad) { | 219 | if (data_pad != sv->data_pad) { |
| 220 | dbg_err("inconsistent data_pad"); | 220 | ubi_err("inconsistent data_pad"); |
| 221 | goto bad; | 221 | goto bad; |
| 222 | } | 222 | } |
| 223 | } | 223 | } |
| @@ -369,7 +369,7 @@ static int compare_lebs(struct ubi_device *ubi, const struct ubi_scan_leb *seb, | |||
| 369 | if (err == UBI_IO_BITFLIPS) | 369 | if (err == UBI_IO_BITFLIPS) |
| 370 | bitflips = 1; | 370 | bitflips = 1; |
| 371 | else { | 371 | else { |
| 372 | dbg_err("VID of PEB %d header is bad, but it " | 372 | ubi_err("VID of PEB %d header is bad, but it " |
| 373 | "was OK earlier, err %d", pnum, err); | 373 | "was OK earlier, err %d", pnum, err); |
| 374 | if (err > 0) | 374 | if (err > 0) |
| 375 | err = -EIO; | 375 | err = -EIO; |
diff --git a/drivers/mtd/ubi/vmt.c b/drivers/mtd/ubi/vmt.c index 1bfd4b6ac407..e4b897ab4543 100644 --- a/drivers/mtd/ubi/vmt.c +++ b/drivers/mtd/ubi/vmt.c | |||
| @@ -223,7 +223,7 @@ int ubi_create_volume(struct ubi_device *ubi, struct ubi_mkvol_req *req) | |||
| 223 | } | 223 | } |
| 224 | 224 | ||
| 225 | if (vol_id == UBI_VOL_NUM_AUTO) { | 225 | if (vol_id == UBI_VOL_NUM_AUTO) { |
| 226 | dbg_err("out of volume IDs"); | 226 | ubi_err("out of volume IDs"); |
| 227 | err = -ENFILE; | 227 | err = -ENFILE; |
| 228 | goto out_unlock; | 228 | goto out_unlock; |
| 229 | } | 229 | } |
| @@ -237,7 +237,7 @@ int ubi_create_volume(struct ubi_device *ubi, struct ubi_mkvol_req *req) | |||
| 237 | /* Ensure that this volume does not exist */ | 237 | /* Ensure that this volume does not exist */ |
| 238 | err = -EEXIST; | 238 | err = -EEXIST; |
| 239 | if (ubi->volumes[vol_id]) { | 239 | if (ubi->volumes[vol_id]) { |
| 240 | dbg_err("volume %d already exists", vol_id); | 240 | ubi_err("volume %d already exists", vol_id); |
| 241 | goto out_unlock; | 241 | goto out_unlock; |
| 242 | } | 242 | } |
| 243 | 243 | ||
| @@ -246,7 +246,7 @@ int ubi_create_volume(struct ubi_device *ubi, struct ubi_mkvol_req *req) | |||
| 246 | if (ubi->volumes[i] && | 246 | if (ubi->volumes[i] && |
| 247 | ubi->volumes[i]->name_len == req->name_len && | 247 | ubi->volumes[i]->name_len == req->name_len && |
| 248 | !strcmp(ubi->volumes[i]->name, req->name)) { | 248 | !strcmp(ubi->volumes[i]->name, req->name)) { |
| 249 | dbg_err("volume \"%s\" exists (ID %d)", req->name, i); | 249 | ubi_err("volume \"%s\" exists (ID %d)", req->name, i); |
| 250 | goto out_unlock; | 250 | goto out_unlock; |
| 251 | } | 251 | } |
| 252 | 252 | ||
| @@ -257,9 +257,9 @@ int ubi_create_volume(struct ubi_device *ubi, struct ubi_mkvol_req *req) | |||
| 257 | 257 | ||
| 258 | /* Reserve physical eraseblocks */ | 258 | /* Reserve physical eraseblocks */ |
| 259 | if (vol->reserved_pebs > ubi->avail_pebs) { | 259 | if (vol->reserved_pebs > ubi->avail_pebs) { |
| 260 | dbg_err("not enough PEBs, only %d available", ubi->avail_pebs); | 260 | ubi_err("not enough PEBs, only %d available", ubi->avail_pebs); |
| 261 | if (ubi->corr_peb_count) | 261 | if (ubi->corr_peb_count) |
| 262 | dbg_err("%d PEBs are corrupted and not used", | 262 | ubi_err("%d PEBs are corrupted and not used", |
| 263 | ubi->corr_peb_count); | 263 | ubi->corr_peb_count); |
| 264 | err = -ENOSPC; | 264 | err = -ENOSPC; |
| 265 | goto out_unlock; | 265 | goto out_unlock; |
| @@ -495,7 +495,7 @@ int ubi_resize_volume(struct ubi_volume_desc *desc, int reserved_pebs) | |||
| 495 | 495 | ||
| 496 | if (vol->vol_type == UBI_STATIC_VOLUME && | 496 | if (vol->vol_type == UBI_STATIC_VOLUME && |
| 497 | reserved_pebs < vol->used_ebs) { | 497 | reserved_pebs < vol->used_ebs) { |
| 498 | dbg_err("too small size %d, %d LEBs contain data", | 498 | ubi_err("too small size %d, %d LEBs contain data", |
| 499 | reserved_pebs, vol->used_ebs); | 499 | reserved_pebs, vol->used_ebs); |
| 500 | return -EINVAL; | 500 | return -EINVAL; |
| 501 | } | 501 | } |
| @@ -524,10 +524,10 @@ int ubi_resize_volume(struct ubi_volume_desc *desc, int reserved_pebs) | |||
| 524 | if (pebs > 0) { | 524 | if (pebs > 0) { |
| 525 | spin_lock(&ubi->volumes_lock); | 525 | spin_lock(&ubi->volumes_lock); |
| 526 | if (pebs > ubi->avail_pebs) { | 526 | if (pebs > ubi->avail_pebs) { |
| 527 | dbg_err("not enough PEBs: requested %d, available %d", | 527 | ubi_err("not enough PEBs: requested %d, available %d", |
| 528 | pebs, ubi->avail_pebs); | 528 | pebs, ubi->avail_pebs); |
| 529 | if (ubi->corr_peb_count) | 529 | if (ubi->corr_peb_count) |
| 530 | dbg_err("%d PEBs are corrupted and not used", | 530 | ubi_err("%d PEBs are corrupted and not used", |
| 531 | ubi->corr_peb_count); | 531 | ubi->corr_peb_count); |
| 532 | spin_unlock(&ubi->volumes_lock); | 532 | spin_unlock(&ubi->volumes_lock); |
| 533 | err = -ENOSPC; | 533 | err = -ENOSPC; |
| @@ -762,7 +762,7 @@ static int self_check_volume(struct ubi_device *ubi, int vol_id) | |||
| 762 | } | 762 | } |
| 763 | 763 | ||
| 764 | if (vol->upd_marker && vol->corrupted) { | 764 | if (vol->upd_marker && vol->corrupted) { |
| 765 | dbg_err("update marker and corrupted simultaneously"); | 765 | ubi_err("update marker and corrupted simultaneously"); |
| 766 | goto fail; | 766 | goto fail; |
| 767 | } | 767 | } |
| 768 | 768 | ||
diff --git a/drivers/mtd/ubi/vtbl.c b/drivers/mtd/ubi/vtbl.c index befe6f888d57..f3fbaa9ec7f2 100644 --- a/drivers/mtd/ubi/vtbl.c +++ b/drivers/mtd/ubi/vtbl.c | |||
| @@ -225,7 +225,7 @@ static int vtbl_check(const struct ubi_device *ubi, | |||
| 225 | 225 | ||
| 226 | n = ubi->leb_size % alignment; | 226 | n = ubi->leb_size % alignment; |
| 227 | if (data_pad != n) { | 227 | if (data_pad != n) { |
| 228 | dbg_err("bad data_pad, has to be %d", n); | 228 | ubi_err("bad data_pad, has to be %d", n); |
| 229 | err = 6; | 229 | err = 6; |
| 230 | goto bad; | 230 | goto bad; |
| 231 | } | 231 | } |
| @@ -241,7 +241,7 @@ static int vtbl_check(const struct ubi_device *ubi, | |||
| 241 | } | 241 | } |
| 242 | 242 | ||
| 243 | if (reserved_pebs > ubi->good_peb_count) { | 243 | if (reserved_pebs > ubi->good_peb_count) { |
| 244 | dbg_err("too large reserved_pebs %d, good PEBs %d", | 244 | ubi_err("too large reserved_pebs %d, good PEBs %d", |
| 245 | reserved_pebs, ubi->good_peb_count); | 245 | reserved_pebs, ubi->good_peb_count); |
| 246 | err = 9; | 246 | err = 9; |
| 247 | goto bad; | 247 | goto bad; |
| @@ -815,7 +815,7 @@ int ubi_read_volume_table(struct ubi_device *ubi, struct ubi_scan_info *si) | |||
| 815 | } else { | 815 | } else { |
| 816 | if (sv->leb_count > UBI_LAYOUT_VOLUME_EBS) { | 816 | if (sv->leb_count > UBI_LAYOUT_VOLUME_EBS) { |
| 817 | /* This must not happen with proper UBI images */ | 817 | /* This must not happen with proper UBI images */ |
| 818 | dbg_err("too many LEBs (%d) in layout volume", | 818 | ubi_err("too many LEBs (%d) in layout volume", |
| 819 | sv->leb_count); | 819 | sv->leb_count); |
| 820 | return -EINVAL; | 820 | return -EINVAL; |
| 821 | } | 821 | } |
