projects
/
deliverable
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net: hns: delete redundancy ring enable operations
[deliverable/linux.git]
/
drivers
/
net
/
ethernet
/
hisilicon
/
hns
/
hnae.c
diff --git
a/drivers/net/ethernet/hisilicon/hns/hnae.c
b/drivers/net/ethernet/hisilicon/hns/hnae.c
index 3bfe36f9405b60b4822185853ca3d3d35ea563a5..c54c6fac0d1de065cc891fe9103bba027c6f2df8 100644
(file)
--- a/
drivers/net/ethernet/hisilicon/hns/hnae.c
+++ b/
drivers/net/ethernet/hisilicon/hns/hnae.c
@@
-96,16
+96,22
@@
static int __ae_match(struct device *dev, const void *data)
{
struct hnae_ae_dev *hdev = cls_to_ae_dev(dev);
{
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 *fw
node)
{
struct device *dev;
{
struct device *dev;
- WARN_ON(!
ae_
node);
+ WARN_ON(!
fw
node);
- dev = class_find_device(hnae_class, NULL,
ae_
node, __ae_match);
+ dev = class_find_device(hnae_class, NULL,
fw
node, __ae_match);
return dev ? cls_to_ae_dev(dev) : NULL;
}
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,
* 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 *fw
node,
u32 port_id,
struct hnae_buf_ops *bops)
{
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;
int i, j;
int ret;
- dev = find_ae(
ae_
node);
+ dev = find_ae(
fw
node);
if (!dev)
return ERR_PTR(-ENODEV);
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 ||
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;
!hdev->ops->get_status || !hdev->ops->adjust_link)
return -EINVAL;
This page took
0.027625 seconds
and
5
git commands to generate.