sf: Query write-protection status before operating the flash
[platform/kernel/u-boot.git] / net / dsa-uclass.c
index 9ff55a0..3bf4351 100644 (file)
@@ -477,8 +477,10 @@ static int dsa_pre_probe(struct udevice *dev)
                return -ENODEV;
        }
 
-       uclass_find_device_by_ofnode(UCLASS_ETH, pdata->master_node,
-                                    &priv->master_dev);
+       err = uclass_get_device_by_ofnode(UCLASS_ETH, pdata->master_node,
+                                         &priv->master_dev);
+       if (err)
+               return err;
 
        /* Simulate a probing event for the CPU port */
        if (ops->port_probe) {