Skip to contentSkip to conversation

soc: mediatek: mutex: Use dev_err_probe()

PATCH Applied [email protected] 3 participants 3 messages Mar 24, 2023 – Apr 2, 2023 Arm MediaTek

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 soc: mediatek: mutex: Use dev_err_probe()

From: Ye Xingchen <[email protected]>

Replace the open-code with dev_err_probe() to simplify the code.

---
 drivers/soc/mediatek/mtk-mutex.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/soc/mediatek/mtk-mutex.c +2 -5
index 7751527fc30d..05c8ad3c2664 100644
@@ -1014,11 +1014,8 @@ static int mtk_mutex_probe(struct platform_device *pdev)
 
 	if (!mtx->data->no_clk) {
 		mtx->clk = devm_clk_get(dev, NULL);
-		if (IS_ERR(mtx->clk)) {
-			if (PTR_ERR(mtx->clk) != -EPROBE_DEFER)
-				dev_err(dev, "Failed to get clock\n");
-			return PTR_ERR(mtx->clk);
-		}
+		if (IS_ERR(mtx->clk))
+			return dev_err_probe(dev, PTR_ERR(mtx->clk), "Failed to get clock\n");
 	}
 
 	mtx->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &regs);
Signature · 1 line
2.25.1
maintainer Applied
#2 lore raw
In reply to [email protected]
Quoted 5 lines · On 24/03/2023 03:17, [email protected] wrote:

From: Ye Xingchen <[email protected]>

Replace the open-code with dev_err_probe() to simplify the code.

Applied, thanks

Quoted 22 lines
---
  drivers/soc/mediatek/mtk-mutex.c | 7 ++-----
  1 file changed, 2 insertions(+), 5 deletions(-)
drivers/soc/mediatek/mtk-mutex.c +2 -5
index 7751527fc30d..05c8ad3c2664 100644
@@ -1014,11 +1014,8 @@ static int mtk_mutex_probe(struct platform_device *pdev)
 
  	if (!mtx->data->no_clk) {
  		mtx->clk = devm_clk_get(dev, NULL);
-		if (IS_ERR(mtx->clk)) {
-			if (PTR_ERR(mtx->clk) != -EPROBE_DEFER)
-				dev_err(dev, "Failed to get clock\n");
-			return PTR_ERR(mtx->clk);
-		}
+		if (IS_ERR(mtx->clk))
+			return dev_err_probe(dev, PTR_ERR(mtx->clk), "Failed to get clock\n");
  	}
 
  	mtx->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &regs);