a370317331bb6edc113a08a7df8eb19fad7a1b15
[openwrt/svn-archive/archive.git] / target / linux / mediatek / patches-4.4 / 0055-mtd-nand-embed-an-mtd_info-structure-into-nand_chip.patch
1 From b4a93bff70545d73337e2cae7209fd1ae4d9d8e8 Mon Sep 17 00:00:00 2001
2 From: Boris BREZILLON <boris.brezillon@free-electrons.com>
3 Date: Tue, 1 Dec 2015 12:03:06 +0100
4 Subject: [PATCH 55/81] mtd: nand: embed an mtd_info structure into nand_chip
5
6 Currently all NAND controller drivers are providing both the mtd_info and
7 nand_chip struct and then let the NAND subsystem to initialize a few
8 things before registering the mtd instance to the MTD layer.
9 Embed an mtd_info field into nand_chip to add some consistency to all NAND
10 controller drivers.
11 This change will also help factorizing boilerplate code copied in all NAND
12 drivers.
13
14 Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
15 Signed-off-by: Brian Norris <computersforpeace@gmail.com>
16 ---
17 include/linux/mtd/nand.h | 2 ++
18 1 file changed, 2 insertions(+)
19
20 --- a/include/linux/mtd/nand.h
21 +++ b/include/linux/mtd/nand.h
22 @@ -540,6 +540,7 @@ struct nand_buffers {
23
24 /**
25 * struct nand_chip - NAND Private Flash Chip Data
26 + * @mtd: MTD device registered to the MTD framework
27 * @IO_ADDR_R: [BOARDSPECIFIC] address to read the 8 I/O lines of the
28 * flash device
29 * @IO_ADDR_W: [BOARDSPECIFIC] address to write the 8 I/O lines of the
30 @@ -640,6 +641,7 @@ struct nand_buffers {
31 */
32
33 struct nand_chip {
34 + struct mtd_info mtd;
35 void __iomem *IO_ADDR_R;
36 void __iomem *IO_ADDR_W;
37