Skip to content

Commit

Permalink
scsi: ufs: Make the config_scaling_param calls type safe
Browse files Browse the repository at this point in the history
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
  • Loading branch information
bvanassche committed Mar 21, 2022
1 parent 2a3e0e5 commit eb3e40a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion arch/arm/Kconfig
Expand Up @@ -436,7 +436,7 @@ config ARCH_PXA
config ARCH_RPC
bool "RiscPC"
depends on MMU
depends on !CC_IS_CLANG && GCC_VERSION < 90100 && GCC_VERSION >= 60000
depends on !CC_IS_CLANG && GCC_VERSION >= 60000
select ARCH_ACORN
select ARCH_MAY_HAVE_PC_FDC
select ARCH_SPARSEMEM_ENABLE
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mm/Kconfig
Expand Up @@ -278,7 +278,7 @@ config CPU_ARM1026
# SA110
config CPU_SA110
bool
select CPU_32v3 if ARCH_RPC
select CPU_32v4 if ARCH_RPC
select CPU_32v4 if !ARCH_RPC
select CPU_ABRT_EV4
select CPU_CACHE_V4WB
Expand Down
13 changes: 5 additions & 8 deletions drivers/scsi/ufs/ufs-qcom.c
Expand Up @@ -1464,23 +1464,20 @@ static int ufs_qcom_device_reset(struct ufs_hba *hba)

#if IS_ENABLED(CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND)
static void ufs_qcom_config_scaling_param(struct ufs_hba *hba,
struct devfreq_dev_profile *p,
void *data)
struct devfreq_dev_profile *p,
struct devfreq_simple_ondemand_data *d)
{
static struct devfreq_simple_ondemand_data *d;

if (!data)
if (!d)
return;

d = (struct devfreq_simple_ondemand_data *)data;
p->polling_ms = 60;
d->upthreshold = 70;
d->downdifferential = 5;
}
#else
static void ufs_qcom_config_scaling_param(struct ufs_hba *hba,
struct devfreq_dev_profile *p,
void *data)
struct devfreq_dev_profile *p,
struct devfreq_simple_ondemand_data *data)
{
}
#endif
Expand Down
10 changes: 5 additions & 5 deletions drivers/scsi/ufs/ufshcd.h
Expand Up @@ -355,8 +355,8 @@ struct ufs_hba_variant_ops {
int (*phy_initialization)(struct ufs_hba *);
int (*device_reset)(struct ufs_hba *hba);
void (*config_scaling_param)(struct ufs_hba *hba,
struct devfreq_dev_profile *profile,
void *data);
struct devfreq_dev_profile *profile,
struct devfreq_simple_ondemand_data *data);
int (*program_key)(struct ufs_hba *hba,
const union ufs_crypto_cfg_entry *cfg, int slot);
void (*event_notify)(struct ufs_hba *hba,
Expand Down Expand Up @@ -1410,11 +1410,11 @@ static inline int ufshcd_vops_device_reset(struct ufs_hba *hba)
}

static inline void ufshcd_vops_config_scaling_param(struct ufs_hba *hba,
struct devfreq_dev_profile
*profile, void *data)
struct devfreq_dev_profile *p,
struct devfreq_simple_ondemand_data *data)
{
if (hba->vops && hba->vops->config_scaling_param)
hba->vops->config_scaling_param(hba, profile, data);
hba->vops->config_scaling_param(hba, p, data);
}

extern struct ufs_pm_lvl_states ufs_pm_lvl_states[];
Expand Down

0 comments on commit eb3e40a

Please sign in to comment.