Skip to content

Commit

Permalink
FRED: Fix class_create compatibility issue
Browse files Browse the repository at this point in the history
Signed-off-by: Shan Kang <[email protected]>
  • Loading branch information
kangshan1157 authored and ysun committed Sep 4, 2024
1 parent 4f2d369 commit 35d33e6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions BM/fred/fred_test_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,11 @@ static int __init fred_test_driver_init(void)
}
/* Creating struct class */

#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)
// For kernel versions 2.6.26 and later
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0)
// For kernel versions lower than 6.3-rc1
dev_class = class_create(THIS_MODULE, "fred_test_class");
#else
// For older kernel versions
// For kernel versions 6.3-rc1 and above
dev_class = class_create("fred_test_class");
#endif

Expand Down

0 comments on commit 35d33e6

Please sign in to comment.