0009-mtd-spi-nor-drop-flash_node-field.patch 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. From 1348b9e2300f66a4ffcb5b467f4c99cfb958ffca 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 09/33] mtd: spi-nor: drop flash_node field
  5. We can just alias to the MTD of_node.
  6. Signed-off-by: Brian Norris <computersforpeace@gmail.com>
  7. Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
  8. ---
  9. drivers/mtd/spi-nor/spi-nor.c | 1 -
  10. include/linux/mtd/spi-nor.h | 6 ++----
  11. 2 files changed, 2 insertions(+), 5 deletions(-)
  12. diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c
  13. index b76090e..3e06d5b 100644
  14. --- a/drivers/mtd/spi-nor/spi-nor.c
  15. +++ b/drivers/mtd/spi-nor/spi-nor.c
  16. @@ -1256,7 +1256,6 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, enum read_mode mode)
  17. mtd->flags |= MTD_NO_ERASE;
  18. mtd->dev.parent = dev;
  19. - mtd_set_of_node(mtd, np);
  20. nor->page_size = info->page_size;
  21. mtd->writebufsize = nor->page_size;
  22. diff --git a/include/linux/mtd/spi-nor.h b/include/linux/mtd/spi-nor.h
  23. index 823c5381..592420b 100644
  24. --- a/include/linux/mtd/spi-nor.h
  25. +++ b/include/linux/mtd/spi-nor.h
  26. @@ -123,7 +123,6 @@ enum spi_nor_option_flags {
  27. * @mtd: point to a mtd_info structure
  28. * @lock: the lock for the read/write/erase/lock/unlock operations
  29. * @dev: point to a spi device, or a spi nor controller device.
  30. - * @flash_node: point to a device node describing this flash instance.
  31. * @page_size: the page size of the SPI NOR
  32. * @addr_width: number of address bytes
  33. * @erase_opcode: the opcode for erasing a sector
  34. @@ -154,7 +153,6 @@ struct spi_nor {
  35. struct mtd_info mtd;
  36. struct mutex lock;
  37. struct device *dev;
  38. - struct device_node *flash_node;
  39. u32 page_size;
  40. u8 addr_width;
  41. u8 erase_opcode;
  42. @@ -187,12 +185,12 @@ struct spi_nor {
  43. static inline void spi_nor_set_flash_node(struct spi_nor *nor,
  44. struct device_node *np)
  45. {
  46. - nor->flash_node = np;
  47. + mtd_set_of_node(&nor->mtd, np);
  48. }
  49. static inline struct device_node *spi_nor_get_flash_node(struct spi_nor *nor)
  50. {
  51. - return nor->flash_node;
  52. + return mtd_get_of_node(&nor->mtd);
  53. }
  54. /**
  55. --
  56. 2.8.1