Commit 0211b8fb authored by Yisen.Zhuang\(Zhuangyuzeng\)'s avatar Yisen.Zhuang\(Zhuangyuzeng\) Committed by David S. Miller

net: hns: change port-id property to reg property in dsaf port node

Indexes should generally be avoided. So we use reg rather than port-id to
index ports.
Signed-off-by: default avatarYisen Zhuang <yisen.zhuang@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1ffdfac9
...@@ -834,15 +834,15 @@ int hns_mac_init(struct dsaf_device *dsaf_dev) ...@@ -834,15 +834,15 @@ int hns_mac_init(struct dsaf_device *dsaf_dev)
struct fwnode_handle *child; struct fwnode_handle *child;
device_for_each_child_node(dsaf_dev->dev, child) { device_for_each_child_node(dsaf_dev->dev, child) {
ret = fwnode_property_read_u32(child, "port-id", &port_id); ret = fwnode_property_read_u32(child, "reg", &port_id);
if (ret) { if (ret) {
dev_err(dsaf_dev->dev, dev_err(dsaf_dev->dev,
"get port-id fail, ret=%d!\n", ret); "get reg fail, ret=%d!\n", ret);
return ret; return ret;
} }
if (port_id >= max_port_num) { if (port_id >= max_port_num) {
dev_err(dsaf_dev->dev, dev_err(dsaf_dev->dev,
"port-id(%u) out of range!\n", port_id); "reg(%u) out of range!\n", port_id);
return -EINVAL; return -EINVAL;
} }
mac_cb = devm_kzalloc(dsaf_dev->dev, sizeof(*mac_cb), mac_cb = devm_kzalloc(dsaf_dev->dev, sizeof(*mac_cb),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment