common: Move sorting functions to their own header file
[oweals/u-boot.git] / include / generic-phy.h
index eac5adc893395e1837008c0166ddec5729c424d6..95caf583413ce303c17662911060b7e7355feba1 100644 (file)
@@ -1,13 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com/
  * Written by Jean-Jacques Hiblot  <jjhiblot@ti.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #ifndef __GENERIC_PHY_H
 #define __GENERIC_PHY_H
 
+struct ofnode_phandle_args;
 
 /**
  * struct phy - A handle to (allowing control of) a single phy port.
@@ -270,7 +270,7 @@ static inline int generic_phy_get_by_name(struct udevice *user, const char *phy_
  */
 static inline bool generic_phy_valid(struct phy *phy)
 {
-       return phy->dev != NULL;
+       return phy && phy->dev;
 }
 
 #endif /*__GENERIC_PHY_H */