phy: Fix possible NULL pointer deference
[oweals/u-boot.git] / drivers / gpio / 74x164_gpio.c
index 53a639ae65b14a992f6a181aecc775d14fb45f36..64717a6780e066d6ce5a3dfae9e7a40671142a76 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Take drivers/gpio/gpio-74x164.c as reference.
  *
@@ -5,8 +6,6 @@
  *
  * Copyright (C) 2016 Peng Fan <van.freenix@gmail.com>
  *
- * SPDX-License-Identifier:    GPL-2.0+
- *
  */
 
 #include <common.h>
@@ -16,6 +15,7 @@
 #include <malloc.h>
 #include <asm/gpio.h>
 #include <asm/io.h>
+#include <dm/device_compat.h>
 #include <dt-bindings/gpio/gpio.h>
 #include <spi.h>
 
@@ -106,7 +106,7 @@ static int gen_74x164_get_function(struct udevice *dev, unsigned offset)
 }
 
 static int gen_74x164_xlate(struct udevice *dev, struct gpio_desc *desc,
-                           struct fdtdec_phandle_args *args)
+                           struct ofnode_phandle_args *args)
 {
        desc->offset = args->args[0];
        desc->flags = args->args[1] & GPIO_ACTIVE_LOW ? GPIOD_ACTIVE_LOW : 0;