HID: amd_sfh: Modify and log error only if case of functionality failures
Modify log messages, but only log errors when sensors are missing or a true failure occurs to avoid misleading "failed" messages. Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
This commit is contained in:
parent
3e78a6c0d3
commit
6856f079cd
@ -333,14 +333,11 @@ static const struct dmi_system_id dmi_nodevs[] = {
|
|||||||
static void sfh1_1_init_work(struct work_struct *work)
|
static void sfh1_1_init_work(struct work_struct *work)
|
||||||
{
|
{
|
||||||
struct amd_mp2_dev *mp2 = container_of(work, struct amd_mp2_dev, work);
|
struct amd_mp2_dev *mp2 = container_of(work, struct amd_mp2_dev, work);
|
||||||
struct pci_dev *pdev = mp2->pdev;
|
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
rc = mp2->sfh1_1_ops->init(mp2);
|
rc = mp2->sfh1_1_ops->init(mp2);
|
||||||
if (rc) {
|
if (rc)
|
||||||
dev_err(&pdev->dev, "sfh1_1_init failed err %d\n", rc);
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
amd_sfh_clear_intr(mp2);
|
amd_sfh_clear_intr(mp2);
|
||||||
mp2->init_done = 1;
|
mp2->init_done = 1;
|
||||||
|
@ -202,7 +202,7 @@ static int amd_sfh1_1_hid_client_init(struct amd_mp2_dev *privdata)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!cl_data->is_any_sensor_enabled) {
|
if (!cl_data->is_any_sensor_enabled) {
|
||||||
dev_warn(dev, "Failed to discover, sensors not enabled is %d\n",
|
dev_warn(dev, "No sensor registered, sensors not enabled is %d\n",
|
||||||
cl_data->is_any_sensor_enabled);
|
cl_data->is_any_sensor_enabled);
|
||||||
rc = -EOPNOTSUPP;
|
rc = -EOPNOTSUPP;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
@ -320,7 +320,7 @@ int amd_sfh1_1_init(struct amd_mp2_dev *mp2)
|
|||||||
|
|
||||||
memcpy_fromio(&binfo, mp2->vsbase, sizeof(struct sfh_base_info));
|
memcpy_fromio(&binfo, mp2->vsbase, sizeof(struct sfh_base_info));
|
||||||
if (binfo.sbase.fw_info.fw_ver == 0 || binfo.sbase.s_list.sl.sensors == 0) {
|
if (binfo.sbase.fw_info.fw_ver == 0 || binfo.sbase.s_list.sl.sensors == 0) {
|
||||||
dev_dbg(dev, "failed to get sensors\n");
|
dev_dbg(dev, "No sensor registered\n");
|
||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
dev_dbg(dev, "firmware version 0x%x\n", binfo.sbase.fw_info.fw_ver);
|
dev_dbg(dev, "firmware version 0x%x\n", binfo.sbase.fw_info.fw_ver);
|
||||||
@ -337,7 +337,8 @@ int amd_sfh1_1_init(struct amd_mp2_dev *mp2)
|
|||||||
rc = amd_sfh1_1_hid_client_init(mp2);
|
rc = amd_sfh1_1_hid_client_init(mp2);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
sfh_deinit_emp2();
|
sfh_deinit_emp2();
|
||||||
dev_err(dev, "amd_sfh1_1_hid_client_init failed\n");
|
if ((rc != -ENODEV) && (rc != -EOPNOTSUPP))
|
||||||
|
dev_err(dev, "amd_sfh1_1_hid_client_init failed\n");
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user