summaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2014-12-08 18:45:00 +0100
committerBrian Norris <computersforpeace@gmail.com>2015-01-07 12:24:19 -0800
commit16bd87b3a352b536ffdd7325e3178c4231f3cbf7 (patch)
treebe9c41817f0f04d25d518096edcc2172f0e3d05c /drivers/mtd
parentbd10c26a4efe23e97ee9878a825c7e7a3e594946 (diff)
downloadlinux-16bd87b3a352b536ffdd7325e3178c4231f3cbf7.tar.gz
linux-16bd87b3a352b536ffdd7325e3178c4231f3cbf7.tar.bz2
linux-16bd87b3a352b536ffdd7325e3178c4231f3cbf7.zip
mtd: bcm47xxpart: lower minimal blocksize to 4Ki (from 64Ki)
Some devices like Netgear WNR1000v3 or WGR614v10 have partitions aligned to 0x1000. Using bigger blocksize stopped us from detecting some parts. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/bcm47xxpart.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/mtd/bcm47xxpart.c b/drivers/mtd/bcm47xxpart.c
index 26a4a4a4e8ab..4ad392892b70 100644
--- a/drivers/mtd/bcm47xxpart.c
+++ b/drivers/mtd/bcm47xxpart.c
@@ -94,8 +94,12 @@ static int bcm47xxpart_parse(struct mtd_info *master,
int last_trx_part = -1;
int possible_nvram_sizes[] = { 0x8000, 0xF000, 0x10000, };
- if (blocksize <= 0x10000)
- blocksize = 0x10000;
+ /*
+ * Some really old flashes (like AT45DB*) had smaller erasesize-s, but
+ * partitions were aligned to at least 0x1000 anyway.
+ */
+ if (blocksize < 0x1000)
+ blocksize = 0x1000;
/* Alloc */
parts = kzalloc(sizeof(struct mtd_partition) * BCM47XXPART_MAX_PARTS,