aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/patches-4.4/431-mtd-bcm47xxpart-check-for-bad-blocks-when-calculatin.patch
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2017-01-11 09:53:44 +0100
committerRafał Miłecki <rafal@milecki.pl>2017-01-11 09:54:47 +0100
commit7c8a36340c3a5f0443329731ada1be43489d3050 (patch)
tree6cde5afb583b4b975bcc4820115662f26c30eee8 /target/linux/generic/patches-4.4/431-mtd-bcm47xxpart-check-for-bad-blocks-when-calculatin.patch
parent593240075f8d3074164ffce99ab67a88277f9fb3 (diff)
downloadupstream-7c8a36340c3a5f0443329731ada1be43489d3050.tar.gz
upstream-7c8a36340c3a5f0443329731ada1be43489d3050.tar.bz2
upstream-7c8a36340c3a5f0443329731ada1be43489d3050.zip
kernel: update bcm47xxpart failsafe partition patches
V2 using helper function was sent for upstream kernel Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Diffstat (limited to 'target/linux/generic/patches-4.4/431-mtd-bcm47xxpart-check-for-bad-blocks-when-calculatin.patch')
-rw-r--r--target/linux/generic/patches-4.4/431-mtd-bcm47xxpart-check-for-bad-blocks-when-calculatin.patch45
1 files changed, 30 insertions, 15 deletions
diff --git a/target/linux/generic/patches-4.4/431-mtd-bcm47xxpart-check-for-bad-blocks-when-calculatin.patch b/target/linux/generic/patches-4.4/431-mtd-bcm47xxpart-check-for-bad-blocks-when-calculatin.patch
index b77845120d..379e551b7f 100644
--- a/target/linux/generic/patches-4.4/431-mtd-bcm47xxpart-check-for-bad-blocks-when-calculatin.patch
+++ b/target/linux/generic/patches-4.4/431-mtd-bcm47xxpart-check-for-bad-blocks-when-calculatin.patch
@@ -48,29 +48,44 @@ Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
static const char *bcm47xxpart_trx_data_part_name(struct mtd_info *master,
size_t offset)
{
-@@ -113,19 +141,22 @@ static int bcm47xxpart_parse_trx(struct
+@@ -91,6 +119,7 @@ static int bcm47xxpart_parse_trx(struct
+ {
+ struct trx_header header;
+ size_t bytes_read;
++ size_t offset;
+ int curr_part = 0;
+ int i, err;
+
+@@ -110,21 +139,25 @@ static int bcm47xxpart_parse_trx(struct
+
+ /* We have LZMA loader if offset[2] points to sth */
if (header.offset[2]) {
- part = &parts[curr_part++];
- part->name = "loader";
-- part->offset = trx->offset + header.offset[i];
-+ part->offset = bcm47xxpart_real_offset(master, trx->offset,
-+ header.offset[i]);
+- bcm47xxpart_add_part(&parts[curr_part++], "loader",
+- trx->offset + header.offset[i], 0);
++ offset = bcm47xxpart_real_offset(master, trx->offset,
++ header.offset[i]);
++ bcm47xxpart_add_part(&parts[curr_part++], "loader", offset, 0);
i++;
}
if (header.offset[i]) {
- part = &parts[curr_part++];
- part->name = "linux";
-- part->offset = trx->offset + header.offset[i];
-+ part->offset = bcm47xxpart_real_offset(master, trx->offset,
-+ header.offset[i]);
+- bcm47xxpart_add_part(&parts[curr_part++], "linux",
+- trx->offset + header.offset[i], 0);
++ offset = bcm47xxpart_real_offset(master, trx->offset,
++ header.offset[i]);
++ bcm47xxpart_add_part(&parts[curr_part++], "linux", offset, 0);
i++;
}
if (header.offset[i]) {
- size_t offset = trx->offset + header.offset[i];
-+ size_t offset = bcm47xxpart_real_offset(master, trx->offset,
-+ header.offset[i]);
+- const char *name = bcm47xxpart_trx_data_part_name(master,
+- offset);
++ const char *name;
++
++ offset = bcm47xxpart_real_offset(master, trx->offset,
++ header.offset[i]);
++ name = bcm47xxpart_trx_data_part_name(master, offset);
- part = &parts[curr_part++];
- part->name = bcm47xxpart_trx_data_part_name(master, offset);
+ bcm47xxpart_add_part(&parts[curr_part++], name, offset, 0);
+ i++;