834-v6.8-0009-nvmem-drop-nvmem_layout_get_match_data.patch 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. From 43f60e3fb62edc7bd8891de8779fb422f4ae23ae Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <[email protected]>
  3. Date: Tue, 19 Dec 2023 13:01:04 +0100
  4. Subject: [PATCH] nvmem: drop nvmem_layout_get_match_data()
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. Thanks for layouts refactoring we now have "struct device" associated
  9. with layout. Also its OF pointer points directly to the "nvmem-layout"
  10. DT node.
  11. All it takes to get match data is a generic of_device_get_match_data().
  12. Signed-off-by: Rafał Miłecki <[email protected]>
  13. Reviewed-by: Miquel Raynal <[email protected]>
  14. Reviewed-by: Michael Walle <[email protected]>
  15. Link: https://lore.kernel.org/r/[email protected]
  16. Signed-off-by: Greg Kroah-Hartman <[email protected]>
  17. ---
  18. drivers/nvmem/core.c | 13 -------------
  19. include/linux/nvmem-provider.h | 10 ----------
  20. 2 files changed, 23 deletions(-)
  21. --- a/drivers/nvmem/core.c
  22. +++ b/drivers/nvmem/core.c
  23. @@ -877,19 +877,6 @@ void nvmem_layout_unregister(struct nvme
  24. }
  25. EXPORT_SYMBOL_GPL(nvmem_layout_unregister);
  26. -const void *nvmem_layout_get_match_data(struct nvmem_device *nvmem,
  27. - struct nvmem_layout *layout)
  28. -{
  29. - struct device_node __maybe_unused *layout_np;
  30. - const struct of_device_id *match;
  31. -
  32. - layout_np = of_nvmem_layout_get_container(nvmem);
  33. - match = of_match_node(layout->dev.driver->of_match_table, layout_np);
  34. -
  35. - return match ? match->data : NULL;
  36. -}
  37. -EXPORT_SYMBOL_GPL(nvmem_layout_get_match_data);
  38. -
  39. /**
  40. * nvmem_register() - Register a nvmem device for given nvmem_config.
  41. * Also creates a binary entry in /sys/bus/nvmem/devices/dev-name/nvmem
  42. --- a/include/linux/nvmem-provider.h
  43. +++ b/include/linux/nvmem-provider.h
  44. @@ -205,9 +205,6 @@ void nvmem_layout_driver_unregister(stru
  45. module_driver(__nvmem_layout_driver, nvmem_layout_driver_register, \
  46. nvmem_layout_driver_unregister)
  47. -const void *nvmem_layout_get_match_data(struct nvmem_device *nvmem,
  48. - struct nvmem_layout *layout);
  49. -
  50. #else
  51. static inline struct nvmem_device *nvmem_register(const struct nvmem_config *c)
  52. @@ -238,13 +235,6 @@ static inline int nvmem_layout_register(
  53. static inline void nvmem_layout_unregister(struct nvmem_layout *layout) {}
  54. -static inline const void *
  55. -nvmem_layout_get_match_data(struct nvmem_device *nvmem,
  56. - struct nvmem_layout *layout)
  57. -{
  58. - return NULL;
  59. -}
  60. -
  61. #endif /* CONFIG_NVMEM */
  62. #if IS_ENABLED(CONFIG_NVMEM) && IS_ENABLED(CONFIG_OF)