mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 04:31:50 +00:00
soc: hisilicon: kunpeng_hccs: Add the check for obtaining complete port attribute
The hccs_get_all_port_attr() is used to obtain the attribute of all the ports on a specified DIE from the firmware. However this interface doesn't ensure whether the firmware reports the complete attribute of all the ports or not. So this patch adds the check for this. Signed-off-by: Huisong Li <lihuisong@huawei.com> Signed-off-by: Wei Xu <xuwei5@hisilicon.com>
This commit is contained in:
parent
4cece76496
commit
192f97fe16
@ -556,6 +556,12 @@ static int hccs_get_all_port_attr(struct hccs_dev *hdev,
|
||||
start_id = rsp_head.next_id;
|
||||
}
|
||||
|
||||
if (left_buf_len != 0) {
|
||||
dev_err(hdev->dev, "failed to get the expected port number(%u) attribute.\n",
|
||||
size);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user