summaryrefslogtreecommitdiff
path: root/drivers/s390/net/qeth_core_sys.c
diff options
context:
space:
mode:
authorJulian Wiedmann <jwi@linux.ibm.com>2020-12-07 16:12:30 +0300
committerDavid S. Miller <davem@davemloft.net>2020-12-07 17:55:21 +0300
commit0b8da8110b4fa3314a060e5c5a3b35a22b81e900 (patch)
treee28ec8ac21d25086d6a33ee793ccc22a676d6165 /drivers/s390/net/qeth_core_sys.c
parent050663129a6d70a178a8545c31bc715bfb915355 (diff)
downloadlinux-0b8da8110b4fa3314a060e5c5a3b35a22b81e900.tar.xz
s390/qeth: use dev->groups for common sysfs attributes
All qeth devices have a minimum set of sysfs attributes, and non-OSN devices share a group of additional attributes. Depending on whether the device is forced to use a specific discipline, the device_type then specifies further attributes. Shift the common attributes into dev->groups, so that the device_type only contains the discipline-specific attributes. This avoids exposing the common attributes to the disciplines, and nicely cleans up our sysfs code. While replacing the qeth_l*_*_device_attributes() helpers, switch from sysfs_*_groups() to the more generic device_*_groups(). Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/s390/net/qeth_core_sys.c')
-rw-r--r--drivers/s390/net/qeth_core_sys.c41
1 files changed, 19 insertions, 22 deletions
diff --git a/drivers/s390/net/qeth_core_sys.c b/drivers/s390/net/qeth_core_sys.c
index 4441b3393eaf..a0f777f76f66 100644
--- a/drivers/s390/net/qeth_core_sys.c
+++ b/drivers/s390/net/qeth_core_sys.c
@@ -640,23 +640,17 @@ static struct attribute *qeth_blkt_device_attrs[] = {
&dev_attr_inter_jumbo.attr,
NULL,
};
-const struct attribute_group qeth_device_blkt_group = {
+
+static const struct attribute_group qeth_dev_blkt_group = {
.name = "blkt",
.attrs = qeth_blkt_device_attrs,
};
-EXPORT_SYMBOL_GPL(qeth_device_blkt_group);
-static struct attribute *qeth_device_attrs[] = {
- &dev_attr_state.attr,
- &dev_attr_chpid.attr,
- &dev_attr_if_name.attr,
- &dev_attr_card_type.attr,
+static struct attribute *qeth_dev_extended_attrs[] = {
&dev_attr_inbuf_size.attr,
&dev_attr_portno.attr,
&dev_attr_portname.attr,
&dev_attr_priority_queueing.attr,
- &dev_attr_buffer_count.attr,
- &dev_attr_recover.attr,
&dev_attr_performance_stats.attr,
&dev_attr_layer2.attr,
&dev_attr_isolation.attr,
@@ -664,18 +658,12 @@ static struct attribute *qeth_device_attrs[] = {
&dev_attr_switch_attrs.attr,
NULL,
};
-const struct attribute_group qeth_device_attr_group = {
- .attrs = qeth_device_attrs,
-};
-EXPORT_SYMBOL_GPL(qeth_device_attr_group);
-const struct attribute_group *qeth_generic_attr_groups[] = {
- &qeth_device_attr_group,
- &qeth_device_blkt_group,
- NULL,
+static const struct attribute_group qeth_dev_extended_group = {
+ .attrs = qeth_dev_extended_attrs,
};
-static struct attribute *qeth_osn_device_attrs[] = {
+static struct attribute *qeth_dev_attrs[] = {
&dev_attr_state.attr,
&dev_attr_chpid.attr,
&dev_attr_if_name.attr,
@@ -684,10 +672,19 @@ static struct attribute *qeth_osn_device_attrs[] = {
&dev_attr_recover.attr,
NULL,
};
-static struct attribute_group qeth_osn_device_attr_group = {
- .attrs = qeth_osn_device_attrs,
+
+static const struct attribute_group qeth_dev_group = {
+ .attrs = qeth_dev_attrs,
};
-const struct attribute_group *qeth_osn_attr_groups[] = {
- &qeth_osn_device_attr_group,
+
+const struct attribute_group *qeth_osn_dev_groups[] = {
+ &qeth_dev_group,
+ NULL,
+};
+
+const struct attribute_group *qeth_dev_groups[] = {
+ &qeth_dev_group,
+ &qeth_dev_extended_group,
+ &qeth_dev_blkt_group,
NULL,
};