diff options
author | Tudor Ambarus <tudor.ambarus@microchip.com> | 2022-10-25 12:02:56 +0300 |
---|---|---|
committer | Vinod Koul <vkoul@kernel.org> | 2022-11-11 09:45:08 +0300 |
commit | 5f1d429b43b34b310a93651681d0cd8a39a86e3d (patch) | |
tree | 8954f19de9cc106e349d8b037e28a0e69a4af259 /tools | |
parent | b50cf4bdfb9164c55d002624217d5a5ef4ab9573 (diff) | |
download | linux-5f1d429b43b34b310a93651681d0cd8a39a86e3d.tar.xz |
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 <tudor.ambarus@microchip.com>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Link: https://lore.kernel.org/r/20221025090306.297886-1-tudor.ambarus@microchip.com
Link: https://lore.kernel.org/r/20221025090306.297886-23-tudor.ambarus@microchip.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions