mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 09:11:26 +03:00
media: camera: Update conftest for gpio_device_find
When adding conftest tests for detecting if specific functions are present, it is always better to check if the newly added function is present versus the function that has been removed. The reason being that is the newly added function is modified in the future then the conftest tests can be extended to check for updates to the function. Therefore, instead of checking if the function gpiochip_find() is present, which was removed in Linux v6.7, check if the function gpio_device_find() is present, which replaced gpiochip_find in Linux v6.7. Bug 4346767 Bug 4471899 Change-Id: I32bf1c3da32abbf3c8d3ef9ea350decf1564e0bc Signed-off-by: Jon Hunter <jonathanh@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3108643 Reviewed-by: Paritosh Dixit <paritoshd@nvidia.com> GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
a3466295e1
commit
68e7840dd8
@@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
// Copyright (c) 2017-2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
// SPDX-FileCopyrightText: Copyright (c) 2017-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
|
||||
#include <nvidia/conftest.h>
|
||||
|
||||
@@ -43,7 +43,7 @@ static struct gpio_chip *isc_gpio_get_chip(struct platform_device *pdev,
|
||||
{
|
||||
struct gpio_chip *gc = NULL;
|
||||
char name[MAX_STR_SIZE];
|
||||
#if !defined(NV_GPIOCHIP_FIND_PRESENT) /* Linux 6.7 */
|
||||
#if defined(NV_GPIO_DEVICE_FIND_PRESENT) /* Linux 6.7 */
|
||||
struct gpio_device *gdev;
|
||||
#endif
|
||||
|
||||
@@ -54,14 +54,14 @@ static struct gpio_chip *isc_gpio_get_chip(struct platform_device *pdev,
|
||||
}
|
||||
strcpy(name, pd->gpio_prnt_chip);
|
||||
|
||||
#if defined(NV_GPIOCHIP_FIND_PRESENT) /* Linux 6.7 */
|
||||
gc = gpiochip_find(name, isc_gpio_chip_match);
|
||||
#else
|
||||
#if defined(NV_GPIO_DEVICE_FIND_PRESENT) /* Linux 6.7 */
|
||||
gdev = gpio_device_find(name, isc_gpio_chip_match);
|
||||
if (gdev) {
|
||||
gc = gpio_device_get_chip(gdev);
|
||||
gpio_device_put(gdev);
|
||||
}
|
||||
#else
|
||||
gc = gpiochip_find(name, isc_gpio_chip_match);
|
||||
#endif
|
||||
if (!gc) {
|
||||
dev_err(&pdev->dev, "%s: unable to find gpio parent chip %s\n",
|
||||
|
||||
Reference in New Issue
Block a user