Skip to content

Commit 7d46b8d

Browse files
Dragan Simicbroonie
authored andcommitted
spi: rockchip-sfc: Use dev_err_probe() in the probe path
Use function dev_err_probe() in the probe path instead of dev_err() where appropriate, to make the code a bit more uniform and compact. Reviewed-by: Heiko Stuebner <[email protected]> Signed-off-by: Dragan Simic <[email protected]> Link: https://patch.msgid.link/398229ef316e64dc0c27944ea793dcddef1ead4e.1727601608.git.dsimic@manjaro.org Signed-off-by: Mark Brown <[email protected]>
1 parent cb91287 commit 7d46b8d

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

drivers/spi/spi-rockchip-sfc.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -580,16 +580,14 @@ static int rockchip_sfc_probe(struct platform_device *pdev)
580580
return PTR_ERR(sfc->regbase);
581581

582582
sfc->clk = devm_clk_get(&pdev->dev, "clk_sfc");
583-
if (IS_ERR(sfc->clk)) {
584-
dev_err(&pdev->dev, "Failed to get sfc interface clk\n");
585-
return PTR_ERR(sfc->clk);
586-
}
583+
if (IS_ERR(sfc->clk))
584+
return dev_err_probe(&pdev->dev, PTR_ERR(sfc->clk),
585+
"Failed to get sfc interface clk\n");
587586

588587
sfc->hclk = devm_clk_get(&pdev->dev, "hclk_sfc");
589-
if (IS_ERR(sfc->hclk)) {
590-
dev_err(&pdev->dev, "Failed to get sfc ahb clk\n");
591-
return PTR_ERR(sfc->hclk);
592-
}
588+
if (IS_ERR(sfc->hclk))
589+
return dev_err_probe(&pdev->dev, PTR_ERR(sfc->hclk),
590+
"Failed to get sfc ahb clk\n");
593591

594592
sfc->use_dma = !of_property_read_bool(sfc->dev->of_node, "rockchip,sfc-no-dma");
595593

0 commit comments

Comments
 (0)