Skip to content

Commit 9a97b21

Browse files
krzknmenon
authored andcommitted
soc: ti: knav_dma: Simplify error messages in probe
Simplify the code by using dev_err_probe() and local 'dev' variable. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Link: https://patch.msgid.link/20260102124729.63964-8-krzysztof.kozlowski@oss.qualcomm.com Signed-off-by: Nishanth Menon <nm@ti.com>
1 parent c076d74 commit 9a97b21

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

drivers/soc/ti/knav_dma.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -709,10 +709,8 @@ static int knav_dma_probe(struct platform_device *pdev)
709709
struct device_node *child;
710710
int ret = 0;
711711

712-
if (!node) {
713-
dev_err(&pdev->dev, "could not find device info\n");
714-
return -EINVAL;
715-
}
712+
if (!node)
713+
return dev_err_probe(dev, -EINVAL, "could not find device info\n");
716714

717715
kdev = devm_kzalloc(dev,
718716
sizeof(struct knav_dma_pool_device), GFP_KERNEL);
@@ -725,7 +723,7 @@ static int knav_dma_probe(struct platform_device *pdev)
725723
pm_runtime_enable(kdev->dev);
726724
ret = pm_runtime_resume_and_get(kdev->dev);
727725
if (ret < 0) {
728-
dev_err(kdev->dev, "unable to enable pktdma, err %d\n", ret);
726+
dev_err(dev, "unable to enable pktdma, err %d\n", ret);
729727
goto err_pm_disable;
730728
}
731729

@@ -734,14 +732,13 @@ static int knav_dma_probe(struct platform_device *pdev)
734732
ret = dma_init(node, child);
735733
if (ret) {
736734
of_node_put(child);
737-
dev_err(&pdev->dev, "init failed with %d\n", ret);
735+
dev_err(dev, "init failed with %d\n", ret);
738736
break;
739737
}
740738
}
741739

742740
if (list_empty(&kdev->list)) {
743-
dev_err(dev, "no valid dma instance\n");
744-
ret = -ENODEV;
741+
ret = dev_err_probe(dev, -ENODEV, "no valid dma instance\n");
745742
goto err_put_sync;
746743
}
747744

0 commit comments

Comments
 (0)