mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2026-11-08 18:57:22 +00:00
dmaengine: Refactor devm_dma_request_chan() for readability
Yes, while it's a bit longer in terms of LoCs, it's more readable when we use the usual patter to check for errors, and not for a success). This eliminates unneeded assignment and moves the needed one closer to its user which is better programming pattern because it allows avoiding potential errors in case the variable is getting reused. Also note that the same pattern have been used already in dmaenginem_async_device_register(). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20260109173718.3605829-2-andriy.shevchenko@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
This commit is contained in:
parent
b49c702738
commit
f709b38e5b
1 changed files with 6 additions and 4 deletions
Loading…
Add table
Add a link
Reference in a new issue