Skip to content

Commit bb7663d

Browse files
Daniel Leemartinkpetersen
authored andcommitted
scsi: ufs: sysfs: Make HID attributes visible
Call sysfs_update_group() after reading the device descriptor to ensure the HID sysfs attributes are visible when the feature is supported. Fixes: ae7795a ("scsi: ufs: core: Add HID support") Signed-off-by: Daniel Lee <chullee@google.com> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 60cd16a commit bb7663d

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

drivers/ufs/core/ufs-sysfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1949,7 +1949,7 @@ static umode_t ufs_sysfs_hid_is_visible(struct kobject *kobj,
19491949
return hba->dev_info.hid_sup ? attr->mode : 0;
19501950
}
19511951

1952-
static const struct attribute_group ufs_sysfs_hid_group = {
1952+
const struct attribute_group ufs_sysfs_hid_group = {
19531953
.name = "hid",
19541954
.attrs = ufs_sysfs_hid,
19551955
.is_visible = ufs_sysfs_hid_is_visible,

drivers/ufs/core/ufs-sysfs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ void ufs_sysfs_remove_nodes(struct device *dev);
1414

1515
extern const struct attribute_group ufs_sysfs_unit_descriptor_group;
1616
extern const struct attribute_group ufs_sysfs_lun_attributes_group;
17+
extern const struct attribute_group ufs_sysfs_hid_group;
1718

1819
#endif

drivers/ufs/core/ufshcd.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8480,6 +8480,8 @@ static int ufs_get_device_desc(struct ufs_hba *hba)
84808480
DEVICE_DESC_PARAM_EXT_UFS_FEATURE_SUP) &
84818481
UFS_DEV_HID_SUPPORT;
84828482

8483+
sysfs_update_group(&hba->dev->kobj, &ufs_sysfs_hid_group);
8484+
84838485
model_index = desc_buf[DEVICE_DESC_PARAM_PRDCT_NAME];
84848486

84858487
err = ufshcd_read_string_desc(hba, model_index,

0 commit comments

Comments
 (0)