Skip to content

Commit

Permalink
Fixup for commit 1aaba11da9aa ("driver core: class: remove module * f…
Browse files Browse the repository at this point in the history
…rom class_create()")

Since Linux 6.4-rc1 the first argument to class_Create is removed.

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
  • Loading branch information
hramrach committed Aug 28, 2023
1 parent cd350fb commit 2f92e3f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
6 changes: 5 additions & 1 deletion msr_allowlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,11 @@ int msr_allowlist_init(int *majordev)
}
cdev_registered = 1;

cdev_class = class_create(THIS_MODULE, "msr_allowlist");
cdev_class = class_create(
#if LINUX_VERSION_CODE < KERNEL_VERSION(6,4,0)
THIS_MODULE,
#endif
"msr_allowlist");
if (IS_ERR(cdev_class))
{
err = PTR_ERR(cdev_class);
Expand Down
6 changes: 5 additions & 1 deletion msr_batch.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,11 @@ int msrbatch_init(int *majordev)
}
cdev_registered = 1;

cdev_class = class_create(THIS_MODULE, "msr_batch");
cdev_class = class_create(
#if LINUX_VERSION_CODE < KERNEL_VERSION(6,4,0)
THIS_MODULE,
#endif
"msr_batch");
if (IS_ERR(cdev_class))
{
err = PTR_ERR(cdev_class);
Expand Down
6 changes: 5 additions & 1 deletion msr_entry.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,11 @@ static int __init msr_init(void)
pr_debug("msr_allowlist major dev: %i\n", mdev_msr_allowlist);
pr_debug("msr_version major dev: %i\n", mdev_msr_version);

msr_class = class_create(THIS_MODULE, "msr_safe");
msr_class = class_create(
#if LINUX_VERSION_CODE < KERNEL_VERSION(6,4,0)
THIS_MODULE,
#endif
"msr_safe");
if (IS_ERR(msr_class))
{
err = PTR_ERR(msr_class);
Expand Down
6 changes: 5 additions & 1 deletion msr_version.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,11 @@ int msr_version_init(int *majordev)
}
cdev_registered = 1;

cdev_class = class_create(THIS_MODULE, "msr_safe_version");
cdev_class = class_create(
#if LINUX_VERSION_CODE < KERNEL_VERSION(6,4,0)
THIS_MODULE,
#endif
"msr_safe_version");
if (IS_ERR(cdev_class))
{
err = PTR_ERR(cdev_class);
Expand Down

0 comments on commit 2f92e3f

Please sign in to comment.