summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/hisilicon/hns/hnae.c
diff options
context:
space:
mode:
authorKejian Yan <yankejian@huawei.com>2016-06-03 10:55:15 +0800
committerDavid S. Miller <davem@davemloft.net>2016-06-04 21:32:40 -0400
commit7b2acae6fb28f0b3d32c0620f8045c4a1bf5bb92 (patch)
treeb33e0ba44dc01c59be9a29100c8ece32e9d9c317 /drivers/net/ethernet/hisilicon/hns/hnae.c
parent72fdddcefe603b9b7de3f1d6177dd413eceacb93 (diff)
net: hns: enet specify a reference to dsaf by fwnode_handle
As device_node is only used by DT case, it is expected to find uniform ways. So fwnode_handle is the suitable method. Signed-off-by: Kejian Yan <yankejian@huawei.com> Signed-off-by: Yisen Zhuang <Yisen.Zhuang@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/hisilicon/hns/hnae.c')
-rw-r--r--drivers/net/ethernet/hisilicon/hns/hnae.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns/hnae.c b/drivers/net/ethernet/hisilicon/hns/hnae.c
index 3bfe36f9405b..d630acdb0749 100644
--- a/drivers/net/ethernet/hisilicon/hns/hnae.c
+++ b/drivers/net/ethernet/hisilicon/hns/hnae.c
@@ -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);