mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 09:11:26 +03:00
drivers: bmi088: Fix build for post-Linux v6.2
BMI088 driver was failing to build for Kernel version > 6.2 and the following error is seen: drivers/bmi088/bmi088_core.c:1043:42: error: 'struct iio_dev' has no member named 'mlock' mutex_lock(&st->snsrs[hw].bmi_iio->mlock); mlock field is moved from indio_dev to iio_dev_opaque structure from v6.2 onwards. Instead of using kernel version, use conftest.sh script which checks for the 'mlock' field in iio_dev_opaque structure or not. Bug 4190630 Change-Id: Icc540edd916718d30460b314600c20e70144b1d6 Signed-off-by: Gautham Srinivasan <gauthams@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2983266 Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com> Tested-by: Jonathan Hunter <jonathanh@nvidia.com> GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
6323c46280
commit
6fec90c658
@@ -6310,6 +6310,25 @@ compile_test() {
|
||||
compile_check_conftest "$CODE" "NV_DEVM_THERMAL_OF_ZONE_REGISTER_PRESENT" "" "functions"
|
||||
;;
|
||||
|
||||
iio_dev_opaque_has_mlock)
|
||||
#
|
||||
# Determine if the 'iio_dev_opaque' structure has 'mlock' field.
|
||||
# 'mlock' field is moved from 'indio_dev' to 'iio_dev_opaque'
|
||||
# structure.
|
||||
#
|
||||
# Added in commit 16afe125b53f88b855d2713c8ba253d905dcf3cc (iio: core:
|
||||
# move 'mlock' to 'struct iio_dev_opaque') in v6.2 2022-10-12
|
||||
|
||||
CODE="
|
||||
#include <linux/iio/iio.h>
|
||||
#include <linux/iio/iio-opaque.h>
|
||||
int conftest_iio_dev_opaque_has_mlock(void) {
|
||||
return offsetof(struct iio_dev_opaque, mlock);
|
||||
}"
|
||||
|
||||
compile_check_conftest "$CODE" "NV_IIO_DEV_OPAQUE_HAS_LOCK" "" "types"
|
||||
;;
|
||||
|
||||
# When adding a new conftest entry, please use the correct format for
|
||||
# specifying the relevant upstream Linux kernel commit.
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user