i2c: Use conftest to find if i2c driver probe has i2c_device_i2d arg

Determine if probe of struct i2c_driver has i2c_device_id argument
or not.

This argument get removed from commit 03c835f498b5 ("i2c: Switch
.probe() to not take an id parameter") form Linux 6.3.

Bug 4346767

Change-Id: Ife73b29946246fce5bfcedcabe15992432d86348
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3030809
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Laxman Dewangan
2023-12-08 09:12:49 +00:00
committed by mobile promotions
parent de4295cfa6
commit 2884c4b380
26 changed files with 90 additions and 26 deletions

View File

@@ -118,6 +118,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += ethtool_ops_get_set_coalesce_has_coal_and_
NV_CONFTEST_FUNCTION_COMPILE_TESTS += ethtool_ops_get_set_ringparam_has_ringparam_and_extack_args
NV_CONFTEST_FUNCTION_COMPILE_TESTS += get_file_rcu_has_double_ptr_file_arg
NV_CONFTEST_FUNCTION_COMPILE_TESTS += get_user_pages
NV_CONFTEST_FUNCTION_COMPILE_TESTS += i2c_driver_struct_probe_without_i2c_device_id_arg
NV_CONFTEST_FUNCTION_COMPILE_TESTS += i2c_driver_struct_has_probe_new
NV_CONFTEST_FUNCTION_COMPILE_TESTS += iio_dev_opaque_has_mlock
NV_CONFTEST_FUNCTION_COMPILE_TESTS += iommu_map_has_gfp_arg

View File

@@ -5400,6 +5400,24 @@ compile_test() {
compile_check_conftest "$CODE" "NV_I2C_UNREGISTER_DEVICE_PRESENT" "" "functions"
;;
i2c_driver_struct_probe_without_i2c_device_id_arg)
#
# Determine if function probe() of struct i2c_driver has
# struct i2c_device_id as argument or not.
#
# Removed by commit 03c835f498b54 ("i2c: Switch .probe() to not take an id parameter")
# Linux 6.3
#
CODE="
#define _LINUX_EFI_H
#include <linux/i2c.h>
void conftest_i2c_driver_struct_probe_without_i2c_device_id_arg(struct i2c_driver *i2cd) {
i2cd->probe(NULL);
}"
compile_check_conftest "$CODE" "NV_I2C_DRIVER_STRUCT_PROBE_WITHOUT_I2C_DEVICE_ID_ARG" "" "types"
;;
i2c_driver_struct_has_probe_new)
#
# Determine if struct i2c_driver has probe_new() present