From: Valentine Fatiev <valentinef@nvidia.com>
Subject: [PATCH] BACKPORT: drivers/net/ethernet/mellanox/mlx5/core/ecpf.c

Change-Id: I3337e98de3ea94a2e6096cc494713a63a018c110
---
 drivers/net/ethernet/mellanox/mlx5/core/ecpf.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

--- a/drivers/net/ethernet/mellanox/mlx5/core/ecpf.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/ecpf.c
@@ -517,6 +517,9 @@ static struct attribute *smart_nic_attrs
 	&attr_regex_en.attr,
 	NULL,
 };
+#ifdef HAVE_KOBJ_TYPE_DEFAULT_GROUPS
+ATTRIBUTE_GROUPS(smart_nic);
+#endif
 
 static const struct sysfs_ops smart_nic_sysfs_ops = {
 	.show   = smart_nic_attr_show,
@@ -525,7 +528,11 @@ static const struct sysfs_ops smart_nic_
 
 static struct kobj_type smart_nic_type = {
 	.sysfs_ops     = &smart_nic_sysfs_ops,
+#ifdef HAVE_KOBJ_TYPE_DEFAULT_GROUPS
+	.default_groups = smart_nic_groups
+#else
 	.default_attrs = smart_nic_attrs
+#endif
 };
 
 void mlx5_smartnic_sysfs_init(struct net_device *dev)
@@ -651,6 +658,9 @@ static struct attribute *regex_attrs[] =
 	&attr_regex.attr,
 	NULL,
 };
+#ifdef HAVE_KOBJ_TYPE_DEFAULT_GROUPS
+ATTRIBUTE_GROUPS(regex);
+#endif
 
 static ssize_t regex_attr_show(struct kobject *kobj,
 			       struct attribute *attr, char *buf)
@@ -672,7 +682,11 @@ static const struct sysfs_ops regex_sysf
 
 static struct kobj_type regex_type = {
 	.sysfs_ops     = &regex_sysfs_ops,
+#ifdef HAVE_KOBJ_TYPE_DEFAULT_GROUPS
+	.default_groups = regex_groups
+#else
 	.default_attrs = regex_attrs
+#endif
 };
 
 int mlx5_regex_sysfs_init(struct mlx5_core_dev *dev)
