aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/mfd/sec-common.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2025-05-23mfd: sec: Add myself as module authorAndré Draszik1-0/+1
Add myself as module author, so people know whom to complain to about after the recent updates. Signed-off-by: André Draszik <andre.draszik@linaro.org> Link: https://lore.kernel.org/r/20250409-s2mpg10-v4-23-d66d5f39b6bf@linaro.org Signed-off-by: Lee Jones <lee@kernel.org>
2025-05-23mfd: sec-common: Convert to using MFD_CELL macrosAndré Draszik1-36/+21
Use MFD_CELL macro helpers instead of open coding. This makes the code a bit shorter and more obvious. Signed-off-by: André Draszik <andre.draszik@linaro.org> Link: https://lore.kernel.org/r/20250409-s2mpg10-v4-21-d66d5f39b6bf@linaro.org Signed-off-by: Lee Jones <lee@kernel.org>
2025-05-23mfd: sec-common: Use sizeof(*var), not sizeof(struct type_of_var)André Draszik1-1/+1
Using sizeof(*var) is generally preferred over using the size of its open-coded type when allocating memory. This helps avoiding bugs when the variable type changes but the memory allocation isn't updated, and it simplifies renaming of the struct if ever necessary. No functional change. Signed-off-by: André Draszik <andre.draszik@linaro.org> Link: https://lore.kernel.org/r/20250409-s2mpg10-v4-20-d66d5f39b6bf@linaro.org Signed-off-by: Lee Jones <lee@kernel.org>
2025-05-23mfd: sec: Don't compare against NULL / 0 for errors, use !André Draszik1-1/+1
Follow general style and use if (!arg) instead of comparing against NULL. While at it, drop a useless init in sec-irq.c. Signed-off-by: André Draszik <andre.draszik@linaro.org> Link: https://lore.kernel.org/r/20250409-s2mpg10-v4-19-d66d5f39b6bf@linaro.org Signed-off-by: Lee Jones <lee@kernel.org>
2025-05-23mfd: sec: Change device_type to intAndré Draszik1-5/+4
Now that sec-i2c doesn't match device type by pointer casting anymore, we can switch the device type from unsigned long to int easily. This saves a few bytes in struct sec_pmic_dev due to member alignment. Signed-off-by: André Draszik <andre.draszik@linaro.org> Link: https://lore.kernel.org/r/20250409-s2mpg10-v4-18-d66d5f39b6bf@linaro.org Signed-off-by: Lee Jones <lee@kernel.org>
2025-05-23mfd: sec-common: Don't ignore errors from sec_irq_init()André Draszik1-1/+3
sec_irq_init() can fail, we shouldn't continue and ignore the error in that case, but actually error out. Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: André Draszik <andre.draszik@linaro.org> Link: https://lore.kernel.org/r/20250409-s2mpg10-v4-16-d66d5f39b6bf@linaro.org Signed-off-by: Lee Jones <lee@kernel.org>
2025-05-23mfd: sec: Use dev_err_probe() where appropriateAndré Draszik1-3/+3
dev_err_probe() exists to simplify code and harmonise error messages, there's no reason not to use it here. While at it, harmonise some error messages. Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: André Draszik <andre.draszik@linaro.org> Link: https://lore.kernel.org/r/20250409-s2mpg10-v4-13-d66d5f39b6bf@linaro.org Signed-off-by: Lee Jones <lee@kernel.org>
2025-05-23mfd: sec-common: Fix multiple trivial whitespace issuesAndré Draszik1-4/+4
Rectify a couple of alignment problems reported by Checkpatch. Signed-off-by: André Draszik <andre.draszik@linaro.org> Link: https://lore.kernel.org/r/20250409-s2mpg10-v4-11-d66d5f39b6bf@linaro.org Signed-off-by: Lee Jones <lee@kernel.org>
2025-05-23mfd: sec: Merge separate core and irq modulesAndré Draszik1-0/+314
There is no reason to have these two kernel modules separate. Having them merged into one kernel module also slightly reduces memory consumption and module load times a little. mapped size (lsmod): before: after: sec_core 20480 sec_core 24576 sec_irq 16384 ---------------- total 36864 Section sizes (size -A): before: after: sec_core 6780 sec_core 13239 sec_irq 8046 ---------------- Total 14826 Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: André Draszik <andre.draszik@linaro.org> Link: https://lore.kernel.org/r/20250409-s2mpg10-v4-10-d66d5f39b6bf@linaro.org Signed-off-by: Lee Jones <lee@kernel.org>