mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 09:11:26 +03:00
media: camera: Use conftest for devnode
Use confest in the camera CDI and ISC drivers to determine if the 'devnode' function pointer under the class structure to take a const device struct. Also fix the commit in conftest that introduced the change to the 'devnode' function pointer. Bug 4346767 Change-Id: I66de39e079c13219e0ff3e7154c0e7ceb609a29d Signed-off-by: Jon Hunter <jonathanh@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3034763 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
b0a2e7383c
commit
891d093a76
@@ -1498,10 +1498,10 @@ static struct cdi_mgr_platform_data *of_cdi_mgr_pdata(struct platform_device
|
||||
return pd;
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 2, 0)
|
||||
static char *cdi_mgr_devnode(struct device *dev, umode_t *mode)
|
||||
#else
|
||||
#if defined(NV_CLASS_STRUCT_DEVNODE_HAS_CONST_DEV_ARG) /* Linux v6.2 */
|
||||
static char *cdi_mgr_devnode(const struct device *dev, umode_t *mode)
|
||||
#else
|
||||
static char *cdi_mgr_devnode(struct device *dev, umode_t *mode)
|
||||
#endif
|
||||
{
|
||||
if (!mode)
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include <asm/siginfo.h>
|
||||
#include <linux/rcupdate.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/version.h>
|
||||
#include <linux/sched/signal.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/atomic.h>
|
||||
@@ -967,10 +966,10 @@ static struct isc_mgr_platform_data *of_isc_mgr_pdata(struct platform_device
|
||||
return pd;
|
||||
}
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 2, 0))
|
||||
static char *isc_mgr_devnode(struct device *dev, umode_t *mode)
|
||||
#else
|
||||
#if defined(NV_CLASS_STRUCT_DEVNODE_HAS_CONST_DEV_ARG) /* Linux v6.2 */
|
||||
static char *isc_mgr_devnode(const struct device *dev, umode_t *mode)
|
||||
#else
|
||||
static char *isc_mgr_devnode(struct device *dev, umode_t *mode)
|
||||
#endif
|
||||
{
|
||||
if (!mode)
|
||||
|
||||
@@ -6651,7 +6651,7 @@ compile_test() {
|
||||
# Determine if the 'class' structure devnode function pointer
|
||||
# has const 'struct dev' argument.
|
||||
#
|
||||
# Commit 43a7206b0963 ("driver core: class: make class_register()
|
||||
# Commit ff62b8e6588f ("driver core: make struct class.devnode()
|
||||
# take a const *") updated the class_register function to take a
|
||||
# const class structure in Linux v6.2.
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user