linux/drivers/scsi/hisi_sas
Arnd Bergmann e01e2290f0 scsi: hisi_sas: Work around build failure in suspend function
The suspend/resume functions in this driver seem to have multiple problems,
the latest one just got introduced by a bugfix:

drivers/scsi/hisi_sas/hisi_sas_v3_hw.c: In function '_suspend_v3_hw':
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:5142:39: error: 'struct dev_pm_info' has no member named 'usage_count'
 5142 |         if (atomic_read(&device->power.usage_count)) {
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c: In function '_suspend_v3_hw':
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:5142:39: error: 'struct dev_pm_info' has no member named 'usage_count'
 5142 |         if (atomic_read(&device->power.usage_count)) {

As far as I can tell, the 'usage_count' is not meant to be accessed by
device drivers at all, though I don't know what the driver is supposed to
do instead.

Another problem is the use of the deprecated UNIVERSAL_DEV_PM_OPS(), and
marking functions as __maybe_unused to avoid warnings about unused
functions.  This should probably be changed to using
DEFINE_RUNTIME_DEV_PM_OPS().

Both changes require actually understanding what the driver needs to do,
and being able to test this, so instead here is the simplest patch to make
it pass the randconfig builds instead.

Fixes: e368d38cb9 ("scsi: hisi_sas: Exit suspend state when usage count is greater than 0")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20230405083611.3376739-1-arnd@kernel.org
Reviewed-by: Xiang Chen <chenxiang66@hisilicon.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2023-04-11 21:13:22 -04:00
..
hisi_sas_main.c scsi: hisi_sas: Ensure all enabled PHYs up during controller reset 2023-04-02 21:57:35 -04:00
hisi_sas_v1_hw.c Merge patch series "scsi: hisi_sas: Some misc changes" 2023-04-02 21:58:22 -04:00
hisi_sas_v2_hw.c Merge patch series "scsi: hisi_sas: Some misc changes" 2023-04-02 21:58:22 -04:00
hisi_sas_v3_hw.c scsi: hisi_sas: Work around build failure in suspend function 2023-04-11 21:13:22 -04:00
hisi_sas.h Merge patch series "scsi: hisi_sas: Some misc changes" 2023-04-02 21:58:22 -04:00
Kconfig scsi: hisi_sas: Enable debugfs support by default 2021-01-26 23:02:11 -05:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00