[PATCH] soc: amlogic: meson-pwrc: Use dev_err_probe()

ye.xingchen@zte.com.cn posted 1 patch 2 years, 10 months ago
drivers/soc/amlogic/meson-gx-pwrc-vpu.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
[PATCH] soc: amlogic: meson-pwrc: Use dev_err_probe()
Posted by ye.xingchen@zte.com.cn 2 years, 10 months ago
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/amlogic/meson-gx-pwrc-vpu.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/soc/amlogic/meson-gx-pwrc-vpu.c b/drivers/soc/amlogic/meson-gx-pwrc-vpu.c
index 312fd9afccb0..5d4f12800d93 100644
--- a/drivers/soc/amlogic/meson-gx-pwrc-vpu.c
+++ b/drivers/soc/amlogic/meson-gx-pwrc-vpu.c
@@ -308,11 +308,9 @@ static int meson_gx_pwrc_vpu_probe(struct platform_device *pdev)
 	}

 	rstc = devm_reset_control_array_get_exclusive(&pdev->dev);
-	if (IS_ERR(rstc)) {
-		if (PTR_ERR(rstc) != -EPROBE_DEFER)
-			dev_err(&pdev->dev, "failed to get reset lines\n");
-		return PTR_ERR(rstc);
-	}
+	if (IS_ERR(rstc))
+		return dev_err_probe(&pdev->dev, PTR_ERR(rstc),
+				     "failed to get reset lines\n");

 	vpu_clk = devm_clk_get(&pdev->dev, "vpu");
 	if (IS_ERR(vpu_clk)) {
-- 
2.25.1
Re: [PATCH] soc: amlogic: meson-pwrc: Use dev_err_probe()
Posted by Neil Armstrong 2 years, 10 months ago
Hi,

On Fri, 24 Mar 2023 10:16:26 +0800, ye.xingchen@zte.com.cn wrote:
> Replace the open-code with dev_err_probe() to simplify the code.
> 
> 

Thanks, Applied to https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux.git (v6.4/drivers)

[1/1] soc: amlogic: meson-pwrc: Use dev_err_probe()
      https://git.kernel.org/amlogic/c/78e812f0406c765fc5623b1d68e3c6e86cb32e5a

These changes has been applied on the intermediate git tree [1].

The v6.4/drivers branch will then be sent via a formal Pull Request to the Linux SoC maintainers
for inclusion in their intermediate git branches in order to be sent to Linus during
the next merge window, or sooner if it's a set of fixes.

In the cases of fixes, those will be merged in the current release candidate
kernel and as soon they appear on the Linux master branch they will be
backported to the previous Stable and Long-Stable kernels [2].

The intermediate git branches are merged daily in the linux-next tree [3],
people are encouraged testing these pre-release kernels and report issues on the
relevant mailing-lists.

If problems are discovered on those changes, please submit a signed-off-by revert
patch followed by a corrective changeset.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux.git
[2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
[3] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git

-- 
Neil
Re: [PATCH] soc: amlogic: meson-pwrc: Use dev_err_probe()
Posted by Martin Blumenstingl 2 years, 10 months ago
On Fri, Mar 24, 2023 at 3:16 AM <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>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Re: [PATCH] soc: amlogic: meson-pwrc: Use dev_err_probe()
Posted by neil.armstrong@linaro.org 2 years, 10 months ago
On 24/03/2023 03:16, 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>
> ---
>   drivers/soc/amlogic/meson-gx-pwrc-vpu.c | 8 +++-----
>   1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/soc/amlogic/meson-gx-pwrc-vpu.c b/drivers/soc/amlogic/meson-gx-pwrc-vpu.c
> index 312fd9afccb0..5d4f12800d93 100644
> --- a/drivers/soc/amlogic/meson-gx-pwrc-vpu.c
> +++ b/drivers/soc/amlogic/meson-gx-pwrc-vpu.c
> @@ -308,11 +308,9 @@ static int meson_gx_pwrc_vpu_probe(struct platform_device *pdev)
>   	}
> 
>   	rstc = devm_reset_control_array_get_exclusive(&pdev->dev);
> -	if (IS_ERR(rstc)) {
> -		if (PTR_ERR(rstc) != -EPROBE_DEFER)
> -			dev_err(&pdev->dev, "failed to get reset lines\n");
> -		return PTR_ERR(rstc);
> -	}
> +	if (IS_ERR(rstc))
> +		return dev_err_probe(&pdev->dev, PTR_ERR(rstc),
> +				     "failed to get reset lines\n");
> 
>   	vpu_clk = devm_clk_get(&pdev->dev, "vpu");
>   	if (IS_ERR(vpu_clk)) {

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>