@@ -5047,7 +5047,7 @@ static int ibmvnic_reset_init(struct ibmvnic_adapter *adapter, bool reset)
return rc;
}
-static struct device_attribute dev_attr_failover;
+static const struct attribute_group *dev_attr_groups[];
static int ibmvnic_probe(struct vio_dev *dev, const struct vio_device_id *id)
{
@@ -5126,9 +5126,9 @@ static int ibmvnic_probe(struct vio_dev *dev, const struct vio_device_id *id)
netdev->min_mtu = adapter->min_mtu - ETH_HLEN;
netdev->max_mtu = adapter->max_mtu - ETH_HLEN;
- rc = device_create_file(&dev->dev, &dev_attr_failover);
+ rc = sysfs_create_groups(&dev->dev.kobj, dev_attr_groups);
if (rc)
- goto ibmvnic_dev_file_err;
+ goto ibmvnic_dev_groups_err;
netif_carrier_off(netdev);
rc = register_netdev(netdev);
@@ -5145,14 +5145,11 @@ static int ibmvnic_probe(struct vio_dev *dev, const struct vio_device_id *id)
return 0;
ibmvnic_register_fail:
- device_remove_file(&dev->dev, &dev_attr_failover);
-
-ibmvnic_dev_file_err:
+ sysfs_remove_groups(&dev->dev.kobj, dev_attr_groups);
+ibmvnic_dev_groups_err:
release_stats_token(adapter);
-
ibmvnic_stats_fail:
release_stats_buffers(adapter);
-
ibmvnic_init_fail:
release_sub_crqs(adapter, 1);
release_crq_queue(adapter);
@@ -5194,13 +5191,15 @@ static int ibmvnic_remove(struct vio_dev *dev)
rtnl_unlock();
mutex_destroy(&adapter->fw_lock);
- device_remove_file(&dev->dev, &dev_attr_failover);
+ sysfs_remove_groups(&dev->dev.kobj, dev_attr_groups);
free_netdev(netdev);
dev_set_drvdata(&dev->dev, NULL);
return 0;
}
+static struct device_attribute dev_attr_failover;
+
static ssize_t failover_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
@@ -5237,6 +5236,20 @@ static ssize_t failover_store(struct device *dev, struct device_attribute *attr,
static DEVICE_ATTR_WO(failover);
+static struct attribute *dev_attrs[] = {
+ &dev_attr_failover.attr,
+ NULL,
+};
+
+static struct attribute_group dev_attr_group = {
+ .attrs = dev_attrs,
+};
+
+static const struct attribute_group *dev_attr_groups[] = {
+ &dev_attr_group,
+ NULL,
+};
+
static unsigned long ibmvnic_get_desired_dma(struct vio_dev *vdev)
{
struct net_device *netdev = dev_get_drvdata(&vdev->dev);
Create a sysfs attribute group and make failover sysfs file a member. Signed-off-by: Thomas Falcon <tlfalcon@linux.ibm.com> --- drivers/net/ethernet/ibm/ibmvnic.c | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-)