scsi: ufs: Constify the third pwr_change_notify() argument
The third pwr_change_notify() argument is an input parameter. Make this explicit by declaring it 'const'. Signed-off-by: Bart Van Assche <bvanassche@acm.org> Link: https://lore.kernel.org/r/20250212213838.1044917-1-bvanassche@acm.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
0ea163a18b
commit
3bcd901e42
|
@ -159,9 +159,9 @@ static inline int ufshcd_vops_link_startup_notify(struct ufs_hba *hba,
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int ufshcd_vops_pwr_change_notify(struct ufs_hba *hba,
|
static inline int ufshcd_vops_pwr_change_notify(struct ufs_hba *hba,
|
||||||
enum ufs_notify_change_status status,
|
enum ufs_notify_change_status status,
|
||||||
struct ufs_pa_layer_attr *dev_max_params,
|
const struct ufs_pa_layer_attr *dev_max_params,
|
||||||
struct ufs_pa_layer_attr *dev_req_params)
|
struct ufs_pa_layer_attr *dev_req_params)
|
||||||
{
|
{
|
||||||
if (hba->vops && hba->vops->pwr_change_notify)
|
if (hba->vops && hba->vops->pwr_change_notify)
|
||||||
return hba->vops->pwr_change_notify(hba, status,
|
return hba->vops->pwr_change_notify(hba, status,
|
||||||
|
|
|
@ -321,7 +321,7 @@ static int exynosauto_ufs_pre_pwr_change(struct exynos_ufs *ufs,
|
||||||
}
|
}
|
||||||
|
|
||||||
static int exynosauto_ufs_post_pwr_change(struct exynos_ufs *ufs,
|
static int exynosauto_ufs_post_pwr_change(struct exynos_ufs *ufs,
|
||||||
struct ufs_pa_layer_attr *pwr)
|
const struct ufs_pa_layer_attr *pwr)
|
||||||
{
|
{
|
||||||
struct ufs_hba *hba = ufs->hba;
|
struct ufs_hba *hba = ufs->hba;
|
||||||
u32 enabled_vh;
|
u32 enabled_vh;
|
||||||
|
@ -396,7 +396,7 @@ static int exynos7_ufs_pre_pwr_change(struct exynos_ufs *ufs,
|
||||||
}
|
}
|
||||||
|
|
||||||
static int exynos7_ufs_post_pwr_change(struct exynos_ufs *ufs,
|
static int exynos7_ufs_post_pwr_change(struct exynos_ufs *ufs,
|
||||||
struct ufs_pa_layer_attr *pwr)
|
const struct ufs_pa_layer_attr *pwr)
|
||||||
{
|
{
|
||||||
struct ufs_hba *hba = ufs->hba;
|
struct ufs_hba *hba = ufs->hba;
|
||||||
int lanes = max_t(u32, pwr->lane_rx, pwr->lane_tx);
|
int lanes = max_t(u32, pwr->lane_rx, pwr->lane_tx);
|
||||||
|
@ -813,7 +813,7 @@ static u32 exynos_ufs_get_hs_gear(struct ufs_hba *hba)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int exynos_ufs_pre_pwr_mode(struct ufs_hba *hba,
|
static int exynos_ufs_pre_pwr_mode(struct ufs_hba *hba,
|
||||||
struct ufs_pa_layer_attr *dev_max_params,
|
const struct ufs_pa_layer_attr *dev_max_params,
|
||||||
struct ufs_pa_layer_attr *dev_req_params)
|
struct ufs_pa_layer_attr *dev_req_params)
|
||||||
{
|
{
|
||||||
struct exynos_ufs *ufs = ufshcd_get_variant(hba);
|
struct exynos_ufs *ufs = ufshcd_get_variant(hba);
|
||||||
|
@ -865,7 +865,7 @@ out:
|
||||||
|
|
||||||
#define PWR_MODE_STR_LEN 64
|
#define PWR_MODE_STR_LEN 64
|
||||||
static int exynos_ufs_post_pwr_mode(struct ufs_hba *hba,
|
static int exynos_ufs_post_pwr_mode(struct ufs_hba *hba,
|
||||||
struct ufs_pa_layer_attr *pwr_req)
|
const struct ufs_pa_layer_attr *pwr_req)
|
||||||
{
|
{
|
||||||
struct exynos_ufs *ufs = ufshcd_get_variant(hba);
|
struct exynos_ufs *ufs = ufshcd_get_variant(hba);
|
||||||
struct phy *generic_phy = ufs->phy;
|
struct phy *generic_phy = ufs->phy;
|
||||||
|
@ -1634,7 +1634,7 @@ static int exynos_ufs_link_startup_notify(struct ufs_hba *hba,
|
||||||
|
|
||||||
static int exynos_ufs_pwr_change_notify(struct ufs_hba *hba,
|
static int exynos_ufs_pwr_change_notify(struct ufs_hba *hba,
|
||||||
enum ufs_notify_change_status status,
|
enum ufs_notify_change_status status,
|
||||||
struct ufs_pa_layer_attr *dev_max_params,
|
const struct ufs_pa_layer_attr *dev_max_params,
|
||||||
struct ufs_pa_layer_attr *dev_req_params)
|
struct ufs_pa_layer_attr *dev_req_params)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
|
@ -188,7 +188,7 @@ struct exynos_ufs_drv_data {
|
||||||
int (*pre_pwr_change)(struct exynos_ufs *ufs,
|
int (*pre_pwr_change)(struct exynos_ufs *ufs,
|
||||||
struct ufs_pa_layer_attr *pwr);
|
struct ufs_pa_layer_attr *pwr);
|
||||||
int (*post_pwr_change)(struct exynos_ufs *ufs,
|
int (*post_pwr_change)(struct exynos_ufs *ufs,
|
||||||
struct ufs_pa_layer_attr *pwr);
|
const struct ufs_pa_layer_attr *pwr);
|
||||||
int (*pre_hce_enable)(struct exynos_ufs *ufs);
|
int (*pre_hce_enable)(struct exynos_ufs *ufs);
|
||||||
int (*post_hce_enable)(struct exynos_ufs *ufs);
|
int (*post_hce_enable)(struct exynos_ufs *ufs);
|
||||||
};
|
};
|
||||||
|
|
|
@ -361,9 +361,9 @@ static void ufs_hisi_pwr_change_pre_change(struct ufs_hba *hba)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ufs_hisi_pwr_change_notify(struct ufs_hba *hba,
|
static int ufs_hisi_pwr_change_notify(struct ufs_hba *hba,
|
||||||
enum ufs_notify_change_status status,
|
enum ufs_notify_change_status status,
|
||||||
struct ufs_pa_layer_attr *dev_max_params,
|
const struct ufs_pa_layer_attr *dev_max_params,
|
||||||
struct ufs_pa_layer_attr *dev_req_params)
|
struct ufs_pa_layer_attr *dev_req_params)
|
||||||
{
|
{
|
||||||
struct ufs_host_params host_params;
|
struct ufs_host_params host_params;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
|
@ -1081,8 +1081,8 @@ static bool ufs_mtk_pmc_via_fastauto(struct ufs_hba *hba,
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ufs_mtk_pre_pwr_change(struct ufs_hba *hba,
|
static int ufs_mtk_pre_pwr_change(struct ufs_hba *hba,
|
||||||
struct ufs_pa_layer_attr *dev_max_params,
|
const struct ufs_pa_layer_attr *dev_max_params,
|
||||||
struct ufs_pa_layer_attr *dev_req_params)
|
struct ufs_pa_layer_attr *dev_req_params)
|
||||||
{
|
{
|
||||||
struct ufs_mtk_host *host = ufshcd_get_variant(hba);
|
struct ufs_mtk_host *host = ufshcd_get_variant(hba);
|
||||||
struct ufs_host_params host_params;
|
struct ufs_host_params host_params;
|
||||||
|
@ -1134,9 +1134,9 @@ static int ufs_mtk_pre_pwr_change(struct ufs_hba *hba,
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ufs_mtk_pwr_change_notify(struct ufs_hba *hba,
|
static int ufs_mtk_pwr_change_notify(struct ufs_hba *hba,
|
||||||
enum ufs_notify_change_status stage,
|
enum ufs_notify_change_status stage,
|
||||||
struct ufs_pa_layer_attr *dev_max_params,
|
const struct ufs_pa_layer_attr *dev_max_params,
|
||||||
struct ufs_pa_layer_attr *dev_req_params)
|
struct ufs_pa_layer_attr *dev_req_params)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
|
|
|
@ -807,7 +807,7 @@ static int ufs_qcom_icc_update_bw(struct ufs_qcom_host *host)
|
||||||
|
|
||||||
static int ufs_qcom_pwr_change_notify(struct ufs_hba *hba,
|
static int ufs_qcom_pwr_change_notify(struct ufs_hba *hba,
|
||||||
enum ufs_notify_change_status status,
|
enum ufs_notify_change_status status,
|
||||||
struct ufs_pa_layer_attr *dev_max_params,
|
const struct ufs_pa_layer_attr *dev_max_params,
|
||||||
struct ufs_pa_layer_attr *dev_req_params)
|
struct ufs_pa_layer_attr *dev_req_params)
|
||||||
{
|
{
|
||||||
struct ufs_qcom_host *host = ufshcd_get_variant(hba);
|
struct ufs_qcom_host *host = ufshcd_get_variant(hba);
|
||||||
|
|
|
@ -160,9 +160,9 @@ static int ufs_sprd_common_init(struct ufs_hba *hba)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int sprd_ufs_pwr_change_notify(struct ufs_hba *hba,
|
static int sprd_ufs_pwr_change_notify(struct ufs_hba *hba,
|
||||||
enum ufs_notify_change_status status,
|
enum ufs_notify_change_status status,
|
||||||
struct ufs_pa_layer_attr *dev_max_params,
|
const struct ufs_pa_layer_attr *dev_max_params,
|
||||||
struct ufs_pa_layer_attr *dev_req_params)
|
struct ufs_pa_layer_attr *dev_req_params)
|
||||||
{
|
{
|
||||||
struct ufs_sprd_host *host = ufshcd_get_variant(hba);
|
struct ufs_sprd_host *host = ufshcd_get_variant(hba);
|
||||||
|
|
||||||
|
|
|
@ -157,7 +157,7 @@ static int ufs_intel_set_lanes(struct ufs_hba *hba, u32 lanes)
|
||||||
|
|
||||||
static int ufs_intel_lkf_pwr_change_notify(struct ufs_hba *hba,
|
static int ufs_intel_lkf_pwr_change_notify(struct ufs_hba *hba,
|
||||||
enum ufs_notify_change_status status,
|
enum ufs_notify_change_status status,
|
||||||
struct ufs_pa_layer_attr *dev_max_params,
|
const struct ufs_pa_layer_attr *dev_max_params,
|
||||||
struct ufs_pa_layer_attr *dev_req_params)
|
struct ufs_pa_layer_attr *dev_req_params)
|
||||||
{
|
{
|
||||||
int err = 0;
|
int err = 0;
|
||||||
|
|
|
@ -353,9 +353,9 @@ struct ufs_hba_variant_ops {
|
||||||
int (*link_startup_notify)(struct ufs_hba *,
|
int (*link_startup_notify)(struct ufs_hba *,
|
||||||
enum ufs_notify_change_status);
|
enum ufs_notify_change_status);
|
||||||
int (*pwr_change_notify)(struct ufs_hba *,
|
int (*pwr_change_notify)(struct ufs_hba *,
|
||||||
enum ufs_notify_change_status status,
|
enum ufs_notify_change_status status,
|
||||||
struct ufs_pa_layer_attr *desired_pwr_mode,
|
const struct ufs_pa_layer_attr *desired_pwr_mode,
|
||||||
struct ufs_pa_layer_attr *final_params);
|
struct ufs_pa_layer_attr *final_params);
|
||||||
void (*setup_xfer_req)(struct ufs_hba *hba, int tag,
|
void (*setup_xfer_req)(struct ufs_hba *hba, int tag,
|
||||||
bool is_scsi_cmd);
|
bool is_scsi_cmd);
|
||||||
void (*setup_task_mgmt)(struct ufs_hba *, int, u8);
|
void (*setup_task_mgmt)(struct ufs_hba *, int, u8);
|
||||||
|
@ -1429,7 +1429,7 @@ static inline int ufshcd_dme_peer_get(struct ufs_hba *hba,
|
||||||
return ufshcd_dme_get_attr(hba, attr_sel, mib_val, DME_PEER);
|
return ufshcd_dme_get_attr(hba, attr_sel, mib_val, DME_PEER);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool ufshcd_is_hs_mode(struct ufs_pa_layer_attr *pwr_info)
|
static inline bool ufshcd_is_hs_mode(const struct ufs_pa_layer_attr *pwr_info)
|
||||||
{
|
{
|
||||||
return (pwr_info->pwr_rx == FAST_MODE ||
|
return (pwr_info->pwr_rx == FAST_MODE ||
|
||||||
pwr_info->pwr_rx == FASTAUTO_MODE) &&
|
pwr_info->pwr_rx == FASTAUTO_MODE) &&
|
||||||
|
|
Loading…
Reference in New Issue