Skip to contentSkip to conversation

pmdomain: ti/core: Miscellaneous cleanups

PATCH New Geert Uytterhoeven 1 participant 4 messages Nov 19

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover pmdomain: ti/core: Miscellaneous cleanups

Hi all,

This patch series contains two cleanups for the TI OMAP2+ PRM driver, and removes a now-unused generic_pm_domain_data member.

This has been tested on BeagleBone Black.

Thanks for your comments!

Geert Uytterhoeven (3):
pmdomain: ti: omap_prm: Use pm_clk_no_clocks()
pmdomain: ti: omap_prm: Remove dummy generic_pm_domain_data handling
pmdomain: core: Remove unused generic_pm_domain_data.data

 drivers/pmdomain/ti/omap_prm.c | 15 +--------------
 include/linux/pm_domain.h      |  1 -
 2 files changed, 1 insertion(+), 15 deletions(-)
Signature · 12 lines
2.43.0

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds
#1 lore raw

PATCH 1/3 pmdomain: ti: omap_prm: Use pm_clk_no_clocks()

The TI OMAP2+ PRM driver uses a flag to keep track if any device clocks were registered for power management. Replace this custom logic by use of the existing pm_clk_no_clocks() helper.

---
 drivers/pmdomain/ti/omap_prm.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/pmdomain/ti/omap_prm.c +1 -6
index 671b028e367eb9de..9515420da890cb31 100644
@@ -44,7 +44,6 @@ struct omap_prm_domain {
 	u16 pwrstst;
 	const struct omap_prm_domain_map *cap;
 	u32 pwrstctrl_saved;
-	unsigned int uses_pm_clk:1;
 };
 
 struct omap_rst_map {
@@ -630,8 +629,6 @@ static int omap_prm_domain_attach_clock(struct device *dev,
 		return error;
 	}
 
-	prmd->uses_pm_clk = 1;
-
 	return 0;
 }
 
@@ -671,10 +668,8 @@ static void omap_prm_domain_detach_dev(struct generic_pm_domain *domain,
 				       struct device *dev)
 {
 	struct generic_pm_domain_data *genpd_data;
-	struct omap_prm_domain *prmd;
 
-	prmd = genpd_to_prm_domain(domain);
-	if (prmd->uses_pm_clk)
+	if (!pm_clk_no_clocks(dev))
 		pm_clk_destroy(dev);
 	genpd_data = dev_gpd_data(dev);
 	genpd_data->data = NULL;
Signature · 1 line
2.43.0
#2 lore raw

PATCH 2/3 pmdomain: ti: omap_prm: Remove dummy generic_pm_domain_data handling

In reply to Geert Uytterhoeven

The TI OMAP2+ PRM driver clears generic_pm_domain_data.data in its generic_pm_domain.attach_dev() and generic_pm_domain.detach() callbacks, but never sets it to a non-NULL value. Presumably this was part of unfinished handling copied from the TI SCI Generic Power Domain Driver.

Remove the unused code.

---
 drivers/pmdomain/ti/omap_prm.c | 8 --------
 1 file changed, 8 deletions(-)
drivers/pmdomain/ti/omap_prm.c +0 -8
index 9515420da890cb31..eb4ce7cf9c176936 100644
@@ -635,7 +635,6 @@ static int omap_prm_domain_attach_clock(struct device *dev,
 static int omap_prm_domain_attach_dev(struct generic_pm_domain *domain,
 				      struct device *dev)
 {
-	struct generic_pm_domain_data *genpd_data;
 	struct of_phandle_args pd_args;
 	struct omap_prm_domain *prmd;
 	struct device_node *np;
@@ -654,9 +653,6 @@ static int omap_prm_domain_attach_dev(struct generic_pm_domain *domain,
 			 prmd->pd.name, pd_args.args_count);
 	of_node_put(pd_args.np);
 
-	genpd_data = dev_gpd_data(dev);
-	genpd_data->data = NULL;
-
 	ret = omap_prm_domain_attach_clock(dev, prmd);
 	if (ret)
 		return ret;
@@ -667,12 +663,8 @@ static int omap_prm_domain_attach_dev(struct generic_pm_domain *domain,
 static void omap_prm_domain_detach_dev(struct generic_pm_domain *domain,
 				       struct device *dev)
 {
-	struct generic_pm_domain_data *genpd_data;
-
 	if (!pm_clk_no_clocks(dev))
 		pm_clk_destroy(dev);
-	genpd_data = dev_gpd_data(dev);
-	genpd_data->data = NULL;
 }
 
 static int omap_prm_domain_init(struct device *dev, struct omap_prm *prm)
Signature · 1 line
2.43.0
#3 lore raw

PATCH 3/3 pmdomain: core: Remove unused generic_pm_domain_data.data

In reply to Geert Uytterhoeven

This reverts commit a5ea7a0fcbd7376b2c9fcb15fe59fec298c9ce9f.

The data pointer was added to the generic_pm_domain_data structure specifically for use by the TI SCI Generic Power Domain Driver, but that driver stopped using it in commit efa5c01cd7ee2042 ("soc: ti:
ti_sci_pm_domains: switch to use multiple genpds instead of one"). A new dummy user appeared in commit 58cbff023bfaeb9c ("soc: ti:
omap-prm: Add basic power domain support"), probably inspired by the former, but it was removed, too.

---
 include/linux/pm_domain.h | 1 -
 1 file changed, 1 deletion(-)
include/linux/pm_domain.h +0 -1
index d65ee8b3725c1bcb..0f2a9bf48c3e388d 100644
@@ -304,7 +304,6 @@ struct generic_pm_domain_data {
 	unsigned int opp_token;
 	bool hw_mode;
 	bool rpm_always_on;
-	void *data;
 };
 
 #ifdef CONFIG_PM_GENERIC_DOMAINS
Signature · 1 line
2.43.0