kernel: update kernel 4.4 to version 4.4.30
[openwrt/openwrt.git] / target / linux / layerscape / patches-4.4 / 1078-mtd-spi-nor-drop-flash_node-field.patch
1 From df36b4601bc9f84684249a26eb39b818d6785fb8 Mon Sep 17 00:00:00 2001
2 From: Brian Norris <computersforpeace@gmail.com>
3 Date: Fri, 30 Oct 2015 20:33:27 -0700
4 Subject: [PATCH 078/113] mtd: spi-nor: drop flash_node field
5
6 We can just alias to the MTD of_node.
7
8 Signed-off-by: Brian Norris <computersforpeace@gmail.com>
9 Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
10 ---
11 drivers/mtd/spi-nor/spi-nor.c | 1 -
12 include/linux/mtd/spi-nor.h | 6 ++----
13 2 files changed, 2 insertions(+), 5 deletions(-)
14
15 --- a/drivers/mtd/spi-nor/spi-nor.c
16 +++ b/drivers/mtd/spi-nor/spi-nor.c
17 @@ -1218,7 +1218,6 @@ int spi_nor_scan(struct spi_nor *nor, co
18 mtd->flags |= MTD_NO_ERASE;
19
20 mtd->dev.parent = dev;
21 - mtd_set_of_node(mtd, np);
22 nor->page_size = info->page_size;
23 mtd->writebufsize = nor->page_size;
24
25 --- a/include/linux/mtd/spi-nor.h
26 +++ b/include/linux/mtd/spi-nor.h
27 @@ -123,7 +123,6 @@ enum spi_nor_option_flags {
28 * @mtd: point to a mtd_info structure
29 * @lock: the lock for the read/write/erase/lock/unlock operations
30 * @dev: point to a spi device, or a spi nor controller device.
31 - * @flash_node: point to a device node describing this flash instance.
32 * @page_size: the page size of the SPI NOR
33 * @addr_width: number of address bytes
34 * @erase_opcode: the opcode for erasing a sector
35 @@ -154,7 +153,6 @@ struct spi_nor {
36 struct mtd_info mtd;
37 struct mutex lock;
38 struct device *dev;
39 - struct device_node *flash_node;
40 u32 page_size;
41 u8 addr_width;
42 u8 erase_opcode;
43 @@ -187,12 +185,12 @@ struct spi_nor {
44 static inline void spi_nor_set_flash_node(struct spi_nor *nor,
45 struct device_node *np)
46 {
47 - nor->flash_node = np;
48 + mtd_set_of_node(&nor->mtd, np);
49 }
50
51 static inline struct device_node *spi_nor_get_flash_node(struct spi_nor *nor)
52 {
53 - return nor->flash_node;
54 + return mtd_get_of_node(&nor->mtd);
55 }
56
57 /**