Commit a8db9c44 authored by Huisong Li's avatar Huisong Li Committed by Dengdui Huang
Browse files

soc: hisilicon: kunpeng_hccs: Fix the 'lane_mode' field name in port info...

soc: hisilicon: kunpeng_hccs: Fix the 'lane_mode' field name in port info structure to 'max_lane_num'

mainline inclusion
from mainline-v6.13-rc1
commit b51878373a81bda3a790fd936507fd0643ef98b3
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IB75RW
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b51878373a81bda3a790fd936507fd0643ef98b3



--------------------------------

The lane mode of HCCS port is an information to user, and actually comes
from the maximum lane number. But it is good and easy for driver to use
the maximum lane number. So fix the 'lane_mode' field name in port info
structure to 'max_lane_num'.

Signed-off-by: default avatarHuisong Li <lihuisong@huawei.com>
Reviewed-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: default avatarWei Xu <xuwei5@hisilicon.com>
Signed-off-by: default avatarDengdui Huang <huangdengdui@huawei.com>
parent 23cff2fc
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -588,7 +588,7 @@ static int hccs_get_all_port_info_on_die(struct hccs_dev *hdev,
		port = &die->ports[i];
		port->port_id = attrs[i].port_id;
		port->port_type = attrs[i].port_type;
		port->lane_mode = attrs[i].lane_mode;
		port->max_lane_num = attrs[i].max_lane_num;
		port->enable = attrs[i].enable;
		port->die = die;
	}
@@ -833,7 +833,7 @@ static ssize_t lane_mode_show(struct kobject *kobj, struct kobj_attribute *attr,
{
	const struct hccs_port_info *port = kobj_to_port_info(kobj);

	return sysfs_emit(buf, "x%u\n", port->lane_mode);
	return sysfs_emit(buf, "x%u\n", port->max_lane_num);
}
static struct kobj_attribute lane_mode_attr = __ATTR_RO(lane_mode);

+2 −2
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@
struct hccs_port_info {
	u8 port_id;
	u8 port_type;
	u8 lane_mode;
	u8 max_lane_num;
	bool enable; /* if the port is enabled */
	struct kobject kobj;
	bool dir_created;
@@ -113,7 +113,7 @@ struct hccs_die_info_rsp_data {
struct hccs_port_attr {
	u8 port_id;
	u8 port_type;
	u8 lane_mode;
	u8 max_lane_num;
	u8 enable : 1; /* if the port is enabled */
	u16 rsv[2];
};