scsi: libsas: aic94xx: hisi_sas: mvsas: pm8001: Use dev_is_expander()
Many times in libsas, and in LLDDs which use libsas, the check for an expander device is re-implemented or open coded. Use dev_is_expander() instead. We rename this from sas_dev_type_is_expander() to not spill so many lines in referencing. Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Jason Yan <yanaijie@huawei.com> Reviewed-by: Jack Wang <jinpu.wang@cloud.ionos.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:

committed by
Martin K. Petersen

parent
895d8860a1
commit
924a3541ea
@@ -2356,7 +2356,7 @@ mpi_sata_completion(struct pm8001_hba_info *pm8001_ha, void *piomb)
|
||||
if ((status != IO_SUCCESS) && (status != IO_OVERFLOW) &&
|
||||
(status != IO_UNDERFLOW)) {
|
||||
if (!((t->dev->parent) &&
|
||||
(DEV_IS_EXPANDER(t->dev->parent->dev_type)))) {
|
||||
(dev_is_expander(t->dev->parent->dev_type)))) {
|
||||
for (i = 0 , j = 4; j <= 7 && i <= 3; i++ , j++)
|
||||
sata_addr_low[i] = pm8001_ha->sas_addr[j];
|
||||
for (i = 0 , j = 0; j <= 3 && i <= 3; i++ , j++)
|
||||
@@ -4560,7 +4560,7 @@ static int pm8001_chip_reg_dev_req(struct pm8001_hba_info *pm8001_ha,
|
||||
pm8001_dev->dev_type == SAS_FANOUT_EXPANDER_DEVICE)
|
||||
stp_sspsmp_sata = 0x01; /*ssp or smp*/
|
||||
}
|
||||
if (parent_dev && DEV_IS_EXPANDER(parent_dev->dev_type))
|
||||
if (parent_dev && dev_is_expander(parent_dev->dev_type))
|
||||
phy_id = parent_dev->ex_dev.ex_phy->phy_id;
|
||||
else
|
||||
phy_id = pm8001_dev->attached_phy;
|
||||
|
Reference in New Issue
Block a user