1 From 9c7d787508be6d68a6ec66de3c3466b24e820c71 Mon Sep 17 00:00:00 2001
2 From: Brian Norris <computersforpeace@gmail.com>
3 Date: Fri, 30 Oct 2015 20:33:24 -0700
4 Subject: [PATCH] mtd: spi-nor: convert to spi_nor_{get, set}_flash_node()
6 Used semantic patch with 'make coccicheck MODE=patch COCCI=script.cocci':
18 +spi_nor_set_flash_node(&b, d)
20 -(c)->flash_node = (d)
21 +spi_nor_set_flash_node(c, d)
25 And a manual conversion for the one use of spi_nor_get_flash_node().
27 Signed-off-by: Brian Norris <computersforpeace@gmail.com>
28 Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
30 drivers/mtd/devices/m25p80.c | 2 +-
31 drivers/mtd/spi-nor/fsl-quadspi.c | 2 +-
32 drivers/mtd/spi-nor/nxp-spifi.c | 2 +-
33 drivers/mtd/spi-nor/spi-nor.c | 2 +-
34 4 files changed, 4 insertions(+), 4 deletions(-)
36 --- a/drivers/mtd/devices/m25p80.c
37 +++ b/drivers/mtd/devices/m25p80.c
38 @@ -221,7 +221,7 @@ static int m25p_probe(struct spi_device
39 nor->read_reg = m25p80_read_reg;
42 - nor->flash_node = spi->dev.of_node;
43 + spi_nor_set_flash_node(nor, spi->dev.of_node);
46 spi_set_drvdata(spi, flash);
47 --- a/drivers/mtd/spi-nor/fsl-quadspi.c
48 +++ b/drivers/mtd/spi-nor/fsl-quadspi.c
49 @@ -1013,7 +1013,7 @@ static int fsl_qspi_probe(struct platfor
53 - nor->flash_node = np;
54 + spi_nor_set_flash_node(nor, np);
58 --- a/drivers/mtd/spi-nor/nxp-spifi.c
59 +++ b/drivers/mtd/spi-nor/nxp-spifi.c
60 @@ -330,7 +330,7 @@ static int nxp_spifi_setup_flash(struct
61 writel(ctrl, spifi->io_base + SPIFI_CTRL);
63 spifi->nor.dev = spifi->dev;
64 - spifi->nor.flash_node = np;
65 + spi_nor_set_flash_node(&spifi->nor, np);
66 spifi->nor.priv = spifi;
67 spifi->nor.read = nxp_spifi_read;
68 spifi->nor.write = nxp_spifi_write;
69 --- a/drivers/mtd/spi-nor/spi-nor.c
70 +++ b/drivers/mtd/spi-nor/spi-nor.c
71 @@ -1112,7 +1112,7 @@ int spi_nor_scan(struct spi_nor *nor, co
72 const struct flash_info *info = NULL;
73 struct device *dev = nor->dev;
74 struct mtd_info *mtd = &nor->mtd;
75 - struct device_node *np = nor->flash_node;
76 + struct device_node *np = spi_nor_get_flash_node(nor);