Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cef4e1ab authored by Xiang Chen's avatar Xiang Chen Committed by Martin K. Petersen
Browse files

scsi: hisi_sas: remove repeated device config in v2 hw



This patch removes some repeated configurations:

(1) The device id of the device is already set in the alloc function, so
    we don't need to modify in free device function.

(2) Field dev_type and dev_status are configured in hisi_sas_dev_gone(),
    so there is no need for repeated config in free_device_v3_hw.

Signed-off-by: default avatarXiang Chen <chenxiang66@hisilicon.com>
Signed-off-by: default avatarJohn Garry <john.garry@huawei.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 2b383351
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -716,7 +716,6 @@ static void hisi_sas_dev_gone(struct domain_device *device)
	struct hisi_sas_device *sas_dev = device->lldd_dev;
	struct hisi_hba *hisi_hba = dev_to_hisi_hba(device);
	struct device *dev = hisi_hba->dev;
	int dev_id = sas_dev->device_id;

	dev_info(dev, "found dev[%d:%x] is gone\n",
		 sas_dev->device_id, sas_dev->dev_type);
@@ -729,9 +728,7 @@ static void hisi_sas_dev_gone(struct domain_device *device)
	hisi_hba->hw->free_device(hisi_hba, sas_dev);
	device->lldd_dev = NULL;
	memset(sas_dev, 0, sizeof(*sas_dev));
	sas_dev->device_id = dev_id;
	sas_dev->dev_type = SAS_PHY_UNUSED;
	sas_dev->dev_status = HISI_SAS_DEV_NORMAL;
}

static int hisi_sas_queue_command(struct sas_task *task, gfp_t gfp_flags)
+0 −2
Original line number Diff line number Diff line
@@ -578,8 +578,6 @@ static void free_device_v3_hw(struct hisi_hba *hisi_hba,
		memset(itct, 0, sizeof(struct hisi_sas_itct));
		hisi_sas_write32(hisi_hba, ENT_INT_SRC3,
				 ENT_INT_SRC3_ITC_INT_MSK);
		hisi_hba->devices[dev_id].dev_type = SAS_PHY_UNUSED;
		hisi_hba->devices[dev_id].dev_status = HISI_SAS_DEV_NORMAL;

		/* clear the itct */
		hisi_sas_write32(hisi_hba, ITCT_CLR, 0);