diff options
author | Tudor Ambarus <[email protected]> | 2022-10-25 12:02:56 +0300 |
---|---|---|
committer | Vinod Koul <[email protected]> | 2022-11-11 12:15:08 +0530 |
commit | 5f1d429b43b34b310a93651681d0cd8a39a86e3d (patch) | |
tree | 8954f19de9cc106e349d8b037e28a0e69a4af259 /lib/mpi/mpi-mod.c | |
parent | b50cf4bdfb9164c55d002624217d5a5ef4ab9573 (diff) |
dmaengine: at_hdmac: Use devm_kzalloc() and struct_size()
Use the resource-managed kzalloc to simplify error logic. Memory allocated
with this function is automatically freed on driver detach. Use
struct_size() helper to calculate the size of the atdma structure with its
trailing flexible array. While here, move the mem allocation higher in the
probe method, as failing to allocate memory indicates a serious system
issue, and everything else does not matter anyway. All these help the code
look a bit cleaner.
Signed-off-by: Tudor Ambarus <[email protected]>
Acked-by: Nicolas Ferre <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Vinod Koul <[email protected]>
Diffstat (limited to 'lib/mpi/mpi-mod.c')
0 files changed, 0 insertions, 0 deletions