0007-Support-Linux-6.4.patch 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. From 94fc4594659494b8c5cbdf1a719aea4d66d3398d Mon Sep 17 00:00:00 2001
  2. From: Giulio Benetti <giulio.benetti@benettiengineering.com>
  3. Date: Wed, 27 Sep 2023 11:20:50 +0200
  4. Subject: [PATCH] Support Linux 6.4
  5. With Linux 6.4 commit:
  6. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=1aaba11da9aa7d7d6b52a74d45b31cac118295a1
  7. class_create() doesn't require first argument THIS_MODULE anymore so let's
  8. drop first argument if Linux version >= 6.4
  9. Upstream: https://github.com/embeddedTS/wilc3000-external-module/pull/5
  10. Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
  11. ---
  12. bt.c | 4 ++++
  13. 1 file changed, 4 insertions(+)
  14. diff --git a/bt.c b/bt.c
  15. index 48a5302..a752457 100644
  16. --- a/bt.c
  17. +++ b/bt.c
  18. @@ -135,7 +135,11 @@ static void wilc_bt_create_device(void)
  19. ret = alloc_chrdev_region(&chc_dev_no, 0, 1, "atmel");
  20. if (ret < 0)
  21. return;
  22. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0)
  23. + chc_dev_class = class_create("atmel");
  24. +#else
  25. chc_dev_class = class_create(THIS_MODULE, "atmel");
  26. +#endif
  27. if (IS_ERR(chc_dev_class)) {
  28. unregister_chrdev_region(chc_dev_no, 1);
  29. return;
  30. --
  31. 2.34.1