Skip to contentSkip to conversation

constify dev_pm_ops structures

PATCH New Gustavo A. R. Silva 1 participant 4 messages Jul 17, 2017

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

cover constify dev_pm_ops structures

This patchset aims to constify all dev_pm_ops structures that only stored in the pm field of a device_driver structure. This field is declared const, so dev_pm_ops structures that have this property can be declared as const also.

Thanks!

Gustavo A. R. Silva (3):
ASoC: fsi: constify dev_pm_ops structure
ASoC: psc-ac97: constify dev_pm_ops structure
ASoC: au1x: psc-i2s: constify dev_pm_ops structure

 sound/soc/au1x/psc-ac97.c | 2 +-
 sound/soc/au1x/psc-i2s.c  | 2 +-
 sound/soc/sh/fsi.c        | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
2.5.0
#1 lore raw

PATCH 1/3 ASoC: fsi: constify dev_pm_ops structure

This dev_pm_ops structure is only stored in the pm field of a device_driver structure. This field is declared const, so dev_pm_ops structures that have this property can be declared as const also.

---
 sound/soc/sh/fsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/sh/fsi.c +1 -1
index 7c4bdd8..005b215 100644
@@ -2109,7 +2109,7 @@ static int fsi_resume(struct device *dev)
 	return 0;
 }
 
-static struct dev_pm_ops fsi_pm_ops = {
+static const struct dev_pm_ops fsi_pm_ops = {
 	.suspend		= fsi_suspend,
 	.resume			= fsi_resume,
 };
Signature · 1 line
2.5.0
#2 lore raw

PATCH 2/3 ASoC: psc-ac97: constify dev_pm_ops structure

In reply to Gustavo A. R. Silva

This dev_pm_ops structure is only stored in the pm field of a device_driver structure. This field is declared const, so dev_pm_ops structures that have this property can be declared as const also.

---
 sound/soc/au1x/psc-ac97.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/au1x/psc-ac97.c +1 -1
index bb53c70..a2050ae 100644
@@ -474,7 +474,7 @@ static int au1xpsc_ac97_drvresume(struct device *dev)
 	return 0;
 }
 
-static struct dev_pm_ops au1xpscac97_pmops = {
+static const struct dev_pm_ops au1xpscac97_pmops = {
 	.suspend	= au1xpsc_ac97_drvsuspend,
 	.resume		= au1xpsc_ac97_drvresume,
 };
Signature · 1 line
2.5.0
#3 lore raw

PATCH 3/3 ASoC: au1x: psc-i2s: constify dev_pm_ops structure

In reply to Gustavo A. R. Silva

This dev_pm_ops structure is only stored in the pm field of a device_driver structure. This field is declared const, so dev_pm_ops structures that have this property can be declared as const also.

---
 sound/soc/au1x/psc-i2s.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/au1x/psc-i2s.c +1 -1
index 0bf9d62..e6eec08 100644
@@ -392,7 +392,7 @@ static int au1xpsc_i2s_drvresume(struct device *dev)
 	return 0;
 }
 
-static struct dev_pm_ops au1xpsci2s_pmops = {
+static const struct dev_pm_ops au1xpsci2s_pmops = {
 	.suspend	= au1xpsc_i2s_drvsuspend,
 	.resume		= au1xpsc_i2s_drvresume,
 };
Signature · 1 line
2.5.0