net: hns: delete redundancy ring enable operations
[deliverable/linux.git] / drivers / net / ethernet / hisilicon / hns / hnae.c
index 3bfe36f9405b60b4822185853ca3d3d35ea563a5..c54c6fac0d1de065cc891fe9103bba027c6f2df8 100644 (file)
@@ -96,16 +96,22 @@ 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;
+       if (dev_of_node(hdev->dev))
+               return (data == &hdev->dev->of_node->fwnode);
+       else if (is_acpi_node(hdev->dev->fwnode))
+               return (data == hdev->dev->fwnode);
+
+       dev_err(dev, "__ae_match cannot read cfg data from OF or acpi\n");
+       return 0;
 }
 
-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 +318,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 +327,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);
 
@@ -394,7 +400,6 @@ int hnae_ae_register(struct hnae_ae_dev *hdev, struct module *owner)
 
        if (!hdev->ops || !hdev->ops->get_handle ||
            !hdev->ops->toggle_ring_irq ||
-           !hdev->ops->toggle_queue_status ||
            !hdev->ops->get_status || !hdev->ops->adjust_link)
                return -EINVAL;
 
This page took 0.025659 seconds and 5 git commands to generate.