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:
John Garry
2019-06-10 20:41:41 +08:00
committed by Martin K. Petersen
parent 895d8860a1
commit 924a3541ea
19 changed files with 35 additions and 61 deletions

View File

@@ -207,8 +207,7 @@ struct sas_work {
struct work_struct work;
};
/* Lots of code duplicates this in the SCSI tree, which can be factored out */
static inline bool sas_dev_type_is_expander(enum sas_device_type type)
static inline bool dev_is_expander(enum sas_device_type type)
{
return type == SAS_EDGE_EXPANDER_DEVICE ||
type == SAS_FANOUT_EXPANDER_DEVICE;