X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/9880f57d269379f5d83ed081a758d0be6448cd81..d8e7de2bd3c41ce9f7c9bc0ff7767236f1d8a905:/target/linux/magicbox-2.6/patches/002-flash_map.patch?ds=sidebyside diff --git a/target/linux/magicbox-2.6/patches/002-flash_map.patch b/target/linux/magicbox-2.6/patches/002-flash_map.patch index fcddb348c..5d29a047d 100644 --- a/target/linux/magicbox-2.6/patches/002-flash_map.patch +++ b/target/linux/magicbox-2.6/patches/002-flash_map.patch @@ -43,7 +43,7 @@ diff -urN linux.old/drivers/mtd/maps/magicmap.c linux.dev/drivers/mtd/maps/magic +#include +#include +#include -+#include ++#include +#include + +static struct mtd_info *flash; @@ -91,11 +91,11 @@ diff -urN linux.old/drivers/mtd/maps/magicmap.c linux.dev/drivers/mtd/maps/magic + flash = do_map_probe("cfi_probe", &magic_map); + if (flash) { + flash->owner = THIS_MODULE; -+ if (MTD_READ(flash, 12, sizeof(u32), &len, (char *) &size) || ++ if (flash->read(flash, 12, sizeof(u32), &len, (char *) &size) || + len != 4) + return -ENXIO; + size += 0x40; /* header size of the uImage */ -+ if ((size > 0) && (size < 0x400000)) { ++ if (size < 0x400000) { + /* skip to next erase block */ + if (size & (flash->erasesize - 1)) { + size |= (flash->erasesize - 1);