gpu/host1x: Use conftest for Linux v6.3

Use conftest to determine if the uevent() function pointer in the
bus_type structure has a const dev argument. This fixes the build for
Linux kernels prior to Linux v6.3 that include the upstream change that
changed the arguments to this function.

Bug 4014315

Change-Id: I1553e08c951be9dd27141c273bf91be38dd954a6
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3019964
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Jon Hunter
2023-11-21 16:04:16 +00:00
committed by mobile promotions
parent 067fbd7bbc
commit 5fe2e2aacc
3 changed files with 24 additions and 2 deletions

View File

@@ -4,6 +4,8 @@
* Copyright (C) 2012-2013, NVIDIA Corporation
*/
#include <nvidia/conftest.h>
#include <linux/debugfs.h>
#include <linux/dma-mapping.h>
#include <linux/host1x-next.h>
@@ -11,7 +13,6 @@
#include <linux/seq_file.h>
#include <linux/slab.h>
#include <linux/of_device.h>
#include <linux/version.h>
#include "bus.h"
#include "dev.h"
@@ -339,7 +340,7 @@ static int host1x_device_match(struct device *dev, struct device_driver *drv)
return strcmp(dev_name(dev), drv->name) == 0;
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)
#if defined(NV_BUS_TYPE_STRUCT_UEVENT_HAS_CONST_DEV_ARG) /* Linux v6.3 */
static int host1x_device_uevent(const struct device *dev,
#else
static int host1x_device_uevent(struct device *dev,