Commit c4607a09 authored by Bean Huo's avatar Bean Huo Committed by Martin K. Petersen

scsi: ufs: Delete ufshcd_read_desc()

Delete ufshcd_read_desc(). Instead, let caller directly call
ufshcd_read_desc_param().

Link: https://lore.kernel.org/r/20200603091959.27618-3-huobean@gmail.comReviewed-by: default avatarAvri Altman <avri.altman@wdc.com>
Reviewed-by: default avatarBart van Assche <bvanassche@acm.org>
Reviewed-by: default avatarStanley Chu <stanley.chu@mediatek.com>
Signed-off-by: default avatarBean Huo <beanhuo@micron.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 458a45f5
...@@ -3234,16 +3234,6 @@ int ufshcd_read_desc_param(struct ufs_hba *hba, ...@@ -3234,16 +3234,6 @@ int ufshcd_read_desc_param(struct ufs_hba *hba,
return ret; return ret;
} }
static inline int ufshcd_read_desc(struct ufs_hba *hba,
enum desc_idn desc_id,
int desc_index,
void *buf,
u32 size)
{
return ufshcd_read_desc_param(hba, desc_id, desc_index, 0, buf, size);
}
/** /**
* struct uc_string_id - unicode string * struct uc_string_id - unicode string
* *
...@@ -3291,9 +3281,8 @@ int ufshcd_read_string_desc(struct ufs_hba *hba, u8 desc_index, ...@@ -3291,9 +3281,8 @@ int ufshcd_read_string_desc(struct ufs_hba *hba, u8 desc_index,
if (!uc_str) if (!uc_str)
return -ENOMEM; return -ENOMEM;
ret = ufshcd_read_desc(hba, QUERY_DESC_IDN_STRING, ret = ufshcd_read_desc_param(hba, QUERY_DESC_IDN_STRING, desc_index, 0,
desc_index, uc_str, (u8 *)uc_str, QUERY_DESC_MAX_SIZE);
QUERY_DESC_MAX_SIZE);
if (ret < 0) { if (ret < 0) {
dev_err(hba->dev, "Reading String Desc failed after %d retries. err = %d\n", dev_err(hba->dev, "Reading String Desc failed after %d retries. err = %d\n",
QUERY_REQ_RETRIES, ret); QUERY_REQ_RETRIES, ret);
...@@ -6813,7 +6802,7 @@ static void ufshcd_set_active_icc_lvl(struct ufs_hba *hba) ...@@ -6813,7 +6802,7 @@ static void ufshcd_set_active_icc_lvl(struct ufs_hba *hba)
if (!desc_buf) if (!desc_buf)
return; return;
ret = ufshcd_read_desc(hba, QUERY_DESC_IDN_POWER, 0, ret = ufshcd_read_desc_param(hba, QUERY_DESC_IDN_POWER, 0, 0,
desc_buf, buff_len); desc_buf, buff_len);
if (ret) { if (ret) {
dev_err(hba->dev, dev_err(hba->dev,
...@@ -7015,7 +7004,7 @@ static int ufs_get_device_desc(struct ufs_hba *hba) ...@@ -7015,7 +7004,7 @@ static int ufs_get_device_desc(struct ufs_hba *hba)
goto out; goto out;
} }
err = ufshcd_read_desc(hba, QUERY_DESC_IDN_DEVICE, 0, desc_buf, err = ufshcd_read_desc_param(hba, QUERY_DESC_IDN_DEVICE, 0, 0, desc_buf,
hba->desc_size.dev_desc); hba->desc_size.dev_desc);
if (err) { if (err) {
dev_err(hba->dev, "%s: Failed reading Device Desc. err = %d\n", dev_err(hba->dev, "%s: Failed reading Device Desc. err = %d\n",
...@@ -7298,7 +7287,7 @@ static int ufshcd_device_geo_params_init(struct ufs_hba *hba) ...@@ -7298,7 +7287,7 @@ static int ufshcd_device_geo_params_init(struct ufs_hba *hba)
goto out; goto out;
} }
err = ufshcd_read_desc(hba, QUERY_DESC_IDN_GEOMETRY, 0, err = ufshcd_read_desc_param(hba, QUERY_DESC_IDN_GEOMETRY, 0, 0,
desc_buf, buff_len); desc_buf, buff_len);
if (err) { if (err) {
dev_err(hba->dev, "%s: Failed reading Geometry Desc. err = %d\n", dev_err(hba->dev, "%s: Failed reading Geometry Desc. err = %d\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment