0001-Fix-build-on-Linux-6.4.patch 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. From 32ec7f7b4eb1466100d59aaea8855d770af54327 Mon Sep 17 00:00:00 2001
  2. From: Bernd Kuhls <bernd@kuhls.net>
  3. Date: Sat, 8 Jul 2023 13:10:24 +0200
  4. Subject: [PATCH] Fix build on Linux 6.4
  5. Needed after upstream changes in kernel 6.4:
  6. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/diff/include/linux/device/class.h?id=1aaba11da9aa
  7. Upstream: https://github.com/nicupavel/emlog/pull/15
  8. Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
  9. ---
  10. emlog.c | 4 ++++
  11. 1 file changed, 4 insertions(+)
  12. diff --git a/emlog.c b/emlog.c
  13. index 4462466..2ead738 100644
  14. --- a/emlog.c
  15. +++ b/emlog.c
  16. @@ -500,7 +500,11 @@ static int __init emlog_init(void)
  17. pr_info("version %s running, major is %u, MINOR is %u, max size %d K.\n", EMLOG_VERSION, (unsigned)MAJOR(emlog_dev_type), (unsigned)MINOR(emlog_dev_type), emlog_max_size);
  18. +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)
  19. emlog_class = class_create(THIS_MODULE, DEVICE_NAME);
  20. +#else
  21. + emlog_class = class_create(DEVICE_NAME);
  22. +#endif
  23. if (emlog_class == NULL) {
  24. pr_err("Can not class_create.\n");
  25. ret_val = -4; goto emlog_init_error;
  26. --
  27. 2.39.2