net: hns: enet specify a reference to dsaf by fwnode_handle
[cascardo/linux.git] / drivers / net / ethernet / hisilicon / hns / hnae.c
index 3bfe36f..d630acd 100644 (file)
@@ -96,16 +96,16 @@ static int __ae_match(struct device *dev, const void *data)
 {
        struct hnae_ae_dev *hdev = cls_to_ae_dev(dev);
 
-       return hdev->dev->of_node == data;
+       return (data == &hdev->dev->of_node->fwnode);
 }
 
-static struct hnae_ae_dev *find_ae(const struct device_node *ae_node)
+static struct hnae_ae_dev *find_ae(const struct fwnode_handle *fwnode)
 {
        struct device *dev;
 
-       WARN_ON(!ae_node);
+       WARN_ON(!fwnode);
 
-       dev = class_find_device(hnae_class, NULL, ae_node, __ae_match);
+       dev = class_find_device(hnae_class, NULL, fwnode, __ae_match);
 
        return dev ? cls_to_ae_dev(dev) : NULL;
 }
@@ -312,7 +312,7 @@ EXPORT_SYMBOL(hnae_reinit_handle);
  * return handle ptr or ERR_PTR
  */
 struct hnae_handle *hnae_get_handle(struct device *owner_dev,
-                                   const struct device_node *ae_node,
+                                   const struct fwnode_handle  *fwnode,
                                    u32 port_id,
                                    struct hnae_buf_ops *bops)
 {
@@ -321,7 +321,7 @@ struct hnae_handle *hnae_get_handle(struct device *owner_dev,
        int i, j;
        int ret;
 
-       dev = find_ae(ae_node);
+       dev = find_ae(fwnode);
        if (!dev)
                return ERR_PTR(-ENODEV);