Commit 582c0360 authored by Bart Van Assche's avatar Bart Van Assche Committed by Martin K. Petersen

scsi: myrb: Switch to attribute groups

struct device supports attribute groups directly but does not support
struct device_attribute directly. Hence switch to attribute groups.

Link: https://lore.kernel.org/r/20211012233558.4066756-32-bvanassche@acm.orgSigned-off-by: default avatarBart Van Assche <bvanassche@acm.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 88b8132c
...@@ -2182,22 +2182,26 @@ static ssize_t flush_cache_store(struct device *dev, ...@@ -2182,22 +2182,26 @@ static ssize_t flush_cache_store(struct device *dev,
} }
static DEVICE_ATTR_WO(flush_cache); static DEVICE_ATTR_WO(flush_cache);
static struct device_attribute *myrb_sdev_attrs[] = { static struct attribute *myrb_sdev_attrs[] = {
&dev_attr_rebuild, &dev_attr_rebuild.attr,
&dev_attr_consistency_check, &dev_attr_consistency_check.attr,
&dev_attr_raid_state, &dev_attr_raid_state.attr,
&dev_attr_raid_level, &dev_attr_raid_level.attr,
NULL, NULL,
}; };
static struct device_attribute *myrb_shost_attrs[] = { ATTRIBUTE_GROUPS(myrb_sdev);
&dev_attr_ctlr_num,
&dev_attr_model, static struct attribute *myrb_shost_attrs[] = {
&dev_attr_firmware, &dev_attr_ctlr_num.attr,
&dev_attr_flush_cache, &dev_attr_model.attr,
&dev_attr_firmware.attr,
&dev_attr_flush_cache.attr,
NULL, NULL,
}; };
ATTRIBUTE_GROUPS(myrb_shost);
static struct scsi_host_template myrb_template = { static struct scsi_host_template myrb_template = {
.module = THIS_MODULE, .module = THIS_MODULE,
.name = "DAC960", .name = "DAC960",
...@@ -2209,8 +2213,8 @@ static struct scsi_host_template myrb_template = { ...@@ -2209,8 +2213,8 @@ static struct scsi_host_template myrb_template = {
.slave_destroy = myrb_slave_destroy, .slave_destroy = myrb_slave_destroy,
.bios_param = myrb_biosparam, .bios_param = myrb_biosparam,
.cmd_size = sizeof(struct myrb_cmdblk), .cmd_size = sizeof(struct myrb_cmdblk),
.shost_attrs = myrb_shost_attrs, .shost_groups = myrb_shost_groups,
.sdev_attrs = myrb_sdev_attrs, .sdev_groups = myrb_sdev_groups,
.this_id = -1, .this_id = -1,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment