i2c: Use conftest to find if i2c_driver struct has new_probe

Use conftest method to find if i2c_driver struct has the
member as new_probe. This is dropped from Linux 6.6 with
commit 5eb1e6e459cf ("i2c: Drop legacy callback .probe_new()")

Bug 4346767

Change-Id: I10b539dfa1bb363ad6cf5fc28a9ebd0ca4e88b48
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3028631
(cherry picked from commit 537a307ffd)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3053704
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Jonathan Hunter <jonathanh@nvidia.com>
This commit is contained in:
Laxman Dewangan
2023-12-05 15:35:46 +00:00
committed by mobile promotions
parent a39a2be24e
commit 6ad6325734
7 changed files with 41 additions and 19 deletions

View File

@@ -5400,6 +5400,22 @@ compile_test() {
compile_check_conftest "$CODE" "NV_I2C_UNREGISTER_DEVICE_PRESENT" "" "functions"
;;
i2c_driver_struct_has_probe_new)
#
# Determine if struct i2c_driver has probe_new() present
#
# Added by commit 5eb1e6e459cf ("i2c: Drop legacy callback .probe_new()")
#
CODE="
#define _LINUX_EFI_H
#include <linux/i2c.h>
int conftest_i2c_driver_struct_has_probe_new(void) {
return offsetof(struct i2c_driver, probe_new);
}"
compile_check_conftest "$CODE" "NV_I2C_DRIVER_STRUCT_HAS_PROBE_NEW" "" "types"
;;
of_get_named_gpio)
#
# Determine if of_get_named_gpio() function is present