Skip to content

Commit

Permalink
scsi: ufs: Fix build warning without CONFIG_PM
Browse files Browse the repository at this point in the history
drivers/scsi/ufs/ufshcd.c:9770:12: warning: ‘ufshcd_rpmb_resume’ defined but not used [-Wunused-function]
 static int ufshcd_rpmb_resume(struct device *dev)
            ^~~~~~~~~~~~~~~~~~
drivers/scsi/ufs/ufshcd.c:9037:12: warning: ‘ufshcd_wl_runtime_resume’ defined but not used [-Wunused-function]
 static int ufshcd_wl_runtime_resume(struct device *dev)
            ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/ufs/ufshcd.c:9017:12: warning: ‘ufshcd_wl_runtime_suspend’ defined but not used [-Wunused-function]
 static int ufshcd_wl_runtime_suspend(struct device *dev)
            ^~~~~~~~~~~~~~~~~~~~~~~~~

Move it into #ifdef block to fix this.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: YueHaibing <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
  • Loading branch information
YueHaibing authored and pull[bot] committed Jul 12, 2021
1 parent a4e017d commit 3233067
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/scsi/ufs/ufshcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -8926,6 +8926,7 @@ static int __ufshcd_wl_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op)
return ret;
}

#ifdef CONFIG_PM
static int __ufshcd_wl_resume(struct ufs_hba *hba, enum ufs_pm_op pm_op)
{
int ret;
Expand Down Expand Up @@ -9052,6 +9053,7 @@ static int ufshcd_wl_runtime_resume(struct device *dev)

return ret;
}
#endif

#ifdef CONFIG_PM_SLEEP
static int ufshcd_wl_suspend(struct device *dev)
Expand Down Expand Up @@ -9766,6 +9768,7 @@ static inline int ufshcd_clear_rpmb_uac(struct ufs_hba *hba)
return ret;
}

#ifdef CONFIG_PM
static int ufshcd_rpmb_resume(struct device *dev)
{
struct ufs_hba *hba = wlun_dev_to_hba(dev);
Expand All @@ -9774,6 +9777,7 @@ static int ufshcd_rpmb_resume(struct device *dev)
ufshcd_clear_rpmb_uac(hba);
return 0;
}
#endif

static const struct dev_pm_ops ufs_rpmb_pm_ops = {
SET_RUNTIME_PM_OPS(NULL, ufshcd_rpmb_resume, NULL)
Expand Down

0 comments on commit 3233067

Please sign in to comment.