Commit 62ac8ccb authored by Bart Van Assche's avatar Bart Van Assche Committed by Martin K. Petersen
Browse files

scsi: hisi_sas: 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-21-bvanassche@acm.org


Acked-by: default avatarJohn Garry <john.garry@huawei.com>
Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent d6ddcd8b
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -1742,11 +1742,13 @@ static int hisi_sas_v1_init(struct hisi_hba *hisi_hba)
	return 0;
}

static struct device_attribute *host_attrs_v1_hw[] = {
	&dev_attr_phy_event_threshold,
static struct attribute *host_v1_hw_attrs[] = {
	&dev_attr_phy_event_threshold.attr,
	NULL
};

ATTRIBUTE_GROUPS(host_v1_hw);

static struct scsi_host_template sht_v1_hw = {
	.name			= DRV_NAME,
	.proc_name		= DRV_NAME,
@@ -1770,7 +1772,7 @@ static struct scsi_host_template sht_v1_hw = {
#ifdef CONFIG_COMPAT
	.compat_ioctl		= sas_ioctl,
#endif
	.shost_attrs		= host_attrs_v1_hw,
	.shost_groups		= host_v1_hw_groups,
	.host_reset             = hisi_sas_host_reset,
};

+5 −3
Original line number Diff line number Diff line
@@ -3531,11 +3531,13 @@ static void wait_cmds_complete_timeout_v2_hw(struct hisi_hba *hisi_hba,

}

static struct device_attribute *host_attrs_v2_hw[] = {
	&dev_attr_phy_event_threshold,
static struct attribute *host_v2_hw_attrs[] = {
	&dev_attr_phy_event_threshold.attr,
	NULL
};

ATTRIBUTE_GROUPS(host_v2_hw);

static int map_queues_v2_hw(struct Scsi_Host *shost)
{
	struct hisi_hba *hisi_hba = shost_priv(shost);
@@ -3579,7 +3581,7 @@ static struct scsi_host_template sht_v2_hw = {
#ifdef CONFIG_COMPAT
	.compat_ioctl		= sas_ioctl,
#endif
	.shost_attrs		= host_attrs_v2_hw,
	.shost_groups		= host_v2_hw_groups,
	.host_reset		= hisi_sas_host_reset,
	.map_queues		= map_queues_v2_hw,
	.host_tagset		= 1,
+8 −6
Original line number Diff line number Diff line
@@ -2766,14 +2766,16 @@ static int slave_configure_v3_hw(struct scsi_device *sdev)
	return 0;
}

static struct device_attribute *host_attrs_v3_hw[] = {
	&dev_attr_phy_event_threshold,
	&dev_attr_intr_conv_v3_hw,
	&dev_attr_intr_coal_ticks_v3_hw,
	&dev_attr_intr_coal_count_v3_hw,
static struct attribute *host_v3_hw_attrs[] = {
	&dev_attr_phy_event_threshold.attr,
	&dev_attr_intr_conv_v3_hw.attr,
	&dev_attr_intr_coal_ticks_v3_hw.attr,
	&dev_attr_intr_coal_count_v3_hw.attr,
	NULL
};

ATTRIBUTE_GROUPS(host_v3_hw);

#define HISI_SAS_DEBUGFS_REG(x) {#x, x}

struct hisi_sas_debugfs_reg_lu {
@@ -3158,7 +3160,7 @@ static struct scsi_host_template sht_v3_hw = {
#ifdef CONFIG_COMPAT
	.compat_ioctl		= sas_ioctl,
#endif
	.shost_attrs		= host_attrs_v3_hw,
	.shost_groups		= host_v3_hw_groups,
	.tag_alloc_policy	= BLK_TAG_ALLOC_RR,
	.host_reset             = hisi_sas_host_reset,
	.host_tagset		= 1,