diff mbox series

[1/3] pmdomain: imx93-pd: replace dev_err() with dev_err_probe()

Message ID 20240825123626.3877812-1-dario.binacchi@amarulasolutions.com (mailing list archive)
State New, archived
Headers show
Series [1/3] pmdomain: imx93-pd: replace dev_err() with dev_err_probe() | expand

Commit Message

Dario Binacchi Aug. 25, 2024, 12:36 p.m. UTC
This way, the code becomes more compact, and dev_err_probe() is used in
every error path of the probe() function.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---

 drivers/pmdomain/imx/imx93-pd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Christophe JAILLET Aug. 25, 2024, 1:40 p.m. UTC | #1
Le 25/08/2024 à 14:36, Dario Binacchi a écrit :
> This way, the code becomes more compact, and dev_err_probe() is used in
> every error path of the probe() function.
> 
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> ---
> 
>   drivers/pmdomain/imx/imx93-pd.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/pmdomain/imx/imx93-pd.c b/drivers/pmdomain/imx/imx93-pd.c
> index d750a7dc58d2..afc482ec563f 100644
> --- a/drivers/pmdomain/imx/imx93-pd.c
> +++ b/drivers/pmdomain/imx/imx93-pd.c
> @@ -126,9 +126,9 @@ static int imx93_pd_probe(struct platform_device *pdev)
>   	if (!domain->init_off) {
>   		ret = clk_bulk_prepare_enable(domain->num_clks, domain->clks);
>   		if (ret) {
> -			dev_err(domain->dev, "failed to enable clocks for domain: %s\n",
> -				domain->genpd.name);
> -			return ret;
> +			return dev_err_probe(domain->dev, ret,
> +					     "failed to enable clocks for domain: %s\n",
> +					     domain->genpd.name);
>   		}

Hi,

you can now also remove the extra { } to be even more compact.

CJ

>   	}
>
diff mbox series

Patch

diff --git a/drivers/pmdomain/imx/imx93-pd.c b/drivers/pmdomain/imx/imx93-pd.c
index d750a7dc58d2..afc482ec563f 100644
--- a/drivers/pmdomain/imx/imx93-pd.c
+++ b/drivers/pmdomain/imx/imx93-pd.c
@@ -126,9 +126,9 @@  static int imx93_pd_probe(struct platform_device *pdev)
 	if (!domain->init_off) {
 		ret = clk_bulk_prepare_enable(domain->num_clks, domain->clks);
 		if (ret) {
-			dev_err(domain->dev, "failed to enable clocks for domain: %s\n",
-				domain->genpd.name);
-			return ret;
+			return dev_err_probe(domain->dev, ret,
+					     "failed to enable clocks for domain: %s\n",
+					     domain->genpd.name);
 		}
 	}