mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 09:11:26 +03:00
media: camera: Fix build for Linux v6.9
In Linux v6.9 the data argument of the function pointer passed to gpio_device_find() was updated to be a const type. This breaks building the CDI and ISC drivers for Linux v6.9. Update the test in conftest that detects the presence of the gpio_device_find() function to perform a second test to see if the argument for the function pointer is a const type. Update the drivers that use the gpio_device_find() function accordingly to fix the build. Bug 4471899 Change-Id: I562451a401bcaebcf0acf9a7d563cb0ea1d87807 Signed-off-by: Jon Hunter <jonathanh@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3104559 Reviewed-by: svc-sw-mobile-l4t <svc-sw-mobile-l4t@nvidia.com> Reviewed-by: Paritosh Dixit <paritoshd@nvidia.com> Reviewed-by: svcacv <svcacv@nvidia.com> GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
68e7840dd8
commit
037fa78728
@@ -33,7 +33,11 @@ static int of_cdi_gpio_pdata(struct platform_device *pdev,
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(NV_GPIO_DEVICE_FIND_HAS_CONST_DATA_ARG) /* Linux v6.9 */
|
||||||
|
static int cdi_gpio_chip_match(struct gpio_chip *chip, const void *data)
|
||||||
|
#else
|
||||||
static int cdi_gpio_chip_match(struct gpio_chip *chip, void *data)
|
static int cdi_gpio_chip_match(struct gpio_chip *chip, void *data)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
return !strcmp(chip->label, data);
|
return !strcmp(chip->label, data);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,11 @@ static int of_isc_gpio_pdata(struct platform_device *pdev,
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(NV_GPIO_DEVICE_FIND_HAS_CONST_DATA_ARG) /* Linux v6.9 */
|
||||||
|
static int isc_gpio_chip_match(struct gpio_chip *chip, const void *data)
|
||||||
|
#else
|
||||||
static int isc_gpio_chip_match(struct gpio_chip *chip, void *data)
|
static int isc_gpio_chip_match(struct gpio_chip *chip, void *data)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
return !strcmp(chip->label, data);
|
return !strcmp(chip->label, data);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7079,22 +7079,50 @@ compile_test() {
|
|||||||
|
|
||||||
gpio_device_find)
|
gpio_device_find)
|
||||||
#
|
#
|
||||||
# Determine if function gpio_device_find() present.
|
# Determine if function gpio_device_find() present and if it is
|
||||||
|
# present, then determine if the function pointer passed to this
|
||||||
|
# has a const data argument.
|
||||||
#
|
#
|
||||||
# The function gpio_device_find() was add by commit cfe102f63308
|
# The function gpio_device_find() was add by commit cfe102f63308
|
||||||
# ("gpiolib: provide gpio_device_find()") in Linux v6.7 replacing
|
# ("gpiolib: provide gpio_device_find()") in Linux v6.7 replacing
|
||||||
# the legacy and broken gpiochip_find(), which has since been
|
# the legacy and broken gpiochip_find(), which has since been
|
||||||
# removed.
|
# removed.
|
||||||
#
|
#
|
||||||
CODE="
|
# Commit faf6efd2e5e2 ("gpio: constify opaque pointer in
|
||||||
|
# gpio_device_find() match function") updated the data argument in
|
||||||
|
# the match function pointer to be const in Linux v6.9.
|
||||||
|
#
|
||||||
|
echo "$CONFTEST_PREAMBLE
|
||||||
#include <linux/gpio/driver.h>
|
#include <linux/gpio/driver.h>
|
||||||
void conftest_gpio_device_find(void)
|
void conftest_gpio_device_find(void)
|
||||||
{
|
{
|
||||||
gpio_device_find();
|
gpio_device_find();
|
||||||
}
|
}" > conftest$$.c
|
||||||
"
|
|
||||||
|
|
||||||
compile_check_conftest "$CODE" "NV_GPIO_DEVICE_FIND_PRESENT" "" "functions"
|
$CC $CFLAGS -c conftest$$.c > /dev/null 2>&1
|
||||||
|
rm -f conftest$$.c
|
||||||
|
|
||||||
|
if [ -f conftest$$.o ]; then
|
||||||
|
# gpio_find_device() is not present
|
||||||
|
echo "#undef NV_GPIO_DEVICE_FIND_PRESENT" | append_conftest "functions"
|
||||||
|
echo "#undef NV_GPIO_DEVICE_FIND_HAS_CONST_DATA_ARG" | append_conftest "types"
|
||||||
|
rm -f conftest$$.o
|
||||||
|
else
|
||||||
|
# gpio_find_device() is present and now check
|
||||||
|
# the type for the function pointer data argument
|
||||||
|
echo "#define NV_GPIO_DEVICE_FIND_PRESENT" | append_conftest "functions"
|
||||||
|
|
||||||
|
CODE="
|
||||||
|
#include <linux/gpio/driver.h>
|
||||||
|
void conftest_gpio_device_find(void *data,
|
||||||
|
int (*match)(struct gpio_chip *gc,
|
||||||
|
const void *data))
|
||||||
|
{
|
||||||
|
gpio_device_find(data, match);
|
||||||
|
}"
|
||||||
|
|
||||||
|
compile_check_conftest "$CODE" "NV_GPIO_DEVICE_FIND_HAS_CONST_DATA_ARG" "" "types"
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
netif_set_tso_max_size)
|
netif_set_tso_max_size)
|
||||||
|
|||||||
Reference in New Issue
Block a user