Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d855d23b authored by Brian Norris's avatar Brian Norris
Browse files

mtd: cmdlinepart: allow small partitions



I'm not sure why we have a PAGE_SIZE restriction on this partition
parser.

If we really wanted the restriction, I would expect it to be a
restriction for *all* parsers, so we'd move it to the MTD core

At any rate, while small partitions may not be useful (they'll often be
smaller than the eraseblock size and therefore can only be used
read-only), they still have use as a read-only partition.

This restriction is especially annoying because it aborts the entire
MTD's cmdline parsing, leaving it unpartitioned.

So, let's kill the restriction and only check for zero-sized partitions,
which I expect we don't want to allow.

Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
parent adf508c3
Loading
Loading
Loading
Loading
+2 −3
Original line number Original line Diff line number Diff line
@@ -115,9 +115,8 @@ static struct mtd_partition * newpart(char *s,
		s++;
		s++;
	} else {
	} else {
		size = memparse(s, &s);
		size = memparse(s, &s);
		if (size < PAGE_SIZE) {
		if (!size) {
			printk(KERN_ERR ERRP "partition size too small (%llx)\n",
			printk(KERN_ERR ERRP "partition has size 0\n");
			       size);
			return ERR_PTR(-EINVAL);
			return ERR_PTR(-EINVAL);
		}
		}
	}
	}