scst: Port to Linux kernel v6.4

Support for the following driver core changes in the Linux kernel v6.4:
- 1aaba11da9aa ("driver core: class: remove module * from class_create()")
- 2243acd50ac4 ("driver core: class: remove struct class_interface * from callbacks")
This commit is contained in:
Gleb Chesnokov
2023-04-28 13:46:48 +03:00
parent cf94272cea
commit faac0a1964
4 changed files with 20 additions and 1 deletions

View File

@@ -1000,7 +1000,11 @@ int __init isert_init_login_devs(unsigned int ndevs)
goto fail; /* Make this more graceful */
}
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)
isert_class = class_create(THIS_MODULE, "isert_scst");
#else
isert_class = class_create("isert_scst");
#endif
isert_setup_listener_cdev(&isert_listen_dev);

View File

@@ -4154,8 +4154,11 @@ static int __init init_scst_user(void)
if (res < 0)
goto out_cache;
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)
dev_user_sysfs_class = class_create(THIS_MODULE, DEV_USER_NAME);
#else
dev_user_sysfs_class = class_create(DEV_USER_NAME);
#endif
if (IS_ERR(dev_user_sysfs_class)) {
PRINT_ERROR("%s", "Unable create sysfs class for SCST user "
"space handler");

View File

@@ -1118,7 +1118,11 @@ int scst_event_init(void)
goto out;
}
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)
scst_event_sysfs_class = class_create(THIS_MODULE, SCST_EVENT_NAME);
#else
scst_event_sysfs_class = class_create(SCST_EVENT_NAME);
#endif
if (IS_ERR(scst_event_sysfs_class)) {
PRINT_ERROR("Unable create sysfs class for SCST event");
res = PTR_ERR(scst_event_sysfs_class);

View File

@@ -2139,7 +2139,11 @@ unsigned int scst_get_setup_id(void)
}
EXPORT_SYMBOL_GPL(scst_get_setup_id);
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)
static int scst_add(struct device *cdev, struct class_interface *intf)
#else
static int scst_add(struct device *cdev)
#endif
{
struct scsi_device *scsidp;
int res = 0;
@@ -2156,7 +2160,11 @@ static int scst_add(struct device *cdev, struct class_interface *intf)
return res;
}
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)
static void scst_remove(struct device *cdev, struct class_interface *intf)
#else
static void scst_remove(struct device *cdev)
#endif
{
struct scsi_device *scsidp;