Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pinctrl: qcom: lpass lpi: use default pullup/strength values

If these fields are not set in dts, the driver will use these variables
uninitialized to set the fields. Not only will it set garbage values for
these fields, but it can overflow into other fields and break those.

In the current sm8250 dts, the dmic01 entries do not have a pullup setting,
and might not work without this change.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: 6e261d1090d6 ("pinctrl: qcom: Add sm8250 lpass lpi pinctrl driver")
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20210304194816.3843-1-jonathan@marek.ca
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Jonathan Marek and committed by
Linus Walleij
2a9be380 c971af25

+1 -1
+1 -1
drivers/pinctrl/qcom/pinctrl-lpass-lpi.c
··· 392 392 unsigned long *configs, unsigned int nconfs) 393 393 { 394 394 struct lpi_pinctrl *pctrl = dev_get_drvdata(pctldev->dev); 395 - unsigned int param, arg, pullup, strength; 395 + unsigned int param, arg, pullup = LPI_GPIO_BIAS_DISABLE, strength = 2; 396 396 bool value, output_enabled = false; 397 397 const struct lpi_pingroup *g; 398 398 unsigned long sval;