nvpps: Always use of_get_named_gpio

The function of_get_named_gpio() was first added for Linux v3.1 and is
still supported for in the latest mainline kernel. Therefore, always use
of_get_named_gpio() and avoid the unnecessary kernel version check.

Bug 4119327

Change-Id: I95e2458fdf00404bf91aa3e31e33dd2911377f48
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2979476
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Jon Hunter
2023-09-12 23:14:03 +01:00
committed by mobile promotions
parent f8f33d49cc
commit 00e11cac47

View File

@@ -12,7 +12,6 @@
*
*/
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/interrupt.h>
@@ -975,11 +974,7 @@ static int nvpps_probe(struct platform_device *pdev)
return -ENOMEM;
}
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0)
err = of_get_gpio(np, 0);
#else
err = of_get_named_gpio(np, "gpios", 0);
#endif
if (err == -EPROBE_DEFER) {
return err;
} else if (err < 0) {