aboutsummaryrefslogtreecommitdiff
path: root/drivers/regulator/max77802-regulator.c
AgeCommit message (Collapse)AuthorFilesLines
2023-01-28regulator: max77802: Bounds check regulator id against opmodeGravatar Kees Cook 1-10/+24
Explicitly bounds-check the id before accessing the opmode array. Seen with GCC 13: ../drivers/regulator/max77802-regulator.c: In function 'max77802_enable': ../drivers/regulator/max77802-regulator.c:217:29: warning: array subscript [0, 41] is outside array bounds of 'unsigned int[42]' [-Warray-bounds=] 217 | if (max77802->opmode[id] == MAX77802_OFF_PWRREQ) | ~~~~~~~~~~~~~~~~^~~~ ../drivers/regulator/max77802-regulator.c:62:22: note: while referencing 'opmode' 62 | unsigned int opmode[MAX77802_REG_MAX]; | ^~~~~~ Cc: Javier Martinez Canillas <javier@dowhile0.org> Cc: Liam Girdwood <lgirdwood@gmail.com> Cc: Mark Brown <broonie@kernel.org> Signed-off-by: Kees Cook <keescook@chromium.org> Acked-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://lore.kernel.org/r/20230127225203.never.864-kees@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-03regulator: max77802: Convert to use regulator_set_ramp_delay_regmapGravatar Axel Lin 1-57/+12
Use regulator_set_ramp_delay_regmap instead of open-coded. Signed-off-by: Axel Lin <axel.lin@ingics.com> Link: https://lore.kernel.org/r/20210523072320.2174443-2-axel.lin@ingics.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-03regulator: max77802: Remove .set_ramp_delay from max77802_buck_dvs_opsGravatar Axel Lin 1-1/+0
max77802_set_ramp_delay_2bit() returns -EINVAL when id > MAX77802_BUCK4. This was a leftover in commit b0615f1da543 ("regulator: max77802: Split regulator operations for BUCKs"). Signed-off-by: Axel Lin <axel.lin@ingics.com> Link: https://lore.kernel.org/r/20210523072320.2174443-1-axel.lin@ingics.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-06-10regulator: max77802: Drop unused includesGravatar Linus Walleij 1-2/+0
This driver does not use any symbols from <linux/gpio.h> no <linux/gpio/consumer.h> so just drop the includes. Cc: Javier Martinez Canillas <javierm@redhat.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-12regulator: max77802-regulator: fix indentation in if statementGravatar Colin Ian King 1-3/+3
There are several lines in an if statement that are not indented correctly. Fix these by removing the tabs. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-08-08regulator: maxim: Add SPDX license identifiersGravatar Krzysztof Kozlowski 1-22/+12
Replace GPL v2.0 and v2.0+ license statements with SPDX license identifiers. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-31regulator: max77802-regulator: constify regulator_ops structureGravatar Bhumika Goyal 1-5/+5
Declare regulator_ops structure as const as it is only stored in the ops field of a regulator_desc structure. This field is of type const, so regulator_ops structures having this property can be made const too. File size before: drivers/regulator/max77802-regulator.o text data bss dec hex filename 11811 1552 0 13363 3433 regulator/max77802-regulator.o File size after: drivers/regulator/max77802-regulator.o text data bss dec hex filename 13091 272 0 13363 3433 regulator/max77802-regulator.o Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-04-05regulator: max8997/max77802: Fix misspelled Samsung addressGravatar Krzysztof Kozlowski 1-1/+1
Correct smasung.com into samsung.com. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-12regulator: Rename files for max77686 and max77802 driversGravatar Javier Martinez Canillas 1-0/+610
The max77686 and max77802 regulator drivers are for sub-devices of a MFD driver for some PMIC blocks. But the same object file name (max77686.o) was used for both the common MFD driver and the max77686 regulator one. This confuses kbuild if both drivers are built as module causing the MFD driver to not be copied when installing the modules. Also, max77{686,802} are a quite generic name for MFD subdevices drivers so it is better to rename them to max77{686,802}-regulator like it's the case for most regulator drivers. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>