scsi: ufs: Declare the quirks array const
Declare the quirks array and also its 'model' member const to make it explicit that these are not modified. Link: https://lore.kernel.org/r/20220419225811.4127248-11-bvanassche@acm.org Tested-by: Bean Huo <beanhuo@micron.com> Reviewed-by: Avri Altman <avri.altman@wdc.com> Reviewed-by: Bean Huo <beanhuo@micron.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
25eff2f543
commit
aead21f32a
@ -44,7 +44,7 @@
|
|||||||
#define ufs_mtk_device_reset_ctrl(high, res) \
|
#define ufs_mtk_device_reset_ctrl(high, res) \
|
||||||
ufs_mtk_smc(UFS_MTK_SIP_DEVICE_RESET, high, res)
|
ufs_mtk_smc(UFS_MTK_SIP_DEVICE_RESET, high, res)
|
||||||
|
|
||||||
static struct ufs_dev_quirk ufs_mtk_dev_fixups[] = {
|
static const struct ufs_dev_quirk ufs_mtk_dev_fixups[] = {
|
||||||
{ .wmanufacturerid = UFS_VENDOR_MICRON,
|
{ .wmanufacturerid = UFS_VENDOR_MICRON,
|
||||||
.model = UFS_ANY_MODEL,
|
.model = UFS_ANY_MODEL,
|
||||||
.quirk = UFS_DEVICE_QUIRK_DELAY_AFTER_LPM },
|
.quirk = UFS_DEVICE_QUIRK_DELAY_AFTER_LPM },
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
struct ufs_dev_quirk {
|
struct ufs_dev_quirk {
|
||||||
u16 wmanufacturerid;
|
u16 wmanufacturerid;
|
||||||
u8 *model;
|
const u8 *model;
|
||||||
unsigned int quirk;
|
unsigned int quirk;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -204,7 +204,7 @@ ufs_get_desired_pm_lvl_for_dev_link_state(enum ufs_dev_pwr_mode dev_state,
|
|||||||
return UFS_PM_LVL_0;
|
return UFS_PM_LVL_0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct ufs_dev_quirk ufs_fixups[] = {
|
static const struct ufs_dev_quirk ufs_fixups[] = {
|
||||||
/* UFS cards deviations table */
|
/* UFS cards deviations table */
|
||||||
{ .wmanufacturerid = UFS_VENDOR_MICRON,
|
{ .wmanufacturerid = UFS_VENDOR_MICRON,
|
||||||
.model = UFS_ANY_MODEL,
|
.model = UFS_ANY_MODEL,
|
||||||
@ -7624,9 +7624,10 @@ static void ufshcd_temp_notif_probe(struct ufs_hba *hba, u8 *desc_buf)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ufshcd_fixup_dev_quirks(struct ufs_hba *hba, struct ufs_dev_quirk *fixups)
|
void ufshcd_fixup_dev_quirks(struct ufs_hba *hba,
|
||||||
|
const struct ufs_dev_quirk *fixups)
|
||||||
{
|
{
|
||||||
struct ufs_dev_quirk *f;
|
const struct ufs_dev_quirk *f;
|
||||||
struct ufs_dev_info *dev_info = &hba->dev_info;
|
struct ufs_dev_info *dev_info = &hba->dev_info;
|
||||||
|
|
||||||
if (!fixups)
|
if (!fixups)
|
||||||
|
@ -1178,7 +1178,8 @@ int ufshcd_query_flag(struct ufs_hba *hba, enum query_opcode opcode,
|
|||||||
|
|
||||||
void ufshcd_auto_hibern8_enable(struct ufs_hba *hba);
|
void ufshcd_auto_hibern8_enable(struct ufs_hba *hba);
|
||||||
void ufshcd_auto_hibern8_update(struct ufs_hba *hba, u32 ahit);
|
void ufshcd_auto_hibern8_update(struct ufs_hba *hba, u32 ahit);
|
||||||
void ufshcd_fixup_dev_quirks(struct ufs_hba *hba, struct ufs_dev_quirk *fixups);
|
void ufshcd_fixup_dev_quirks(struct ufs_hba *hba,
|
||||||
|
const struct ufs_dev_quirk *fixups);
|
||||||
#define SD_ASCII_STD true
|
#define SD_ASCII_STD true
|
||||||
#define SD_RAW false
|
#define SD_RAW false
|
||||||
int ufshcd_read_string_desc(struct ufs_hba *hba, u8 desc_index,
|
int ufshcd_read_string_desc(struct ufs_hba *hba, u8 desc_index,
|
||||||
|
Loading…
Reference in New Issue
Block a user