aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/cros-ec-regulator.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2021-05-12regulator: cros-ec: Fix error code in dev_err messageAxel Lin1-1/+2
Show proper error code instead of 0. Signed-off-by: Axel Lin <axel.lin@ingics.com> Link: https://lore.kernel.org/r/20210512075824.620580-1-axel.lin@ingics.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-04regulator: cros-ec-regulator: Add NULL test for devm_kmemdup callAxel Lin1-0/+3
Fix possible NULL pointer dereference. Signed-off-by: Axel Lin <axel.lin@ingics.com> Link: https://lore.kernel.org/r/20200802032509.305425-1-axel.lin@ingics.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-28regulator: cros-ec-regulator: Fix double free of desc->name.Pi-Hsun Shih1-6/+1
The desc->name field is allocated with devm_kstrdup, but is also kfreed on the error path, causing it to be double freed. Remove the kfree on the error path. Fixes: 8d9f8d57e023 ("regulator: Add driver for cros-ec-regulator") Signed-off-by: Pi-Hsun Shih <pihsun@chromium.org> Reviewed-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Link: https://lore.kernel.org/r/20200728091909.2009771-1-pihsun@chromium.org Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-13regulator: cros-ec: Constify cros_ec_regulator_voltage_opsRikard Falkeborn1-1/+1
It is never modified, so make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Acked-by: Pi-Hsun Shih <pihsun@chromium.org> Link: https://lore.kernel.org/r/20200711114409.9911-1-rikard.falkeborn@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-15regulator: Add driver for cros-ec-regulatorPi-Hsun Shih1-0/+257
Add driver for cros-ec-regulator, representing a voltage regulator that is connected and controlled by ChromeOS EC, and is controlled by kernel with EC host commands. Signed-off-by: Pi-Hsun Shih <pihsun@chromium.org> Reviewed-by: Prashant Malani <pmalani@chromium.org> Reviewed-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Link: https://lore.kernel.org/r/20200612040526.192878-4-pihsun@chromium.org Signed-off-by: Mark Brown <broonie@kernel.org>