projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
34991ee
)
regulator: Check ramp_delay_table for regulator_set_ramp_delay_regmap
author
Axel Lin
<axel.lin@ingics.com>
Wed, 19 May 2021 13:22:55 +0000
(21:22 +0800)
committer
Mark Brown
<broonie@kernel.org>
Wed, 19 May 2021 13:31:43 +0000
(14:31 +0100)
Return -EINVAL if ramp_delay_table is NULL.
Also add WARN_ON since the driver code needs fix if this happened.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Link:
https://lore.kernel.org/r/20210519132255.1683863-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/helpers.c
patch
|
blob
|
history
diff --git
a/drivers/regulator/helpers.c
b/drivers/regulator/helpers.c
index 0e16e31c968f124c7b254e4549c994b0c8a49f72..ad2237a95572a7b21d1b11d324da1f5e9e86ad9d 100644
(file)
--- a/
drivers/regulator/helpers.c
+++ b/
drivers/regulator/helpers.c
@@
-948,7
+948,7
@@
int regulator_set_ramp_delay_regmap(struct regulator_dev *rdev, int ramp_delay)
int ret;
unsigned int sel;
- if (
!rdev->desc->n_ramp_values
)
+ if (
WARN_ON(!rdev->desc->n_ramp_values || !rdev->desc->ramp_delay_table)
)
return -EINVAL;
ret = find_closest_bigger(ramp_delay, rdev->desc->ramp_delay_table,