dafde1660dddff13d0e5ee3dedede17b4b20d8ef
[openwrt/staging/jogo.git] /
1 From df02c885f8697546da41665f28dde5e30ce99674 Mon Sep 17 00:00:00 2001
2 From: Brian Norris <computersforpeace@gmail.com>
3 Date: Fri, 30 Oct 2015 20:33:26 -0700
4 Subject: [PATCH] mtd: spi-nor: drop unnecessary partition parser data
5
6 Now that the SPI-NOR/MTD framework pass the 'flash_node' through to the
7 partition parsing code, we don't have to do it ourselves.
8
9 Also convert to mtd_device_register(), since we don't need the 2nd and
10 3rd parameters anymore.
11
12 Signed-off-by: Brian Norris <computersforpeace@gmail.com>
13 Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
14 ---
15 drivers/mtd/devices/m25p80.c | 8 ++------
16 drivers/mtd/spi-nor/fsl-quadspi.c | 4 +---
17 drivers/mtd/spi-nor/nxp-spifi.c | 4 +---
18 3 files changed, 4 insertions(+), 12 deletions(-)
19
20 --- a/drivers/mtd/devices/m25p80.c
21 +++ b/drivers/mtd/devices/m25p80.c
22 @@ -197,7 +197,6 @@ static int m25p80_erase(struct spi_nor *
23 */
24 static int m25p_probe(struct spi_device *spi)
25 {
26 - struct mtd_part_parser_data ppdata;
27 struct flash_platform_data *data;
28 struct m25p *flash;
29 struct spi_nor *nor;
30 @@ -249,11 +248,8 @@ static int m25p_probe(struct spi_device
31 if (ret)
32 return ret;
33
34 - ppdata.of_node = spi->dev.of_node;
35 -
36 - return mtd_device_parse_register(&nor->mtd, NULL, &ppdata,
37 - data ? data->parts : NULL,
38 - data ? data->nr_parts : 0);
39 + return mtd_device_register(&nor->mtd, data ? data->parts : NULL,
40 + data ? data->nr_parts : 0);
41 }
42
43
44 --- a/drivers/mtd/spi-nor/fsl-quadspi.c
45 +++ b/drivers/mtd/spi-nor/fsl-quadspi.c
46 @@ -927,7 +927,6 @@ static void fsl_qspi_unprep(struct spi_n
47 static int fsl_qspi_probe(struct platform_device *pdev)
48 {
49 struct device_node *np = pdev->dev.of_node;
50 - struct mtd_part_parser_data ppdata;
51 struct device *dev = &pdev->dev;
52 struct fsl_qspi *q;
53 struct resource *res;
54 @@ -1038,8 +1037,7 @@ static int fsl_qspi_probe(struct platfor
55 if (ret)
56 goto mutex_failed;
57
58 - ppdata.of_node = np;
59 - ret = mtd_device_parse_register(mtd, NULL, &ppdata, NULL, 0);
60 + ret = mtd_device_register(mtd, NULL, 0);
61 if (ret)
62 goto mutex_failed;
63
64 --- a/drivers/mtd/spi-nor/nxp-spifi.c
65 +++ b/drivers/mtd/spi-nor/nxp-spifi.c
66 @@ -271,7 +271,6 @@ static void nxp_spifi_dummy_id_read(stru
67 static int nxp_spifi_setup_flash(struct nxp_spifi *spifi,
68 struct device_node *np)
69 {
70 - struct mtd_part_parser_data ppdata;
71 enum read_mode flash_read;
72 u32 ctrl, property;
73 u16 mode = 0;
74 @@ -361,8 +360,7 @@ static int nxp_spifi_setup_flash(struct
75 return ret;
76 }
77
78 - ppdata.of_node = np;
79 - ret = mtd_device_parse_register(&spifi->nor.mtd, NULL, &ppdata, NULL, 0);
80 + ret = mtd_device_register(&spifi->nor.mtd, NULL, 0);
81 if (ret) {
82 dev_err(spifi->dev, "mtd device parse failed\n");
83 return ret;