scsi: ufs_quirks: fix card model string copy
Product name string (referred as "model" string in driver) starts from offset 02h in Product Name String Descriptor but currently we copy the product name from 00h offset of the descriptor which is incorrect. This change fixes the above problem by copying the product name from the right offset of the Product Name String Descriptor. Change-Id: I0ab2ecc19c7383d9782ba57af6441175d2ecda46 Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
This commit is contained in:
parent
878c98c005
commit
084930e1e4
1 changed files with 6 additions and 1 deletions
|
@ -48,7 +48,12 @@ int ufs_get_device_info(struct ufs_hba *hba, struct ufs_card_info *card_data)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
str_desc_buf[QUERY_DESC_STRING_MAX_SIZE] = '\0';
|
str_desc_buf[QUERY_DESC_STRING_MAX_SIZE] = '\0';
|
||||||
strlcpy(card_data->model, str_desc_buf, MAX_MODEL_LEN + 1);
|
strlcpy(card_data->model, (str_desc_buf + QUERY_DESC_HDR_SIZE),
|
||||||
|
min_t(u8, str_desc_buf[QUERY_DESC_LENGTH_OFFSET],
|
||||||
|
MAX_MODEL_LEN));
|
||||||
|
/* Null terminate the model string */
|
||||||
|
card_data->model[MAX_MODEL_LEN] = '\0';
|
||||||
|
|
||||||
out:
|
out:
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue