mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
drivers: Add conftest test for class_create
In Linux v6.4, the module pointer argument is removed from the class_create() function. Add a test to the conftest script that checks if this argument for the class_create() function has been removed and use the definition created by conftest to select which version of the function is used. Bug 4183168 Bug 4221847 Change-Id: I440e4b318001886cd0319bb3499ba33178475e8c Signed-off-by: Jon Hunter <jonathanh@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2989020 Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
86dafc35bb
commit
ce678a37b1
@@ -18,7 +18,6 @@
|
|||||||
#include <linux/poll.h>
|
#include <linux/poll.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <linux/sync_file.h>
|
#include <linux/sync_file.h>
|
||||||
#include <linux/version.h>
|
|
||||||
|
|
||||||
#include "include/uapi/linux/host1x-fence.h"
|
#include "include/uapi/linux/host1x-fence.h"
|
||||||
|
|
||||||
@@ -436,10 +435,10 @@ static int host1x_uapi_init(struct host1x_uapi *uapi)
|
|||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0))
|
#if defined(NV_CLASS_CREATE_HAS_NO_OWNER_ARG) /* Linux v6.4 */
|
||||||
uapi->class = class_create(THIS_MODULE, "host1x-fence");
|
|
||||||
#else
|
|
||||||
uapi->class = class_create("host1x-fence");
|
uapi->class = class_create("host1x-fence");
|
||||||
|
#else
|
||||||
|
uapi->class = class_create(THIS_MODULE, "host1x-fence");
|
||||||
#endif
|
#endif
|
||||||
if (IS_ERR(uapi->class)) {
|
if (IS_ERR(uapi->class)) {
|
||||||
err = PTR_ERR(uapi->class);
|
err = PTR_ERR(uapi->class);
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
* Copyright (c) 2022-2023, NVIDIA Corporation. All rights reserved.
|
* Copyright (c) 2022-2023, NVIDIA Corporation. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <nvidia/conftest.h>
|
||||||
|
|
||||||
#include <linux/clk.h>
|
#include <linux/clk.h>
|
||||||
#include <linux/debugfs.h>
|
#include <linux/debugfs.h>
|
||||||
#include <linux/dma-fence.h>
|
#include <linux/dma-fence.h>
|
||||||
@@ -112,10 +114,10 @@ static struct device *nvhost_client_device_create(struct platform_device *pdev,
|
|||||||
struct device *dev;
|
struct device *dev;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0))
|
#if defined(NV_CLASS_CREATE_HAS_NO_OWNER_ARG) /* Linux v6.4 */
|
||||||
pdata->nvhost_class = class_create(THIS_MODULE, pdev->dev.of_node->name);
|
|
||||||
#else
|
|
||||||
pdata->nvhost_class = class_create(pdev->dev.of_node->name);
|
pdata->nvhost_class = class_create(pdev->dev.of_node->name);
|
||||||
|
#else
|
||||||
|
pdata->nvhost_class = class_create(THIS_MODULE, pdev->dev.of_node->name);
|
||||||
#endif
|
#endif
|
||||||
if (IS_ERR(pdata->nvhost_class)) {
|
if (IS_ERR(pdata->nvhost_class)) {
|
||||||
dev_err(&pdev->dev, "failed to create class\n");
|
dev_err(&pdev->dev, "failed to create class\n");
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
* Copyright (c) 2022-2023, NVIDIA CORPORATION. All rights reserved.
|
* Copyright (c) 2022-2023, NVIDIA CORPORATION. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <nvidia/conftest.h>
|
||||||
|
|
||||||
#include <asm/types.h>
|
#include <asm/types.h>
|
||||||
#include <linux/bitfield.h>
|
#include <linux/bitfield.h>
|
||||||
#include <linux/bits.h>
|
#include <linux/bits.h>
|
||||||
@@ -22,7 +24,6 @@
|
|||||||
#include <linux/pm.h>
|
#include <linux/pm.h>
|
||||||
#include <linux/cdev.h>
|
#include <linux/cdev.h>
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
#include <linux/version.h>
|
|
||||||
|
|
||||||
#include <uapi/media/cam_fsync.h>
|
#include <uapi/media/cam_fsync.h>
|
||||||
|
|
||||||
@@ -911,10 +912,10 @@ static int cam_fsync_find_and_add_groups(struct cam_fsync_controller *controller
|
|||||||
*/
|
*/
|
||||||
static int cam_fsync_chrdev_init(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)
|
#if defined(NV_CLASS_CREATE_HAS_NO_OWNER_ARG) /* Linux v6.4 */
|
||||||
controller->cam_fsync_class = class_create(THIS_MODULE, CAM_FSYNC_CLASS_NAME);
|
|
||||||
#else
|
|
||||||
controller->cam_fsync_class = class_create(CAM_FSYNC_CLASS_NAME);
|
controller->cam_fsync_class = class_create(CAM_FSYNC_CLASS_NAME);
|
||||||
|
#else
|
||||||
|
controller->cam_fsync_class = class_create(THIS_MODULE, CAM_FSYNC_CLASS_NAME);
|
||||||
#endif
|
#endif
|
||||||
if (IS_ERR(controller->cam_fsync_class))
|
if (IS_ERR(controller->cam_fsync_class))
|
||||||
return PTR_ERR(controller->cam_fsync_class);
|
return PTR_ERR(controller->cam_fsync_class);
|
||||||
|
|||||||
@@ -8,6 +8,8 @@
|
|||||||
* platform.
|
* platform.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <nvidia/conftest.h>
|
||||||
|
|
||||||
#include <asm/ioctls.h>
|
#include <asm/ioctls.h>
|
||||||
#include <linux/cdev.h>
|
#include <linux/cdev.h>
|
||||||
#include <linux/device.h>
|
#include <linux/device.h>
|
||||||
@@ -601,7 +603,7 @@ EXPORT_SYMBOL(isp_channel_drv_unregister);
|
|||||||
*/
|
*/
|
||||||
int isp_channel_drv_init(void)
|
int isp_channel_drv_init(void)
|
||||||
{
|
{
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0)
|
#if defined(NV_CLASS_CREATE_HAS_NO_OWNER_ARG) /* Linux v6.4 */
|
||||||
isp_channel_class = class_create("capture-isp-channel");
|
isp_channel_class = class_create("capture-isp-channel");
|
||||||
#else
|
#else
|
||||||
isp_channel_class = class_create(THIS_MODULE, "capture-isp-channel");
|
isp_channel_class = class_create(THIS_MODULE, "capture-isp-channel");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
// Copyright (c) 2017-2022 NVIDIA Corporation. All rights reserved.
|
// Copyright (c) 2017-2023 NVIDIA Corporation. All rights reserved.
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file drivers/media/platform/tegra/camera/fusa-capture/capture-vi-channel.c
|
* @file drivers/media/platform/tegra/camera/fusa-capture/capture-vi-channel.c
|
||||||
@@ -8,6 +8,8 @@
|
|||||||
* platform.
|
* platform.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <nvidia/conftest.h>
|
||||||
|
|
||||||
#include <asm/ioctls.h>
|
#include <asm/ioctls.h>
|
||||||
#include <linux/cdev.h>
|
#include <linux/cdev.h>
|
||||||
#include <linux/device.h>
|
#include <linux/device.h>
|
||||||
@@ -743,7 +745,7 @@ EXPORT_SYMBOL(vi_channel_drv_unregister);
|
|||||||
*/
|
*/
|
||||||
int vi_channel_drv_init(void)
|
int vi_channel_drv_init(void)
|
||||||
{
|
{
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0)
|
#if defined(NV_CLASS_CREATE_HAS_NO_OWNER_ARG) /* Linux v6.4 */
|
||||||
vi_channel_class = class_create("capture-vi-channel");
|
vi_channel_class = class_create("capture-vi-channel");
|
||||||
#else
|
#else
|
||||||
vi_channel_class = class_create(THIS_MODULE, "capture-vi-channel");
|
vi_channel_class = class_create(THIS_MODULE, "capture-vi-channel");
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
* cam_cdi_tsc.c - tsc driver.
|
* cam_cdi_tsc.c - tsc driver.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <nvidia/conftest.h>
|
||||||
|
|
||||||
#include <asm/types.h>
|
#include <asm/types.h>
|
||||||
#include <linux/bitfield.h>
|
#include <linux/bitfield.h>
|
||||||
#include <linux/bits.h>
|
#include <linux/bits.h>
|
||||||
@@ -22,7 +24,6 @@
|
|||||||
#include <linux/of_gpio.h>
|
#include <linux/of_gpio.h>
|
||||||
#include <linux/platform_device.h>
|
#include <linux/platform_device.h>
|
||||||
#include <linux/pm.h>
|
#include <linux/pm.h>
|
||||||
#include <linux/version.h>
|
|
||||||
|
|
||||||
#define DEVICE_NAME "cdi_tsc"
|
#define DEVICE_NAME "cdi_tsc"
|
||||||
#define CLASS_NAME "cdi_tsc_class"
|
#define CLASS_NAME "cdi_tsc_class"
|
||||||
@@ -555,7 +556,7 @@ static int cdi_tsc_probe(struct platform_device *pdev)
|
|||||||
return majorNumber;
|
return majorNumber;
|
||||||
}
|
}
|
||||||
/*Create a class for the device*/
|
/*Create a class for the device*/
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0)
|
#if defined(NV_CLASS_CREATE_HAS_NO_OWNER_ARG) /* Linux v6.4 */
|
||||||
tsc_charClass = class_create(CLASS_NAME);
|
tsc_charClass = class_create(CLASS_NAME);
|
||||||
#else
|
#else
|
||||||
tsc_charClass = class_create(THIS_MODULE, CLASS_NAME);
|
tsc_charClass = class_create(THIS_MODULE, CLASS_NAME);
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
// Copyright (c) 2015-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
// Copyright (c) 2015-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||||
|
|
||||||
|
#include <nvidia/conftest.h>
|
||||||
|
|
||||||
#include <linux/delay.h>
|
#include <linux/delay.h>
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
@@ -1875,7 +1878,11 @@ static int cdi_mgr_probe(struct platform_device *pdev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* poluate sysfs entries */
|
/* poluate sysfs entries */
|
||||||
|
#if defined(NV_CLASS_CREATE_HAS_NO_OWNER_ARG) /* Linux v6.4 */
|
||||||
|
cdi_mgr->cdi_class = class_create(cdi_mgr->devname);
|
||||||
|
#else
|
||||||
cdi_mgr->cdi_class = class_create(THIS_MODULE, cdi_mgr->devname);
|
cdi_mgr->cdi_class = class_create(THIS_MODULE, cdi_mgr->devname);
|
||||||
|
#endif
|
||||||
if (IS_ERR(cdi_mgr->cdi_class)) {
|
if (IS_ERR(cdi_mgr->cdi_class)) {
|
||||||
err = PTR_ERR(cdi_mgr->cdi_class);
|
err = PTR_ERR(cdi_mgr->cdi_class);
|
||||||
cdi_mgr->cdi_class = NULL;
|
cdi_mgr->cdi_class = NULL;
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
// Copyright (c) 2015-2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
// Copyright (c) 2015-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||||
|
|
||||||
|
#include <nvidia/conftest.h>
|
||||||
|
|
||||||
#include <linux/delay.h>
|
#include <linux/delay.h>
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
@@ -1116,7 +1118,11 @@ static int isc_mgr_probe(struct platform_device *pdev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* poluate sysfs entries */
|
/* poluate sysfs entries */
|
||||||
|
#if defined(NV_CLASS_CREATE_HAS_NO_OWNER_ARG) /* Linux v6.4 */
|
||||||
|
isc_mgr->isc_class = class_create(isc_mgr->devname);
|
||||||
|
#else
|
||||||
isc_mgr->isc_class = class_create(THIS_MODULE, isc_mgr->devname);
|
isc_mgr->isc_class = class_create(THIS_MODULE, isc_mgr->devname);
|
||||||
|
#endif
|
||||||
if (IS_ERR(isc_mgr->isc_class)) {
|
if (IS_ERR(isc_mgr->isc_class)) {
|
||||||
err = PTR_ERR(isc_mgr->isc_class);
|
err = PTR_ERR(isc_mgr->isc_class);
|
||||||
isc_mgr->isc_class = NULL;
|
isc_mgr->isc_class = NULL;
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
#define pr_fmt(fmt) "nvscic2c-pcie: endpoint: " fmt
|
#define pr_fmt(fmt) "nvscic2c-pcie: endpoint: " fmt
|
||||||
|
|
||||||
|
#include <nvidia/conftest.h>
|
||||||
|
|
||||||
#include <linux/atomic.h>
|
#include <linux/atomic.h>
|
||||||
#include <linux/cdev.h>
|
#include <linux/cdev.h>
|
||||||
#include <linux/dma-fence.h>
|
#include <linux/dma-fence.h>
|
||||||
@@ -1057,7 +1059,11 @@ endpoints_setup(struct driver_ctx_t *drv_ctx, void **endpoints_h)
|
|||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
|
#if defined(NV_CLASS_CREATE_HAS_NO_OWNER_ARG) /* Linux v6.4 */
|
||||||
|
eps_ctx->class = class_create(eps_ctx->drv_name);
|
||||||
|
#else
|
||||||
eps_ctx->class = class_create(THIS_MODULE, eps_ctx->drv_name);
|
eps_ctx->class = class_create(THIS_MODULE, eps_ctx->drv_name);
|
||||||
|
#endif
|
||||||
if (IS_ERR_OR_NULL(eps_ctx->class)) {
|
if (IS_ERR_OR_NULL(eps_ctx->class)) {
|
||||||
ret = PTR_ERR(eps_ctx->class);
|
ret = PTR_ERR(eps_ctx->class);
|
||||||
goto err;
|
goto err;
|
||||||
|
|||||||
@@ -6,6 +6,8 @@
|
|||||||
* secure buffer sharing use case across processes.
|
* secure buffer sharing use case across processes.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <nvidia/conftest.h>
|
||||||
|
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/platform_device.h>
|
#include <linux/platform_device.h>
|
||||||
#include <linux/string.h>
|
#include <linux/string.h>
|
||||||
@@ -20,7 +22,6 @@
|
|||||||
#include <linux/cred.h>
|
#include <linux/cred.h>
|
||||||
#include <linux/of.h>
|
#include <linux/of.h>
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
#include <linux/version.h>
|
|
||||||
|
|
||||||
#ifdef CONFIG_TEGRA_VIRTUALIZATION
|
#ifdef CONFIG_TEGRA_VIRTUALIZATION
|
||||||
#include <soc/tegra/virt/syscalls.h>
|
#include <soc/tegra/virt/syscalls.h>
|
||||||
@@ -696,7 +697,7 @@ static int nvsciipc_probe(struct platform_device *pdev)
|
|||||||
ctx->dev = &(pdev->dev);
|
ctx->dev = &(pdev->dev);
|
||||||
platform_set_drvdata(pdev, ctx);
|
platform_set_drvdata(pdev, ctx);
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0)
|
#if defined(NV_CLASS_CREATE_HAS_NO_OWNER_ARG) /* Linux v6.4 */
|
||||||
ctx->nvsciipc_class = class_create(MODULE_NAME);
|
ctx->nvsciipc_class = class_create(MODULE_NAME);
|
||||||
#else
|
#else
|
||||||
ctx->nvsciipc_class = class_create(THIS_MODULE, MODULE_NAME);
|
ctx->nvsciipc_class = class_create(THIS_MODULE, MODULE_NAME);
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
* SPDX-License-Identifier: GPL-2.0
|
* SPDX-License-Identifier: GPL-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <nvidia/conftest.h>
|
||||||
|
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
@@ -737,7 +739,7 @@ static int nvvc_register_dev(nvvc_dev_t *nvvcdev)
|
|||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0)
|
#if defined(NV_CLASS_CREATE_HAS_NO_OWNER_ARG) /* Linux v6.4 */
|
||||||
nvvcdev->class = class_create("nvvc");
|
nvvcdev->class = class_create("nvvc");
|
||||||
#else
|
#else
|
||||||
nvvcdev->class = class_create(THIS_MODULE, "nvvc");
|
nvvcdev->class = class_create(THIS_MODULE, "nvvc");
|
||||||
|
|||||||
@@ -12,6 +12,8 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <nvidia/conftest.h>
|
||||||
|
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/interrupt.h>
|
#include <linux/interrupt.h>
|
||||||
@@ -1025,7 +1027,7 @@ static int nvpps_probe(struct platform_device *pdev)
|
|||||||
|
|
||||||
/* character device setup */
|
/* character device setup */
|
||||||
#ifndef NVPPS_NO_DT
|
#ifndef NVPPS_NO_DT
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0)
|
#if defined(NV_CLASS_CREATE_HAS_NO_OWNER_ARG) /* Linux v6.4 */
|
||||||
s_nvpps_class = class_create("nvpps");
|
s_nvpps_class = class_create("nvpps");
|
||||||
#else
|
#else
|
||||||
s_nvpps_class = class_create(THIS_MODULE, "nvpps");
|
s_nvpps_class = class_create(THIS_MODULE, "nvpps");
|
||||||
@@ -1240,7 +1242,7 @@ static int __init nvpps_init(void)
|
|||||||
|
|
||||||
printk("%s\n", __FUNCTION__);
|
printk("%s\n", __FUNCTION__);
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0)
|
#if defined(NV_CLASS_CREATE_HAS_NO_OWNER_ARG) /* Linux v6.4 */
|
||||||
s_nvpps_class = class_create("nvpps");
|
s_nvpps_class = class_create("nvpps");
|
||||||
#else
|
#else
|
||||||
s_nvpps_class = class_create(THIS_MODULE, "nvpps");
|
s_nvpps_class = class_create(THIS_MODULE, "nvpps");
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
// Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
// Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||||
|
|
||||||
|
#include <nvidia/conftest.h>
|
||||||
|
|
||||||
#include <linux/bitmap.h>
|
#include <linux/bitmap.h>
|
||||||
#include <linux/cdev.h>
|
#include <linux/cdev.h>
|
||||||
#include <linux/dcache.h>
|
#include <linux/dcache.h>
|
||||||
@@ -239,7 +241,7 @@ static int __init tegra_camchar_init(struct tegra_ivc_driver *drv)
|
|||||||
}
|
}
|
||||||
tegra_camchar_major_number = MAJOR(start);
|
tegra_camchar_major_number = MAJOR(start);
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0)
|
#if defined(NV_CLASS_CREATE_HAS_NO_OWNER_ARG) /* Linux v6.4 */
|
||||||
tegra_camchar_class = class_create("camchar_class");
|
tegra_camchar_class = class_create("camchar_class");
|
||||||
#else
|
#else
|
||||||
tegra_camchar_class = class_create(THIS_MODULE, "camchar_class");
|
tegra_camchar_class = class_create(THIS_MODULE, "camchar_class");
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
// Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved.
|
// Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved.
|
||||||
|
|
||||||
|
#include <nvidia/conftest.h>
|
||||||
|
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
@@ -11,7 +13,6 @@
|
|||||||
#include <linux/kdev_t.h>
|
#include <linux/kdev_t.h>
|
||||||
#include <linux/mailbox_client.h>
|
#include <linux/mailbox_client.h>
|
||||||
#include <linux/sched/signal.h>
|
#include <linux/sched/signal.h>
|
||||||
#include <linux/version.h>
|
|
||||||
#include <uapi/linux/tegra-fsicom.h>
|
#include <uapi/linux/tegra-fsicom.h>
|
||||||
#include <linux/pm.h>
|
#include <linux/pm.h>
|
||||||
|
|
||||||
@@ -298,7 +299,7 @@ static int fsicom_register_device(void)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
device_file_major_number = result;
|
device_file_major_number = result;
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0)
|
#if defined(NV_CLASS_CREATE_HAS_NO_OWNER_ARG) /* Linux v6.4 */
|
||||||
dev_class = class_create("fsicom_client");
|
dev_class = class_create("fsicom_client");
|
||||||
#else
|
#else
|
||||||
dev_class = class_create(THIS_MODULE, "fsicom_client");
|
dev_class = class_create(THIS_MODULE, "fsicom_client");
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
* Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <nvidia/conftest.h>
|
||||||
|
|
||||||
#include <soc/tegra/virt/hv-ivc.h>
|
#include <soc/tegra/virt/hv-ivc.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
@@ -489,7 +491,7 @@ static int __init setup_ivc(void)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0)
|
#if defined(NV_CLASS_CREATE_HAS_NO_OWNER_ARG) /* Linux v6.4 */
|
||||||
ivc_class = class_create("ivc");
|
ivc_class = class_create("ivc");
|
||||||
#else
|
#else
|
||||||
ivc_class = class_create(THIS_MODULE, "ivc");
|
ivc_class = class_create(THIS_MODULE, "ivc");
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
* Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
* Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <nvidia/conftest.h>
|
||||||
|
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
@@ -421,7 +423,11 @@ static int tegra_hv_setup(struct tegra_hv_data *hvd)
|
|||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(NV_CLASS_CREATE_HAS_NO_OWNER_ARG) /* Linux v6.4 */
|
||||||
|
hvd->hv_class = class_create("tegra_hv");
|
||||||
|
#else
|
||||||
hvd->hv_class = class_create(THIS_MODULE, "tegra_hv");
|
hvd->hv_class = class_create(THIS_MODULE, "tegra_hv");
|
||||||
|
#endif
|
||||||
if (IS_ERR(hvd->hv_class)) {
|
if (IS_ERR(hvd->hv_class)) {
|
||||||
ERR("class_create() failed\n");
|
ERR("class_create() failed\n");
|
||||||
return PTR_ERR(hvd->hv_class);
|
return PTR_ERR(hvd->hv_class);
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
* Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <nvidia/conftest.h>
|
||||||
|
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/errno.h>
|
#include <linux/errno.h>
|
||||||
#include <linux/of.h>
|
#include <linux/of.h>
|
||||||
@@ -1065,7 +1068,7 @@ static int tegra_hv_pm_ctl_probe(struct platform_device *pdev)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0)
|
#if defined(NV_CLASS_CREATE_HAS_NO_OWNER_ARG) /* Linux v6.4 */
|
||||||
data->class = class_create(DRV_NAME);
|
data->class = class_create(DRV_NAME);
|
||||||
#else
|
#else
|
||||||
data->class = class_create(THIS_MODULE, DRV_NAME);
|
data->class = class_create(THIS_MODULE, DRV_NAME);
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
#define pr_fmt(fmt) "%s:%s(): " fmt, KBUILD_MODNAME, __func__
|
#define pr_fmt(fmt) "%s:%s(): " fmt, KBUILD_MODNAME, __func__
|
||||||
|
|
||||||
|
#include <nvidia/conftest.h>
|
||||||
|
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/kdev_t.h>
|
#include <linux/kdev_t.h>
|
||||||
@@ -368,7 +370,7 @@ static int tegra_hv_vcpu_yield_probe(struct platform_device *pdev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
major = MAJOR(vcpu_yield_pdev->vcpu_yield_dev);
|
major = MAJOR(vcpu_yield_pdev->vcpu_yield_dev);
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0)
|
#if defined(NV_CLASS_CREATE_HAS_NO_OWNER_ARG) /* Linux v6.4 */
|
||||||
vcpu_yield_class =
|
vcpu_yield_class =
|
||||||
class_create("tegra_hv_vcpu_yield");
|
class_create("tegra_hv_vcpu_yield");
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
* Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <nvidia/conftest.h>
|
||||||
|
|
||||||
#include <linux/compiler.h>
|
#include <linux/compiler.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
@@ -15,7 +17,6 @@
|
|||||||
#include <soc/tegra/fuse.h>
|
#include <soc/tegra/fuse.h>
|
||||||
#include <soc/tegra/virt/hv-ivc.h>
|
#include <soc/tegra/virt/hv-ivc.h>
|
||||||
#include <uapi/linux/nvhvivc_mempool_ioctl.h>
|
#include <uapi/linux/nvhvivc_mempool_ioctl.h>
|
||||||
#include <linux/version.h>
|
|
||||||
|
|
||||||
#include <linux/uaccess.h>
|
#include <linux/uaccess.h>
|
||||||
|
|
||||||
@@ -305,7 +306,7 @@ static int __init setup_ivc_mempool(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* register ivc_user class with sysfs */
|
/* register ivc_user class with sysfs */
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0)
|
#if defined(NV_CLASS_CREATE_HAS_NO_OWNER_ARG) /* Linux v6.4 */
|
||||||
ivc_mempool_class = class_create("tegra_uivc_mpool");
|
ivc_mempool_class = class_create("tegra_uivc_mpool");
|
||||||
#else
|
#else
|
||||||
ivc_mempool_class = class_create(THIS_MODULE, "tegra_uivc_mpool");
|
ivc_mempool_class = class_create(THIS_MODULE, "tegra_uivc_mpool");
|
||||||
|
|||||||
@@ -89,6 +89,7 @@ endef
|
|||||||
#
|
#
|
||||||
|
|
||||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += bus_type_struct_remove_has_int_return_type
|
NV_CONFTEST_FUNCTION_COMPILE_TESTS += bus_type_struct_remove_has_int_return_type
|
||||||
|
NV_CONFTEST_FUNCTION_COMPILE_TESTS += class_create_has_no_owner_arg
|
||||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += class_struct_devnode_has_const_dev_arg
|
NV_CONFTEST_FUNCTION_COMPILE_TESTS += class_struct_devnode_has_const_dev_arg
|
||||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += define_semaphore_has_number_arg
|
NV_CONFTEST_FUNCTION_COMPILE_TESTS += define_semaphore_has_number_arg
|
||||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += devm_thermal_of_zone_register
|
NV_CONFTEST_FUNCTION_COMPILE_TESTS += devm_thermal_of_zone_register
|
||||||
|
|||||||
@@ -6312,6 +6312,24 @@ compile_test() {
|
|||||||
compile_check_conftest "$CODE" "NV_BUS_TYPE_STRUCT_REMOVE_HAS_INT_RETURN_TYPE" "" "types"
|
compile_check_conftest "$CODE" "NV_BUS_TYPE_STRUCT_REMOVE_HAS_INT_RETURN_TYPE" "" "types"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
class_create_has_no_owner_arg)
|
||||||
|
#
|
||||||
|
# Determine if the class_create() function has the 'owner' argument.
|
||||||
|
#
|
||||||
|
# Commit 1aaba11da9aa ("driver core: class: remove module * from
|
||||||
|
# class_create()") removed the owner argument for the class_create
|
||||||
|
# function in Linux v6.4.
|
||||||
|
#
|
||||||
|
CODE="
|
||||||
|
#include <linux/device.h>
|
||||||
|
#include <linux/device/class.h>
|
||||||
|
struct class *conftest_class_create_has_no_owner_arg(const char *name) {
|
||||||
|
return class_create(name);
|
||||||
|
}"
|
||||||
|
|
||||||
|
compile_check_conftest "$CODE" "NV_CLASS_CREATE_HAS_NO_OWNER_ARG" "" "types"
|
||||||
|
;;
|
||||||
|
|
||||||
class_struct_devnode_has_const_dev_arg)
|
class_struct_devnode_has_const_dev_arg)
|
||||||
#
|
#
|
||||||
# Determine if the 'class' structure devnode function pointer
|
# Determine if the 'class' structure devnode function pointer
|
||||||
|
|||||||
Reference in New Issue
Block a user