mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +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
(cherry picked from commit 891d093a76)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3037031
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
e1471516b0
commit
020bdeded8
@@ -1487,10 +1487,10 @@ static struct cdi_mgr_platform_data *of_cdi_mgr_pdata(struct platform_device
|
|||||||
return pd;
|
return pd;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 2, 0)
|
#if defined(NV_CLASS_STRUCT_DEVNODE_HAS_CONST_DEV_ARG) /* Linux v6.2 */
|
||||||
static char *cdi_mgr_devnode(struct device *dev, umode_t *mode)
|
|
||||||
#else
|
|
||||||
static char *cdi_mgr_devnode(const struct device *dev, umode_t *mode)
|
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
|
#endif
|
||||||
{
|
{
|
||||||
if (!mode)
|
if (!mode)
|
||||||
|
|||||||
@@ -18,7 +18,6 @@
|
|||||||
#include <asm/siginfo.h>
|
#include <asm/siginfo.h>
|
||||||
#include <linux/rcupdate.h>
|
#include <linux/rcupdate.h>
|
||||||
#include <linux/sched.h>
|
#include <linux/sched.h>
|
||||||
#include <linux/version.h>
|
|
||||||
#include <linux/sched/signal.h>
|
#include <linux/sched/signal.h>
|
||||||
#include <linux/uaccess.h>
|
#include <linux/uaccess.h>
|
||||||
#include <linux/atomic.h>
|
#include <linux/atomic.h>
|
||||||
@@ -957,10 +956,10 @@ static struct isc_mgr_platform_data *of_isc_mgr_pdata(struct platform_device
|
|||||||
return pd;
|
return pd;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 2, 0))
|
#if defined(NV_CLASS_STRUCT_DEVNODE_HAS_CONST_DEV_ARG) /* Linux v6.2 */
|
||||||
static char *isc_mgr_devnode(struct device *dev, umode_t *mode)
|
|
||||||
#else
|
|
||||||
static char *isc_mgr_devnode(const struct device *dev, umode_t *mode)
|
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
|
#endif
|
||||||
{
|
{
|
||||||
if (!mode)
|
if (!mode)
|
||||||
|
|||||||
@@ -6521,7 +6521,7 @@ compile_test() {
|
|||||||
# Determine if the 'class' structure devnode function pointer
|
# Determine if the 'class' structure devnode function pointer
|
||||||
# has const 'struct dev' argument.
|
# 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
|
# take a const *") updated the class_register function to take a
|
||||||
# const class structure in Linux v6.2.
|
# const class structure in Linux v6.2.
|
||||||
#
|
#
|
||||||
|
|||||||
Reference in New Issue
Block a user