diff mbox series

[v2,3/3] pmdomain: imx93-pd: drop the context variable "init_off"

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

Commit Message

Dario Binacchi Aug. 25, 2024, 2:34 p.m. UTC
This variable is only used within the probe() function, so let's remove
it from the context and define it locally within the same function.

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

---

(no changes since v1)

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

Comments

Ulf Hansson Sept. 13, 2024, 12:01 p.m. UTC | #1
On Sun, 25 Aug 2024 at 16:34, Dario Binacchi
<dario.binacchi@amarulasolutions.com> wrote:
>
> This variable is only used within the probe() function, so let's remove
> it from the context and define it locally within the same function.
>
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>

Applied for next, thanks!

Kind regards
Uffe


>
> ---
>
> (no changes since v1)
>
>  drivers/pmdomain/imx/imx93-pd.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/pmdomain/imx/imx93-pd.c b/drivers/pmdomain/imx/imx93-pd.c
> index fb53a8e359bc..25ab592945bd 100644
> --- a/drivers/pmdomain/imx/imx93-pd.c
> +++ b/drivers/pmdomain/imx/imx93-pd.c
> @@ -28,7 +28,6 @@ struct imx93_power_domain {
>         void __iomem *addr;
>         struct clk_bulk_data *clks;
>         int num_clks;
> -       bool init_off;
>  };
>
>  #define to_imx93_pd(_genpd) container_of(_genpd, struct imx93_power_domain, genpd)
> @@ -99,6 +98,7 @@ static int imx93_pd_probe(struct platform_device *pdev)
>         struct device *dev = &pdev->dev;
>         struct device_node *np = dev->of_node;
>         struct imx93_power_domain *domain;
> +       bool init_off;
>         int ret;
>
>         domain = devm_kzalloc(dev, sizeof(*domain), GFP_KERNEL);
> @@ -118,9 +118,9 @@ static int imx93_pd_probe(struct platform_device *pdev)
>         domain->genpd.power_on = imx93_pd_on;
>         domain->dev = dev;
>
> -       domain->init_off = readl(domain->addr + MIX_FUNC_STAT_OFF) & FUNC_STAT_ISO_STAT_MASK;
> +       init_off = readl(domain->addr + MIX_FUNC_STAT_OFF) & FUNC_STAT_ISO_STAT_MASK;
>         /* Just to sync the status of hardware */
> -       if (!domain->init_off) {
> +       if (!init_off) {
>                 ret = clk_bulk_prepare_enable(domain->num_clks, domain->clks);
>                 if (ret)
>                         return dev_err_probe(domain->dev, ret,
> @@ -128,7 +128,7 @@ static int imx93_pd_probe(struct platform_device *pdev)
>                                              domain->genpd.name);
>         }
>
> -       ret = pm_genpd_init(&domain->genpd, NULL, domain->init_off);
> +       ret = pm_genpd_init(&domain->genpd, NULL, init_off);
>         if (ret)
>                 goto err_clk_unprepare;
>
> @@ -144,7 +144,7 @@ static int imx93_pd_probe(struct platform_device *pdev)
>         pm_genpd_remove(&domain->genpd);
>
>  err_clk_unprepare:
> -       if (!domain->init_off)
> +       if (!init_off)
>                 clk_bulk_disable_unprepare(domain->num_clks, domain->clks);
>
>         return ret;
> --
> 2.43.0
>
diff mbox series

Patch

diff --git a/drivers/pmdomain/imx/imx93-pd.c b/drivers/pmdomain/imx/imx93-pd.c
index fb53a8e359bc..25ab592945bd 100644
--- a/drivers/pmdomain/imx/imx93-pd.c
+++ b/drivers/pmdomain/imx/imx93-pd.c
@@ -28,7 +28,6 @@  struct imx93_power_domain {
 	void __iomem *addr;
 	struct clk_bulk_data *clks;
 	int num_clks;
-	bool init_off;
 };
 
 #define to_imx93_pd(_genpd) container_of(_genpd, struct imx93_power_domain, genpd)
@@ -99,6 +98,7 @@  static int imx93_pd_probe(struct platform_device *pdev)
 	struct device *dev = &pdev->dev;
 	struct device_node *np = dev->of_node;
 	struct imx93_power_domain *domain;
+	bool init_off;
 	int ret;
 
 	domain = devm_kzalloc(dev, sizeof(*domain), GFP_KERNEL);
@@ -118,9 +118,9 @@  static int imx93_pd_probe(struct platform_device *pdev)
 	domain->genpd.power_on = imx93_pd_on;
 	domain->dev = dev;
 
-	domain->init_off = readl(domain->addr + MIX_FUNC_STAT_OFF) & FUNC_STAT_ISO_STAT_MASK;
+	init_off = readl(domain->addr + MIX_FUNC_STAT_OFF) & FUNC_STAT_ISO_STAT_MASK;
 	/* Just to sync the status of hardware */
-	if (!domain->init_off) {
+	if (!init_off) {
 		ret = clk_bulk_prepare_enable(domain->num_clks, domain->clks);
 		if (ret)
 			return dev_err_probe(domain->dev, ret,
@@ -128,7 +128,7 @@  static int imx93_pd_probe(struct platform_device *pdev)
 					     domain->genpd.name);
 	}
 
-	ret = pm_genpd_init(&domain->genpd, NULL, domain->init_off);
+	ret = pm_genpd_init(&domain->genpd, NULL, init_off);
 	if (ret)
 		goto err_clk_unprepare;
 
@@ -144,7 +144,7 @@  static int imx93_pd_probe(struct platform_device *pdev)
 	pm_genpd_remove(&domain->genpd);
 
 err_clk_unprepare:
-	if (!domain->init_off)
+	if (!init_off)
 		clk_bulk_disable_unprepare(domain->num_clks, domain->clks);
 
 	return ret;