1078-mtd-spi-nor-drop-flash_node-field.patch 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. 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. --- a/drivers/mtd/spi-nor/spi-nor.c
  13. +++ b/drivers/mtd/spi-nor/spi-nor.c
  14. @@ -1234,7 +1234,6 @@ int spi_nor_scan(struct spi_nor *nor, co
  15. mtd->flags |= MTD_NO_ERASE;
  16. mtd->dev.parent = dev;
  17. - mtd_set_of_node(mtd, np);
  18. nor->page_size = info->page_size;
  19. mtd->writebufsize = nor->page_size;
  20. --- a/include/linux/mtd/spi-nor.h
  21. +++ b/include/linux/mtd/spi-nor.h
  22. @@ -123,7 +123,6 @@ enum spi_nor_option_flags {
  23. * @mtd: point to a mtd_info structure
  24. * @lock: the lock for the read/write/erase/lock/unlock operations
  25. * @dev: point to a spi device, or a spi nor controller device.
  26. - * @flash_node: point to a device node describing this flash instance.
  27. * @page_size: the page size of the SPI NOR
  28. * @addr_width: number of address bytes
  29. * @erase_opcode: the opcode for erasing a sector
  30. @@ -154,7 +153,6 @@ struct spi_nor {
  31. struct mtd_info mtd;
  32. struct mutex lock;
  33. struct device *dev;
  34. - struct device_node *flash_node;
  35. u32 page_size;
  36. u8 addr_width;
  37. u8 erase_opcode;
  38. @@ -187,12 +185,12 @@ struct spi_nor {
  39. static inline void spi_nor_set_flash_node(struct spi_nor *nor,
  40. struct device_node *np)
  41. {
  42. - nor->flash_node = np;
  43. + mtd_set_of_node(&nor->mtd, np);
  44. }
  45. static inline struct device_node *spi_nor_get_flash_node(struct spi_nor *nor)
  46. {
  47. - return nor->flash_node;
  48. + return mtd_get_of_node(&nor->mtd);
  49. }
  50. /**