]> git.ipfire.org Git - thirdparty/u-boot.git/commit
dma: ti: k3-udma: Fix error handling for setup_resources() in udma_probe()
authorSiddharth Vadapalli <s-vadapalli@ti.com>
Tue, 20 Feb 2024 10:04:51 +0000 (15:34 +0530)
committerTom Rini <trini@konsulko.com>
Mon, 4 Mar 2024 18:41:04 +0000 (13:41 -0500)
commit333031011c8fcd3020caef41128f9687725c462c
tree49288e763b6298481133de32957f45a672f8bb54
parentf05add3822a09273392bc9c74b6dc4d6a42917ec
dma: ti: k3-udma: Fix error handling for setup_resources() in udma_probe()

In udma_probe() the return value of setup_resources() is stored in the
u32 "ch_count" member of "struct udma_dev", due to which any negative
return value which indicates an error is masked.

Fix this by storing the return value of setup_resources() in the already
declared integer variable "ret", followed by assigning it to the "ch_count"
member of "struct udma_dev" in case of no error.

While at it, change the "return ret" at the end of udma_probe() to a
"return 0", to explicitly indicate that probe was successful.

Fixes: a8837cf43839 ("dma: ti: k3-udma: Query DMA channels allocated from Resource Manager")
Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
drivers/dma/ti/k3-udma.c