diff mbox series

soc: mediatek: mutex: Use dev_err_probe()

Message ID 202303241017290414354@zte.com.cn (mailing list archive)
State New, archived
Headers show
Series soc: mediatek: mutex: Use dev_err_probe() | expand

Commit Message

ye.xingchen@zte.com.cn March 24, 2023, 2:17 a.m. UTC
From: Ye Xingchen <ye.xingchen@zte.com.cn>

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

Signed-off-by: Ye Xingchen <ye.xingchen@zte.com.cn>
---
 drivers/soc/mediatek/mtk-mutex.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Comments

AngeloGioacchino Del Regno March 24, 2023, 8:28 a.m. UTC | #1
Il 24/03/23 03:17, ye.xingchen@zte.com.cn ha scritto:
> From: Ye Xingchen <ye.xingchen@zte.com.cn>
> 
> Replace the open-code with dev_err_probe() to simplify the code.
> 
> Signed-off-by: Ye Xingchen <ye.xingchen@zte.com.cn>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Matthias Brugger April 2, 2023, 5:27 p.m. UTC | #2
On 24/03/2023 03:17, ye.xingchen@zte.com.cn wrote:
> From: Ye Xingchen <ye.xingchen@zte.com.cn>
> 
> Replace the open-code with dev_err_probe() to simplify the code.
> 
> Signed-off-by: Ye Xingchen <ye.xingchen@zte.com.cn>

Applied, thanks

> ---
>   drivers/soc/mediatek/mtk-mutex.c | 7 ++-----
>   1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/soc/mediatek/mtk-mutex.c b/drivers/soc/mediatek/mtk-mutex.c
> index 7751527fc30d..05c8ad3c2664 100644
> --- a/drivers/soc/mediatek/mtk-mutex.c
> +++ b/drivers/soc/mediatek/mtk-mutex.c
> @@ -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);
diff mbox series

Patch

diff --git a/drivers/soc/mediatek/mtk-mutex.c b/drivers/soc/mediatek/mtk-mutex.c
index 7751527fc30d..05c8ad3c2664 100644
--- a/drivers/soc/mediatek/mtk-mutex.c
+++ b/drivers/soc/mediatek/mtk-mutex.c
@@ -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);