add calibration_data node to laser sysfs

Add calibration_data node to laser sysfs:
/sys/devices/virtual/laser/stmvl53l1/calibration_data

Change-Id: I13b71671c81b3e0b9f0031e64866680f26161a12
Signed-off-by: yanyh2 <yanyh2@motorola.com>
Reviewed-on: https://gerrit.mot.com/1420664
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
yanyh2 2019-09-12 18:51:40 +08:00 • committed by Yonghua Yan
commit fd106d73c0

View file

@ -4768,10 +4768,20 @@ int stmvl53l1_sysfs_laser(struct stmvl53l1_data *data, bool create)
&laser_name_attributes);
if (error)
goto device_destroy;
error = sysfs_create_bin_file(&laser_class_dev->kobj,
&stmvl53l1_calib_data_attr);
if (error) {
device_remove_file(laser_class_dev,
&laser_name_attributes);
goto device_destroy;
}
} else {
if (!laser_class || !laser_class_dev)
return -ENODEV;
sysfs_remove_bin_file(&laser_class_dev->kobj,
&stmvl53l1_calib_data_attr);
device_remove_file(laser_class_dev,
&laser_name_attributes);
for (i = 0; stmvl53l1_attributes[i] != NULL; ++i)