1076-mtd-spi-nor-drop-unnecessary-partition-parser-data.patch 2.7 KB

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