When building the BMI088 driver with the compiler option
'-Werror=declaration-after-statement' the build fails with the following
errors ...
drivers/bmi088/bmi088_iio.c: In function ‘bmi_iio_attr_store’:
drivers/bmi088/bmi088_iio.c:226:9: error: ISO C90 forbids mixed
declarations and code [-Werror=declaration-after-statement]
226 | struct bmi_iio_state *st = iio_priv(indio_dev);
| ^~~~~~
drivers/bmi088/bmi088_iio.c: In function ‘bmi_iio_attr_show’:
drivers/bmi088/bmi088_iio.c:283:9: error: ISO C90 forbids mixed
declarations and code [-Werror=declaration-after-statement]
283 | struct bmi_iio_state *st = iio_priv(indio_dev);
| ^~~~~~
Fix this by ensuring that all variables are defined at the start of the
functions.
Bug 4190630
Change-Id: I52e90fbc61d4d33ab8c1dfd4e551a54461aad788
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3330356
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Blake McHale <bmchale@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
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>