0002-cryptodev_verbosity-Fix-build-for-Linux-6-4.patch 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. From 99ae2a39ddc3f89c66d9f09783b591c0f2dbf2e9 Mon Sep 17 00:00:00 2001
  2. From: Gaurav Jain <gaurav.jain@nxp.com>
  3. Date: Wed, 28 Jun 2023 12:44:32 +0530
  4. Subject: [PATCH] cryptodev_verbosity: Fix build for Linux 6.4
  5. register_sysctl_table api is removed in kernel.
  6. migrate to the new api register_sysctl.
  7. child is also removed in linux 6.4 ctl_table struct.
  8. Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
  9. Upstream: https://github.com/cryptodev-linux/cryptodev-linux/commit/99ae2a39ddc3f89c66d9f09783b591c0f2dbf2e9
  10. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  11. ---
  12. ioctl.c | 6 ++++++
  13. 1 file changed, 6 insertions(+)
  14. diff --git a/ioctl.c b/ioctl.c
  15. index 8f241b86..4262bbd5 100644
  16. --- a/ioctl.c
  17. +++ b/ioctl.c
  18. @@ -1246,7 +1246,9 @@ static struct ctl_table verbosity_ctl_root[] = {
  19. {
  20. .procname = "ioctl",
  21. .mode = 0555,
  22. +#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0))
  23. .child = verbosity_ctl_dir,
  24. +#endif
  25. },
  26. {},
  27. };
  28. @@ -1267,7 +1269,11 @@ static int __init init_cryptodev(void)
  29. return rc;
  30. }
  31. +#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0))
  32. verbosity_sysctl_header = register_sysctl_table(verbosity_ctl_root);
  33. +#else
  34. + verbosity_sysctl_header = register_sysctl(verbosity_ctl_root->procname, verbosity_ctl_dir);
  35. +#endif
  36. pr_info(PFX "driver %s loaded.\n", VERSION);