diff options
author | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-06-04 17:04:33 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-06-11 19:17:40 +0200 |
commit | f4f90edf90935424c65c310e830db13a5a2ce944 (patch) | |
tree | 2bd99d27f896e3e95eded788e36e1ec7402de54a /drivers | |
parent | c25ad350f1ab36c56701601d98de9872b71fe0ad (diff) | |
download | linux-f4f90edf90935424c65c310e830db13a5a2ce944.tar.bz2 |
media: atomisp: improve ACPI/DMI detection logs
As there are several ways where the driver could possible
retrieve sensor data, make the prints clearer about what
was detected and from where.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c index cb02806274d1..1af9da8acf4c 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c +++ b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c @@ -922,7 +922,8 @@ int atomisp_gmin_register_vcm_control(struct camera_vcm_control *vcmCtrl) } EXPORT_SYMBOL_GPL(atomisp_gmin_register_vcm_control); -static int gmin_get_hardcoded_var(struct gmin_cfg_var *varlist, +static int gmin_get_hardcoded_var(struct device *dev, + struct gmin_cfg_var *varlist, const char *var8, char *out, size_t *out_len) { struct gmin_cfg_var *gv; @@ -933,6 +934,8 @@ static int gmin_get_hardcoded_var(struct gmin_cfg_var *varlist, if (strcmp(var8, gv->name)) continue; + dev_info(dev, "Found DMI entry for '%s'\n", var8); + vl = strlen(gv->val); if (vl > *out_len - 1) return -ENOSPC; @@ -1056,9 +1059,10 @@ static int gmin_get_config_var(struct device *maindev, */ id = dmi_first_match(gmin_vars); if (id) { - dev_info(maindev, "Found DMI entry for '%s'\n", var8); - return gmin_get_hardcoded_var(id->driver_data, var8, out, - out_len); + ret = gmin_get_hardcoded_var(maindev, id->driver_data, var8, + out, out_len); + if (!ret) + return 0; } /* Our variable names are ASCII by construction, but EFI names @@ -1088,9 +1092,9 @@ static int gmin_get_config_var(struct device *maindev, *out_len = ev->var.DataSize; dev_info(maindev, "found EFI entry for '%s'\n", var8); } else if (is_gmin) { - dev_warn(maindev, "Failed to find gmin variable %s\n", var8); + dev_info(maindev, "Failed to find EFI gmin variable %s\n", var8); } else { - dev_warn(maindev, "Failed to find variable %s\n", var8); + dev_info(maindev, "Failed to find EFI variable %s\n", var8); } kfree(ev); @@ -1109,6 +1113,8 @@ int gmin_get_var_int(struct device *dev, bool is_gmin, const char *var, int def) if (!ret) { val[len] = 0; ret = kstrtol(val, 0, &result); + } else { + dev_info(dev, "%s: using default (%d)\n", var, def); } return ret ? def : result; |