diff --git a/drivers/gpu/host1x-fence/dev.c b/drivers/gpu/host1x-fence/dev.c index 68b8367a..fc807cea 100644 --- a/drivers/gpu/host1x-fence/dev.c +++ b/drivers/gpu/host1x-fence/dev.c @@ -434,7 +434,11 @@ static int host1x_uapi_init(struct host1x_uapi *uapi) if (err) return err; +#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)) uapi->class = class_create(THIS_MODULE, "host1x-fence"); +#else + uapi->class = class_create("host1x-fence"); +#endif if (IS_ERR(uapi->class)) { err = PTR_ERR(uapi->class); goto unregister_chrdev_region; diff --git a/drivers/gpu/host1x-nvhost/nvhost.c b/drivers/gpu/host1x-nvhost/nvhost.c index 15353beb..f6a3f98e 100644 --- a/drivers/gpu/host1x-nvhost/nvhost.c +++ b/drivers/gpu/host1x-nvhost/nvhost.c @@ -111,7 +111,11 @@ static struct device *nvhost_client_device_create(struct platform_device *pdev, struct device *dev; int err; +#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)) pdata->nvhost_class = class_create(THIS_MODULE, pdev->dev.of_node->name); +#else + pdata->nvhost_class = class_create(pdev->dev.of_node->name); +#endif if (IS_ERR(pdata->nvhost_class)) { dev_err(&pdev->dev, "failed to create class\n"); return ERR_CAST(pdata->nvhost_class); diff --git a/drivers/media/platform/tegra/cam_fsync/cam_fsync.c b/drivers/media/platform/tegra/cam_fsync/cam_fsync.c index 7f6fa4cd..33610bfd 100644 --- a/drivers/media/platform/tegra/cam_fsync/cam_fsync.c +++ b/drivers/media/platform/tegra/cam_fsync/cam_fsync.c @@ -22,6 +22,7 @@ #include #include #include +#include #include @@ -910,7 +911,11 @@ static int cam_fsync_find_and_add_groups(struct cam_fsync_controller *controller */ static int cam_fsync_chrdev_init(struct cam_fsync_controller *controller) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0) controller->cam_fsync_class = class_create(THIS_MODULE, CAM_FSYNC_CLASS_NAME); +#else + controller->cam_fsync_class = class_create(CAM_FSYNC_CLASS_NAME); +#endif if (IS_ERR(controller->cam_fsync_class)) return PTR_ERR(controller->cam_fsync_class); diff --git a/drivers/media/platform/tegra/camera/fusa-capture/capture-isp-channel.c b/drivers/media/platform/tegra/camera/fusa-capture/capture-isp-channel.c index 4a6b24f4..0378af5a 100644 --- a/drivers/media/platform/tegra/camera/fusa-capture/capture-isp-channel.c +++ b/drivers/media/platform/tegra/camera/fusa-capture/capture-isp-channel.c @@ -601,7 +601,11 @@ EXPORT_SYMBOL(isp_channel_drv_unregister); */ int isp_channel_drv_init(void) { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0) + isp_channel_class = class_create("capture-isp-channel"); +#else isp_channel_class = class_create(THIS_MODULE, "capture-isp-channel"); +#endif if (IS_ERR(isp_channel_class)) return PTR_ERR(isp_channel_class); @@ -624,4 +628,4 @@ void isp_channel_drv_exit(void) unregister_chrdev(isp_channel_major, "capture-isp-channel"); class_destroy(isp_channel_class); } -EXPORT_SYMBOL(isp_channel_drv_exit); \ No newline at end of file +EXPORT_SYMBOL(isp_channel_drv_exit); diff --git a/drivers/media/platform/tegra/camera/fusa-capture/capture-vi-channel.c b/drivers/media/platform/tegra/camera/fusa-capture/capture-vi-channel.c index 6b91d390..f2756c12 100644 --- a/drivers/media/platform/tegra/camera/fusa-capture/capture-vi-channel.c +++ b/drivers/media/platform/tegra/camera/fusa-capture/capture-vi-channel.c @@ -743,7 +743,11 @@ EXPORT_SYMBOL(vi_channel_drv_unregister); */ int vi_channel_drv_init(void) { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0) + vi_channel_class = class_create("capture-vi-channel"); +#else vi_channel_class = class_create(THIS_MODULE, "capture-vi-channel"); +#endif if (IS_ERR(vi_channel_class)) return PTR_ERR(vi_channel_class); diff --git a/drivers/media/platform/tegra/cdi/cam_cdi_tsc.c b/drivers/media/platform/tegra/cdi/cam_cdi_tsc.c index f18801b4..f74410e1 100644 --- a/drivers/media/platform/tegra/cdi/cam_cdi_tsc.c +++ b/drivers/media/platform/tegra/cdi/cam_cdi_tsc.c @@ -22,6 +22,7 @@ #include #include #include +#include #define DEVICE_NAME "cdi_tsc" #define CLASS_NAME "cdi_tsc_class" @@ -554,7 +555,11 @@ static int cdi_tsc_probe(struct platform_device *pdev) return majorNumber; } /*Create a class for the device*/ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0) + tsc_charClass = class_create(CLASS_NAME); +#else tsc_charClass = class_create(THIS_MODULE, CLASS_NAME); +#endif if (IS_ERR(tsc_charClass)) { unregister_chrdev(majorNumber, DEVICE_NAME); dev_err(controller->dev, "Failed to create the device class\n"); diff --git a/drivers/misc/nvsciipc/nvsciipc.c b/drivers/misc/nvsciipc/nvsciipc.c index 8ed8fe4f..02cb2595 100644 --- a/drivers/misc/nvsciipc/nvsciipc.c +++ b/drivers/misc/nvsciipc/nvsciipc.c @@ -20,6 +20,7 @@ #include #include #include +#include #ifdef CONFIG_TEGRA_VIRTUALIZATION #include @@ -695,7 +696,11 @@ static int nvsciipc_probe(struct platform_device *pdev) ctx->dev = &(pdev->dev); platform_set_drvdata(pdev, ctx); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0) + ctx->nvsciipc_class = class_create(MODULE_NAME); +#else ctx->nvsciipc_class = class_create(THIS_MODULE, MODULE_NAME); +#endif if (IS_ERR(ctx->nvsciipc_class)) { ERR("failed to create class: %ld\n", PTR_ERR(ctx->nvsciipc_class)); diff --git a/drivers/nv-virtio/nv-virtio-console-poc.c b/drivers/nv-virtio/nv-virtio-console-poc.c index ca2e9634..b32e8856 100644 --- a/drivers/nv-virtio/nv-virtio-console-poc.c +++ b/drivers/nv-virtio/nv-virtio-console-poc.c @@ -737,7 +737,11 @@ static int nvvc_register_dev(nvvc_dev_t *nvvcdev) goto err; } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0) + nvvcdev->class = class_create("nvvc"); +#else nvvcdev->class = class_create(THIS_MODULE, "nvvc"); +#endif if (IS_ERR(nvvcdev->class)) { pr_err("class_create failed\n"); err = PTR_ERR(nvvcdev->class); diff --git a/drivers/nvpps/nvpps_main.c b/drivers/nvpps/nvpps_main.c index 51d96d49..61a9e5be 100644 --- a/drivers/nvpps/nvpps_main.c +++ b/drivers/nvpps/nvpps_main.c @@ -1030,7 +1030,11 @@ static int nvpps_probe(struct platform_device *pdev) /* character device setup */ #ifndef NVPPS_NO_DT +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0) + s_nvpps_class = class_create("nvpps"); +#else s_nvpps_class = class_create(THIS_MODULE, "nvpps"); +#endif if (IS_ERR(s_nvpps_class)) { dev_err(&pdev->dev, "failed to allocate class\n"); return PTR_ERR(s_nvpps_class); @@ -1241,7 +1245,11 @@ static int __init nvpps_init(void) printk("%s\n", __FUNCTION__); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0) + s_nvpps_class = class_create("nvpps"); +#else s_nvpps_class = class_create(THIS_MODULE, "nvpps"); +#endif if (IS_ERR(s_nvpps_class)) { printk("nvpps: failed to allocate class\n"); return PTR_ERR(s_nvpps_class); diff --git a/drivers/platform/tegra/rtcpu/camchar.c b/drivers/platform/tegra/rtcpu/camchar.c index 2944b18f..c3ec64d0 100644 --- a/drivers/platform/tegra/rtcpu/camchar.c +++ b/drivers/platform/tegra/rtcpu/camchar.c @@ -239,7 +239,11 @@ static int __init tegra_camchar_init(struct tegra_ivc_driver *drv) } tegra_camchar_major_number = MAJOR(start); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0) + tegra_camchar_class = class_create("camchar_class"); +#else tegra_camchar_class = class_create(THIS_MODULE, "camchar_class"); +#endif if (IS_ERR(tegra_camchar_class)) { pr_alert("camchar: failed to create class\n"); ret = PTR_ERR(tegra_camchar_class); diff --git a/drivers/platform/tegra/tegra-fsicom.c b/drivers/platform/tegra/tegra-fsicom.c index 0214c3fd..d6c243f1 100644 --- a/drivers/platform/tegra/tegra-fsicom.c +++ b/drivers/platform/tegra/tegra-fsicom.c @@ -298,7 +298,11 @@ static int fsicom_register_device(void) return result; } device_file_major_number = result; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0) + dev_class = class_create("fsicom_client"); +#else dev_class = class_create(THIS_MODULE, "fsicom_client"); +#endif if (dev_class == NULL) { pr_err("%s> Could not create class for device\n", device_name); goto class_fail; diff --git a/drivers/virt/tegra/ivc-cdev.c b/drivers/virt/tegra/ivc-cdev.c index 8d50ab3e..1acb5e54 100644 --- a/drivers/virt/tegra/ivc-cdev.c +++ b/drivers/virt/tegra/ivc-cdev.c @@ -489,7 +489,11 @@ static int __init setup_ivc(void) return result; } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0) + ivc_class = class_create("ivc"); +#else ivc_class = class_create(THIS_MODULE, "ivc"); +#endif if (IS_ERR(ivc_class)) { ERR("failed to create ivc class: %ld\n", PTR_ERR(ivc_class)); return PTR_ERR(ivc_class); diff --git a/drivers/virt/tegra/tegra_hv_pm_ctl.c b/drivers/virt/tegra/tegra_hv_pm_ctl.c index 94f2100c..d1cb4ebd 100644 --- a/drivers/virt/tegra/tegra_hv_pm_ctl.c +++ b/drivers/virt/tegra/tegra_hv_pm_ctl.c @@ -1065,7 +1065,11 @@ static int tegra_hv_pm_ctl_probe(struct platform_device *pdev) return ret; } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0) + data->class = class_create(DRV_NAME); +#else data->class = class_create(THIS_MODULE, DRV_NAME); +#endif if (IS_ERR(data->class)) { dev_err(data->dev, "%s: Failed to create class, %ld\n", __func__, PTR_ERR(data->class)); diff --git a/drivers/virt/tegra/tegra_hv_vcpu_yield.c b/drivers/virt/tegra/tegra_hv_vcpu_yield.c index a7f9a5a3..bc516efc 100644 --- a/drivers/virt/tegra/tegra_hv_vcpu_yield.c +++ b/drivers/virt/tegra/tegra_hv_vcpu_yield.c @@ -368,8 +368,13 @@ static int tegra_hv_vcpu_yield_probe(struct platform_device *pdev) } major = MAJOR(vcpu_yield_pdev->vcpu_yield_dev); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0) + vcpu_yield_class = + class_create("tegra_hv_vcpu_yield"); +#else vcpu_yield_class = class_create(THIS_MODULE, "tegra_hv_vcpu_yield"); +#endif if (IS_ERR(vcpu_yield_class)) { pr_err("failed to create ivc class: %ld\n", PTR_ERR(vcpu_yield_class)); result = PTR_ERR(vcpu_yield_class); diff --git a/drivers/virt/tegra/userspace_ivc_mempool.c b/drivers/virt/tegra/userspace_ivc_mempool.c index 8a5d801b..cb933231 100644 --- a/drivers/virt/tegra/userspace_ivc_mempool.c +++ b/drivers/virt/tegra/userspace_ivc_mempool.c @@ -305,7 +305,11 @@ static int __init setup_ivc_mempool(void) } /* register ivc_user class with sysfs */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0) + ivc_mempool_class = class_create("tegra_uivc_mpool"); +#else ivc_mempool_class = class_create(THIS_MODULE, "tegra_uivc_mpool"); +#endif if (IS_ERR(ivc_mempool_class)) { pr_err("user_ivc_mempool: ### failed create sysfs class: %ld\n", PTR_ERR(ivc_mempool_class));