diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2007-12-16 13:00:38 -0500 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2007-12-26 12:15:15 -0500 |
commit | 89b96b69290668351a33b09372ec1c94cb5748e5 (patch) | |
tree | cdbb79da1c821f2155815119ded20d181c23c7c2 /drivers/mtd/ubi/upd.c | |
parent | 77c722dde9975361051c5530475f8f92ed67a506 (diff) |
UBI: improve internal interfaces
Pass volume description object to the EBA function which makes
more sense, and EBA function do not have to find the volume
description object by volume ID.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd/ubi/upd.c')
-rw-r--r-- | drivers/mtd/ubi/upd.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/mtd/ubi/upd.c b/drivers/mtd/ubi/upd.c index 0efc586a8328..a95dcaa4a0c2 100644 --- a/drivers/mtd/ubi/upd.c +++ b/drivers/mtd/ubi/upd.c | |||
@@ -136,7 +136,7 @@ int ubi_start_update(struct ubi_device *ubi, int vol_id, long long bytes) | |||
136 | 136 | ||
137 | /* Before updating - wipe out the volume */ | 137 | /* Before updating - wipe out the volume */ |
138 | for (i = 0; i < vol->reserved_pebs; i++) { | 138 | for (i = 0; i < vol->reserved_pebs; i++) { |
139 | err = ubi_eba_unmap_leb(ubi, vol_id, i); | 139 | err = ubi_eba_unmap_leb(ubi, vol, i); |
140 | if (err) | 140 | if (err) |
141 | return err; | 141 | return err; |
142 | } | 142 | } |
@@ -209,8 +209,7 @@ static int write_leb(struct ubi_device *ubi, int vol_id, int lnum, void *buf, | |||
209 | if (len != l) | 209 | if (len != l) |
210 | dbg_msg("skip last %d bytes (0xFF)", len - l); | 210 | dbg_msg("skip last %d bytes (0xFF)", len - l); |
211 | 211 | ||
212 | err = ubi_eba_write_leb(ubi, vol_id, lnum, buf, 0, l, | 212 | err = ubi_eba_write_leb(ubi, vol, lnum, buf, 0, l, UBI_UNKNOWN); |
213 | UBI_UNKNOWN); | ||
214 | } else { | 213 | } else { |
215 | /* | 214 | /* |
216 | * When writing static volume, and this is the last logical | 215 | * When writing static volume, and this is the last logical |
@@ -222,7 +221,7 @@ static int write_leb(struct ubi_device *ubi, int vol_id, int lnum, void *buf, | |||
222 | * contain zeros, not random trash. | 221 | * contain zeros, not random trash. |
223 | */ | 222 | */ |
224 | memset(buf + len, 0, vol->usable_leb_size - len); | 223 | memset(buf + len, 0, vol->usable_leb_size - len); |
225 | err = ubi_eba_write_leb_st(ubi, vol_id, lnum, buf, len, | 224 | err = ubi_eba_write_leb_st(ubi, vol, lnum, buf, len, |
226 | UBI_UNKNOWN, used_ebs); | 225 | UBI_UNKNOWN, used_ebs); |
227 | } | 226 | } |
228 | 227 | ||