mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 11:19:37 +00:00
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>
This commit is contained in:
parent
c25ad350f1
commit
f4f90edf90
1 changed files with 12 additions and 6 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue