[PATCH 2/3] dmaengine: ptdma: Slightly simplify error handling in pt_pci_probe()
From: Christophe JAILLET
Date: Sat Jan 18 2025 - 10:51:32 EST
'ret' can be non-zero, only if pt_core_init() was called a few lines above.
So move this test inside the same "if" to make things more obvious.
Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
---
Compile tested only
---
drivers/dma/amd/ptdma/ptdma-pci.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/dma/amd/ptdma/ptdma-pci.c b/drivers/dma/amd/ptdma/ptdma-pci.c
index 7f12474bd39f..b25b6f7618c3 100644
--- a/drivers/dma/amd/ptdma/ptdma-pci.c
+++ b/drivers/dma/amd/ptdma/ptdma-pci.c
@@ -188,11 +188,11 @@ static int pt_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
dev_set_drvdata(dev, pt);
- if (pt->dev_vdata)
+ if (pt->dev_vdata) {
ret = pt_core_init(pt);
-
- if (ret)
- goto e_free_irqs;
+ if (ret)
+ goto e_free_irqs;
+ }
return 0;
--
2.48.1