On 10/20/22 11:03, Asutosh Das wrote:
+static unsigned int ufs_get_ext_ufs_feature(struct ufs_hba *hba, + const u8 *desc_buf) +{ + if (hba->desc_size[QUERY_DESC_IDN_DEVICE] < + DEVICE_DESC_PARAM_EXT_UFS_FEATURE_SUP + 4) + return 0; + + return get_unaligned_be32(desc_buf + + DEVICE_DESC_PARAM_EXT_UFS_FEATURE_SUP); +}
Please avoid code duplication and make ufshcd_wb_probe() and ufshcd_temp_notif_probe() call the above function. Please also introduce the above function and perform the requested refactoring as a separate patch. Otherwise this patch looks good to me. Thanks, Bart.