]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
dmaengine: Refactor devm_dma_request_chan() for readability
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 9 Jan 2026 17:35:41 +0000 (18:35 +0100)
committerVinod Koul <vkoul@kernel.org>
Thu, 26 Feb 2026 15:30:01 +0000 (21:00 +0530)
commitf709b38e5bfec5846f3f062e87f86ead0c881028
tree01db607447ed0364bd1dbac349a313da4d22b626
parentb49c70273801bf2f7c16ac49f403a5c253b46159
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>
drivers/dma/dmaengine.c