Commit Graph

9 Commits

Author SHA1 Message Date
André Draszik
217c445c40 mfd: sec: Add myself as module author
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-23 08:48:50 +01:00
André Draszik
55684cbb53 mfd: sec-common: Convert to using MFD_CELL macros
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-23 08:48:48 +01:00
André Draszik
2b897a1c2b mfd: sec-common: Use sizeof(*var), not sizeof(struct type_of_var)
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-23 08:48:47 +01:00
André Draszik
856c6514d5 mfd: sec: Don't compare against NULL / 0 for errors, use !
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-23 08:48:45 +01:00
André Draszik
adf91d9e19 mfd: sec: Change device_type to int
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-23 08:48:44 +01:00
André Draszik
0c33784aea mfd: sec-common: Don't ignore errors from sec_irq_init()
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-23 08:48:41 +01:00
André Draszik
176a30687b mfd: sec: Use dev_err_probe() where appropriate
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-23 08:48:38 +01:00
André Draszik
d58b81c436 mfd: sec-common: Fix multiple trivial whitespace issues
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-23 08:48:36 +01:00
André Draszik
b355f0cb92 mfd: sec: Merge separate core and irq modules
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>
2025-05-23 08:48:34 +01:00