]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: nand: Do not expose the NAND manufacturer table directly
authorBoris Brezillon <boris.brezillon@free-electrons.com>
Sat, 7 Jan 2017 14:48:25 +0000 (15:48 +0100)
committerBoris Brezillon <boris.brezillon@free-electrons.com>
Wed, 8 Mar 2017 22:21:18 +0000 (23:21 +0100)
commit59757ec97cb212f8efe2be8a317aaff5586e3498
treebf65c4f754e0cfc612b300722571e62bb1cda958
parent40a3220743902807c4fe668bb4576fbdc53b70b9
mtd: nand: Do not expose the NAND manufacturer table directly

There is no reason to expose the NAND manufacturer table. Provide an
helper function to find manufacturers by their id.

We also turn the nand_manufacturers table into a const array, since its
members are not modified after the initial assignment.

Finally, we remove the sentinel manufacturer entry from the manufacturers
table (we already have the array size information given by ARRAY_SIZE()),
and add the nand_manufacturer_name() helper to handle the "Unknown" case
properly.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
drivers/mtd/nand/nand_base.c
drivers/mtd/nand/nand_ids.c
include/linux/mtd/nand.h