mmc: ca_dw_mmc: Misc cleanup of driver
[oweals/u-boot.git] / drivers / phy / phy-uclass.c
index 1fded5ebf42f9d7856415a7aa4ac49cfc8bbf6bb..db7f39cd0b4598ad14aedb9bb6eebdd8c82c9d81 100644 (file)
@@ -8,6 +8,7 @@
 #include <dm.h>
 #include <dm/devres.h>
 #include <generic-phy.h>
+#include <log.h>
 
 static inline struct phy_ops *phy_dev_ops(struct udevice *dev)
 {
@@ -117,7 +118,7 @@ int generic_phy_init(struct phy *phy)
 {
        struct phy_ops const *ops;
 
-       if (!phy)
+       if (!generic_phy_valid(phy))
                return 0;
        ops = phy_dev_ops(phy->dev);
 
@@ -128,7 +129,7 @@ int generic_phy_reset(struct phy *phy)
 {
        struct phy_ops const *ops;
 
-       if (!phy)
+       if (!generic_phy_valid(phy))
                return 0;
        ops = phy_dev_ops(phy->dev);
 
@@ -139,7 +140,7 @@ int generic_phy_exit(struct phy *phy)
 {
        struct phy_ops const *ops;
 
-       if (!phy)
+       if (!generic_phy_valid(phy))
                return 0;
        ops = phy_dev_ops(phy->dev);
 
@@ -150,7 +151,7 @@ int generic_phy_power_on(struct phy *phy)
 {
        struct phy_ops const *ops;
 
-       if (!phy)
+       if (!generic_phy_valid(phy))
                return 0;
        ops = phy_dev_ops(phy->dev);
 
@@ -161,7 +162,7 @@ int generic_phy_power_off(struct phy *phy)
 {
        struct phy_ops const *ops;
 
-       if (!phy)
+       if (!generic_phy_valid(phy))
                return 0;
        ops = phy_dev_ops(phy->dev);