IIO: switch easy cases to new simpler PM related macros.
Subsystems (23)
Jonathan Cameron
maintainercover IIO: switch easy cases to new simpler PM related macros.
From: Jonathan Cameron <[email protected]>
After Paul's work [1] to cleanup us the PM related macros allow
use of pm_ptr() and pm_sleep_ptr() making the compiler figure
out what structures and functions can be dropped without __maybe_unused
mess, I've been working through converting IIO.
[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/include/linux/pm.h?id=c06ef740d401d0f4ab188882bf6f8d9cf0f75eaf
This particular set is the low hanging fruit. The majority of the remainder in IIO require more thought because:
1) They only have runtime pm callbacks, but no sleep ones. Need to check there is no reason we can't use use the force_runtime_suspend approach.
2) Odd cases like using same functions for sleep and runtime pm but not via force runtime suspend.
3) Other weird corner cases where I want to take a closer look before sending them out (I think some of them are buggy).
Anyhow, whilst I've CC'd a lot of people I suspect some will no longer be active on these addresses - hence if anyone has time to look at a few patches rather than just the ones for drivers they maintain that would be much appreciated. In some cases I haven't CC'd anyone on a particular patch because I'm fairly sure the author is not longer at the same address. Any review of those ones in particular would be great.
Thanks,
Jonathan
Jonathan Cameron (36):
iio: accel: bma220: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and
pm_sleep_ptr()
iio: adc: ad799x: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and
pm_sleep_ptr()
iio: adc: at91-sam5d2: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and
pm_sleep_ptr()
iio: adc: imx7d_adc: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and
pm_sleep_ptr()
iio: adc: meson_saradc: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and
pm_sleep_ptr()
iio: adc: mt6577_auxadc: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and
pm_sleep_ptr()
iio: adc: stmpe-adc: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and
pm_sleep_ptr()
iio: adc: ti-am335x: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and
pm_sleep_ptr()
iio: adc: xilinx-ams: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and
pm_sleep_ptr()
iio: chemical: scd4x: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and
pm_sleep_ptr()
iio: dac: ds4424: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and
pm_sleep_ptr()
iio: dac: ltc1660: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and
pm_sleep_ptr()
iio: dac: max517: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and
pm_sleep_ptr()
iio: dac: max5821: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and
pm_sleep_ptr()
iio: dac: mcp4725: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and
pm_sleep_ptr()
iio: gyro: itg3200: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and
pm_sleep_ptr()
iio: health: afe4403: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and
pm_sleep_ptr()
iio: health: afe4404: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and
pm_sleep_ptr()
iio: light: al3010: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and
pm_sleep_ptr()
iio: light: al3320a: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and
pm_sleep_ptr()
iio: light: as73211: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and
pm_sleep_ptr()
iio: light: bh1750: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and
pm_sleep_ptr()
iio: light: cm3605: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and
pm_sleep_ptr()
iio: proximity: cros_ec_mkbp: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and
pm_sleep_ptr()
iio: temperature: ltc2983: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and
pm_sleep_ptr() iio: light: us5182: Switch from CONFIG_PM guards to pm_ptr() etc
iio: adc: imx8qxp: Switch to DEFINE_RUNTIME_DEV_PM_OPS and pm_ptr()
iio: light: gp2ap002: Switch to DEFINE_RUNTIME_DEV_PM_OPS and pm_ptr()
iio: light: isl29028: Use DEFINE_RUNTIME_DEV_PM_OPS() and pm_ptr()
iio: light: tsl2583: Use DEFINE_RUNTIME_DEV_PM_OPS and pm_ptr()
iio: light: tsl2591: Use DEFINE_RUNTIME_DEV_PM_OPS() and pm_ptr()
iio: light: vcnl4000: Use DEFINE_RUNTIME_DEV_PM_OPS() and pm_ptr()
macros
iio: light: vcnl4035: Use DEFINE_RUNTIME_DEV_PM_OPS() and pm_ptr()
macros
iio: light: veml6030: Use DEFINE_RUNTIME_DEV_PM_OPS() and pm_ptr()
macros
iio: magnetometer: ak8974: Use DEFINE_RUNTIME_DEV_PM_OPS() and
pm_ptr() macros
iio: magn: yas530: Use DEFINE_RUNTIME_DEV_PM_OPS() and pm_ptr() macros
drivers/iio/accel/bma220_spi.c | 8 ++++---- drivers/iio/adc/ad799x.c | 8 ++++---- drivers/iio/adc/at91-sama5d2_adc.c | 9 +++++---- drivers/iio/adc/imx7d_adc.c | 5 +++-- drivers/iio/adc/imx8qxp-adc.c | 13 ++++++------- drivers/iio/adc/meson_saradc.c | 10 +++++----- drivers/iio/adc/mt6577_auxadc.c | 12 ++++++------ drivers/iio/adc/stmpe-adc.c | 6 +++--- drivers/iio/adc/ti_am335x_adc.c | 8 ++++---- drivers/iio/adc/xilinx-ams.c | 8 ++++---- drivers/iio/chemical/scd4x.c | 8 ++++---- drivers/iio/dac/ds4424.c | 8 ++++---- drivers/iio/dac/ltc1660.c | 9 +++++---- drivers/iio/dac/max517.c | 8 ++++---- drivers/iio/dac/max5821.c | 9 +++++---- drivers/iio/dac/mcp4725.c | 9 +++++---- drivers/iio/gyro/itg3200_core.c | 9 +++++---- drivers/iio/health/afe4403.c | 9 +++++---- drivers/iio/health/afe4404.c | 9 +++++---- drivers/iio/light/al3010.c | 8 ++++---- drivers/iio/light/al3320a.c | 9 +++++---- drivers/iio/light/as73211.c | 9 +++++---- drivers/iio/light/bh1750.c | 6 +++--- drivers/iio/light/cm3605.c | 13 +++++-------- drivers/iio/light/gp2ap002.c | 14 +++++--------- drivers/iio/light/isl29028.c | 13 +++++-------- drivers/iio/light/tsl2583.c | 13 +++++-------- drivers/iio/light/tsl2591.c | 12 +++++------- drivers/iio/light/us5182d.c | 8 +++----- drivers/iio/light/vcnl4000.c | 14 +++++--------- drivers/iio/light/vcnl4035.c | 14 +++++--------- drivers/iio/light/veml6030.c | 14 +++++--------- drivers/iio/magnetometer/ak8974.c | 14 +++++--------- drivers/iio/magnetometer/yamaha-yas530.c | 14 +++++--------- drivers/iio/proximity/cros_ec_mkbp_proximity.c | 8 ++++---- drivers/iio/temperature/ltc2983.c | 9 +++++---- 36 files changed, 165 insertions(+), 192 deletions(-)
Signature · 1 line
2.36.1
Jonathan Cameron
maintainerPATCH 1/36 iio: accel: bma220: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
From: Jonathan Cameron <[email protected]>
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused.
--- drivers/iio/accel/bma220_spi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/iio/accel/bma220_spi.c +4 -4
@@ -289,20 +289,20 @@ static int bma220_probe(struct spi_device *spi)return devm_iio_device_register (&spi->dev, indio_dev); } -static __maybe_unused int bma220_suspend (struct device *dev) +static int bma220_suspend (struct device *dev) {struct spi_device *spi =to_spi_device (dev);return bma220_power (spi, false); } -static __maybe_unused int bma220_resume (struct device *dev) +static int bma220_resume (struct device *dev) {struct spi_device *spi =to_spi_device (dev);return bma220_power (spi, true); } -static SIMPLE_DEV_PM_OPS(bma220_pm_ops, bma220_suspend, bma220_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(bma220_pm_ops, bma220_suspend, bma220_resume);static const struct spi_device_id bma220_spi_id[] = { {"bma220" ,0 },
@@ -318,7 +318,7 @@ MODULE_DEVICE_TABLE(spi, bma220_spi_id);static struct spi_driver bma220_driver = { .driver = { .name ="bma220_spi" , - .pm = &bma220_pm_ops, + .pm =pm_sleep_ptr (&bma220_pm_ops), .acpi_match_table = bma220_acpi_id, }, .probe = bma220_probe,
Signature · 1 line
2.36.1
Jonathan Cameron
maintainerPATCH 2/36 iio: adc: ad799x: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused.
--- drivers/iio/adc/ad799x.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/iio/adc/ad799x.c +4 -4
@@ -896,7 +896,7 @@ static int ad799x_remove(struct i2c_client *client)return 0 ; } -static int __maybe_unused ad799x_suspend (struct device *dev) +static int ad799x_suspend (struct device *dev) {struct iio_dev *indio_dev =i2c_get_clientdata (to_i2c_client (dev));struct ad799x_state *st =iio_priv (indio_dev);
@@ -908,7 +908,7 @@ static int __maybe_unused ad799x_suspend(struct device *dev)return 0 ; } -static int __maybe_unused ad799x_resume (struct device *dev) +static int ad799x_resume (struct device *dev) {struct iio_dev *indio_dev =i2c_get_clientdata (to_i2c_client (dev));struct ad799x_state *st =iio_priv (indio_dev);
@@ -941,7 +941,7 @@ static int __maybe_unused ad799x_resume(struct device *dev)return 0 ; } -static SIMPLE_DEV_PM_OPS(ad799x_pm_ops, ad799x_suspend, ad799x_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(ad799x_pm_ops, ad799x_suspend, ad799x_resume);static const struct i2c_device_id ad799x_id[] = { {"ad7991" , ad7991 },
@@ -960,7 +960,7 @@ MODULE_DEVICE_TABLE(i2c, ad799x_id);static struct i2c_driver ad799x_driver = { .driver = { .name ="ad799x" , - .pm = &ad799x_pm_ops, + .pm =pm_sleep_ptr (&ad799x_pm_ops), }, .probe = ad799x_probe, .remove = ad799x_remove,
Signature · 1 line
2.36.1
Jonathan Cameron
maintainerPATCH 3/36 iio: adc: at91-sam5d2: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused.
--- drivers/iio/adc/at91-sama5d2_adc.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/iio/adc/at91-sama5d2_adc.c +5 -4
@@ -2103,7 +2103,7 @@ static int at91_adc_remove(struct platform_device *pdev)return 0 ; } -static __maybe_unused int at91_adc_suspend (struct device *dev) +static int at91_adc_suspend (struct device *dev) {struct iio_dev *indio_dev =dev_get_drvdata (dev);struct at91_adc_state *st =iio_priv (indio_dev);
@@ -2123,7 +2123,7 @@ static __maybe_unused int at91_adc_suspend(struct device *dev)return pinctrl_pm_select_sleep_state (dev); } -static __maybe_unused int at91_adc_resume (struct device *dev) +static int at91_adc_resume (struct device *dev) {struct iio_dev *indio_dev =dev_get_drvdata (dev);struct at91_adc_state *st =iio_priv (indio_dev);
@@ -2169,7 +2169,8 @@ static __maybe_unused int at91_adc_resume(struct device *dev)return ret; } -static SIMPLE_DEV_PM_OPS(at91_adc_pm_ops, at91_adc_suspend, at91_adc_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(at91_adc_pm_ops, at91_adc_suspend, + at91_adc_resume);static const struct of_device_id at91_adc_dt_match[] = { {
@@ -2190,7 +2191,7 @@ static struct platform_driver at91_adc_driver = { .driver = { .name = "at91-sama5d2_adc", .of_match_table = at91_adc_dt_match, - .pm = &at91_adc_pm_ops, + .pm = pm_sleep_ptr(&at91_adc_pm_ops), }, };module_platform_driver (at91_adc_driver)
Signature · 1 line
2.36.1
Jonathan Cameron
maintainerPATCH 4/36 iio: adc: imx7d_adc: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
In this case we only gain the ability to have the compiler drop the struct dev_pm_ops because the callbacks are called from paths other than suspend and resume. In general the purpose of this new macro is to allow automated removal of the callbacks as well, but that doesn't apply here.
--- drivers/iio/adc/imx7d_adc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/iio/adc/imx7d_adc.c +3 -2
@@ -540,14 +540,15 @@ static int imx7d_adc_probe(struct platform_device *pdev)return 0 ; } -static SIMPLE_DEV_PM_OPS(imx7d_adc_pm_ops, imx7d_adc_disable, imx7d_adc_enable); +static DEFINE_SIMPLE_DEV_PM_OPS(imx7d_adc_pm_ops, imx7d_adc_disable, + imx7d_adc_enable);static struct platform_driver imx7d_adc_driver = { .probe = imx7d_adc_probe, .driver = { .name ="imx7d_adc" , .of_match_table = imx7d_adc_match, - .pm = &imx7d_adc_pm_ops, + .pm =pm_sleep_ptr (&imx7d_adc_pm_ops), }, };
Signature · 1 line
2.36.1
RE: [PATCH 04/36] iio: adc: imx7d_adc: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
Quoted 29 lines
-----Original Message-----
From: Jonathan Cameron <[email protected]>
Sent: 2022年6月22日 4:27
To: [email protected]; Paul Cercueil <[email protected]>
Cc: Alexandre Belloni <[email protected]>; Brian Masney <[email protected]>; David Heidelberg <[email protected]>; Cai Huoqing <[email protected]>; Christian Eggers <[email protected]>; Enric Balletbo i Serra <[email protected]>; Eugen Hristev <[email protected]>; Gwendal Grignou <[email protected]>; Bough Chen <[email protected]>; Hui Liu <[email protected]>; Joe Sandom <[email protected]>; Ismail H . Kose <[email protected]>; Lars-Peter Clausen <[email protected]>; Linus Walleij <[email protected]>; Ludovic Desroches <[email protected]>; Nicolas Ferre <[email protected]>; Marcus Folkesson <[email protected]>; Martin Blumenstingl <[email protected]>; Mathieu Othacehe <[email protected]>; Michal Simek <[email protected]>; Miquel Raynal <[email protected]>; Nuno Sá <[email protected]>; Parthiban Nallathambi <[email protected]>; Philippe Reynes <[email protected]>; Philippe Schenker <[email protected]>; Rishi Gupta <[email protected]>; Roan van Dijk <[email protected]>; Stephen Boyd <[email protected]>; Tomasz Duszynski <[email protected]>; Zhiyong Tao <[email protected]>; Jonathan Cameron <[email protected]>
Subject: [PATCH 04/36] iio: adc:imx7d_adc: Switch toDEFINE_SIMPLE_DEV_PM_OPS()andpm_sleep_ptr()From: Jonathan Cameron <[email protected]>
Quoted 7 lines
In this case we only gain the ability to have the compiler drop the struct
dev_pm_opsbecause the callbacks are called from paths other than suspend and resume. In general the purpose of this new macro is to allow automated removal of the callbacks as well, but that doesn't apply here.Signed-off-by Jonathan Cameron <[email protected]>Cc Haibo Chen <[email protected]>
Quoted 31 lines
--- drivers/iio/adc/imx7d_adc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/iio/adc/imx7d_adc.c index renamed from drivers/iio/adc/imx7d_adc.c +0
-0
119217af2bde..86caff1d006b100644drivers/iio/adc/imx7d_adc.c +3
-2@@ -540,14 +540,15 @@ static int imx7d_adc_probe(struct platform_device *pdev)return 0 ; } -static SIMPLE_DEV_PM_OPS(imx7d_adc_pm_ops, imx7d_adc_disable, imx7d_adc_enable); +static DEFINE_SIMPLE_DEV_PM_OPS(imx7d_adc_pm_ops, imx7d_adc_disable, + imx7d_adc_enable);static struct platform_driver imx7d_adc_driver = { .probe = imx7d_adc_probe, .driver = { .name ="imx7d_adc" , .of_match_table = imx7d_adc_match, - .pm = &imx7d_adc_pm_ops, + .pm =pm_sleep_ptr (&imx7d_adc_pm_ops),},
};--
2.36.1
Jonathan Cameron
maintainerPATCH 5/36 iio: adc: meson_saradc: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused.
--- drivers/iio/adc/meson_saradc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/iio/adc/meson_saradc.c +5 -5
@@ -1281,22 +1281,22 @@ static int meson_sar_adc_remove(struct platform_device *pdev)return meson_sar_adc_hw_disable (indio_dev); } -static int __maybe_unused meson_sar_adc_suspend (struct device *dev) +static int meson_sar_adc_suspend (struct device *dev) {struct iio_dev *indio_dev =dev_get_drvdata (dev);return meson_sar_adc_hw_disable (indio_dev); } -static int __maybe_unused meson_sar_adc_resume (struct device *dev) +static int meson_sar_adc_resume (struct device *dev) {struct iio_dev *indio_dev =dev_get_drvdata (dev);return meson_sar_adc_hw_enable (indio_dev); } -static SIMPLE_DEV_PM_OPS(meson_sar_adc_pm_ops, - meson_sar_adc_suspend, meson_sar_adc_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(meson_sar_adc_pm_ops, + meson_sar_adc_suspend, meson_sar_adc_resume);static struct platform_driver meson_sar_adc_driver = { .probe = meson_sar_adc_probe,
@@ -1304,7 +1304,7 @@ static struct platform_driver meson_sar_adc_driver = { .driver = { .name = "meson-saradc", .of_match_table = meson_sar_adc_of_match, - .pm = &meson_sar_adc_pm_ops, + .pm = pm_sleep_ptr(&meson_sar_adc_pm_ops), }, };
Signature · 1 line
2.36.1
Re: [PATCH 05/36] iio: adc: meson_saradc: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
Quoted 9 lines · Jonathan Cameron
From: Jonathan Cameron <[email protected]>
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions
__maybe_unused.Signed-off-by Jonathan Cameron <[email protected]>Cc Martin Blumenstingl <[email protected]>
Jonathan Cameron
maintainerPATCH 6/36 iio: adc: mt6577_auxadc: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused.
--- drivers/iio/adc/mt6577_auxadc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/iio/adc/mt6577_auxadc.c +6 -6
@@ -215,7 +215,7 @@ static const struct iio_info mt6577_auxadc_info = { .read_raw = &mt6577_auxadc_read_raw, }; -static int __maybe_unused mt6577_auxadc_resume (struct device *dev) +static int mt6577_auxadc_resume (struct device *dev) {struct iio_dev *indio_dev =dev_get_drvdata (dev);struct mt6577_auxadc_device *adc_dev =iio_priv (indio_dev);
@@ -234,7 +234,7 @@ static int __maybe_unused mt6577_auxadc_resume(struct device *dev)return 0 ; } -static int __maybe_unused mt6577_auxadc_suspend (struct device *dev) +static int mt6577_auxadc_suspend (struct device *dev) {struct iio_dev *indio_dev =dev_get_drvdata (dev);struct mt6577_auxadc_device *adc_dev =iio_priv (indio_dev);
@@ -330,9 +330,9 @@ static int mt6577_auxadc_remove(struct platform_device *pdev)return 0 ; } -static SIMPLE_DEV_PM_OPS(mt6577_auxadc_pm_ops, - mt6577_auxadc_suspend, - mt6577_auxadc_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(mt6577_auxadc_pm_ops, + mt6577_auxadc_suspend, + mt6577_auxadc_resume);static const struct of_device_id mt6577_auxadc_of_match[] = { { .compatible ="mediatek,mt2701-auxadc" , .data = &mt8173_compat },
@@ -349,7 +349,7 @@ static struct platform_driver mt6577_auxadc_driver = { .driver = { .name = "mt6577-auxadc", .of_match_table = mt6577_auxadc_of_match, - .pm = &mt6577_auxadc_pm_ops, + .pm = pm_sleep_ptr(&mt6577_auxadc_pm_ops), }, .probe = mt6577_auxadc_probe, .remove = mt6577_auxadc_remove,
Signature · 1 line
2.36.1
Jonathan Cameron
maintainerPATCH 7/36 iio: adc: stmpe-adc: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused. This one is a little unusual as no suspend callback, but the cleanup is still worthwhile (and eventual aim is to get rid of old macro).
--- drivers/iio/adc/stmpe-adc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/iio/adc/stmpe-adc.c +3 -3
@@ -333,7 +333,7 @@ static int stmpe_adc_probe(struct platform_device *pdev)return devm_iio_device_register (&pdev->dev, indio_dev); } -static int __maybe_unused stmpe_adc_resume (struct device *dev) +static int stmpe_adc_resume (struct device *dev) {struct iio_dev *indio_dev =dev_get_drvdata (dev);struct stmpe_adc *info =iio_priv (indio_dev);
@@ -343,7 +343,7 @@ static int __maybe_unused stmpe_adc_resume(struct device *dev)return 0 ; } -static SIMPLE_DEV_PM_OPS(stmpe_adc_pm_ops, NULL, stmpe_adc_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(stmpe_adc_pm_ops, NULL, stmpe_adc_resume);static const struct of_device_id stmpe_adc_ids[] = { { .compatible ="st,stmpe-adc" , },
@@ -355,7 +355,7 @@ static struct platform_driver stmpe_adc_driver = { .probe = stmpe_adc_probe, .driver = { .name = "stmpe-adc", - .pm = &stmpe_adc_pm_ops, + .pm = pm_sleep_ptr(&stmpe_adc_pm_ops), .of_match_table = stmpe_adc_ids, }, };
Signature · 1 line
2.36.1
Jonathan Cameron
maintainerPATCH 8/36 iio: adc: ti-am335x: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused.
--- drivers/iio/adc/ti_am335x_adc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/iio/adc/ti_am335x_adc.c +4 -4
@@ -702,7 +702,7 @@ static int tiadc_remove(struct platform_device *pdev)return 0 ; } -static int __maybe_unused tiadc_suspend (struct device *dev) +static int tiadc_suspend (struct device *dev) {struct iio_dev *indio_dev =dev_get_drvdata (dev);struct tiadc_device *adc_dev =iio_priv (indio_dev);
@@ -715,7 +715,7 @@ static int __maybe_unused tiadc_suspend(struct device *dev)return 0 ; } -static int __maybe_unused tiadc_resume (struct device *dev) +static int tiadc_resume (struct device *dev) {struct iio_dev *indio_dev =dev_get_drvdata (dev);struct tiadc_device *adc_dev =iio_priv (indio_dev);
@@ -732,7 +732,7 @@ static int __maybe_unused tiadc_resume(struct device *dev)return 0 ; } -static SIMPLE_DEV_PM_OPS(tiadc_pm_ops, tiadc_suspend, tiadc_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(tiadc_pm_ops, tiadc_suspend, tiadc_resume);static const struct of_device_id ti_adc_dt_ids[] = { { .compatible ="ti,am3359-adc" , },
@@ -744,7 +744,7 @@ MODULE_DEVICE_TABLE(of, ti_adc_dt_ids);static struct platform_driver tiadc_driver = { .driver = { .name ="TI-am335x-adc" , - .pm = &tiadc_pm_ops, + .pm =pm_sleep_ptr (&tiadc_pm_ops), .of_match_table = ti_adc_dt_ids, }, .probe = tiadc_probe,
Signature · 1 line
2.36.1
Re: [PATCH 08/36] iio: adc: ti-am335x: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
Hi Jonathan,
(second try, with a reply all...)
[email protected] wrote on Tue, 21 Jun 2022 21:26:51 +0100:
Quoted 8 lines
From: Jonathan Cameron <[email protected]>
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions
__maybe_unused.Signed-off-by Jonathan Cameron <[email protected]>Cc Miquel Raynal <[email protected]>
Thanks,
Miquèl
Jonathan Cameron
maintainerPATCH 9/36 iio: adc: xilinx-ams: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused.
--- drivers/iio/adc/xilinx-ams.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/iio/adc/xilinx-ams.c +4 -4
@@ -1421,7 +1421,7 @@ static int ams_probe(struct platform_device *pdev)return devm_iio_device_register (&pdev->dev, indio_dev); } -static int __maybe_unused ams_suspend (struct device *dev) +static int ams_suspend (struct device *dev) {struct ams *ams =iio_priv (dev_get_drvdata (dev));
@@ -1430,20 +1430,20 @@ static int __maybe_unused ams_suspend(struct device *dev)return 0 ; } -static int __maybe_unused ams_resume (struct device *dev) +static int ams_resume (struct device *dev) {struct ams *ams =iio_priv (dev_get_drvdata (dev));return clk_prepare_enable (ams->clk); } -static SIMPLE_DEV_PM_OPS(ams_pm_ops, ams_suspend, ams_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(ams_pm_ops, ams_suspend, ams_resume);static struct platform_driver ams_driver = { .probe = ams_probe, .driver = { .name ="xilinx-ams" , - .pm = &ams_pm_ops, + .pm =pm_sleep_ptr (&ams_pm_ops), .of_match_table = ams_of_match_table, }, };
Signature · 1 line
2.36.1
Jonathan Cameron
maintainerPATCH 10/36 iio: chemical: scd4x: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused.
--- drivers/iio/chemical/scd4x.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/iio/chemical/scd4x.c +4 -4
@@ -551,7 +551,7 @@ static const struct iio_chan_spec scd4x_channels[] = { }, }; -static int __maybe_unused scd4x_suspend (struct device *dev) +static int scd4x_suspend (struct device *dev) {struct iio_dev *indio_dev =dev_get_drvdata (dev);struct scd4x_state *state =iio_priv (indio_dev);
@@ -564,7 +564,7 @@ static int __maybe_unused scd4x_suspend(struct device *dev)return regulator_disable (state->vdd); } -static int __maybe_unused scd4x_resume (struct device *dev) +static int scd4x_resume (struct device *dev) {struct iio_dev *indio_dev =dev_get_drvdata (dev);struct scd4x_state *state =iio_priv (indio_dev);
@@ -577,7 +577,7 @@ static int __maybe_unused scd4x_resume(struct device *dev)return scd4x_send_command (state,CMD_START_MEAS ); } -static __maybe_unused SIMPLE_DEV_PM_OPS(scd4x_pm_ops, scd4x_suspend, scd4x_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(scd4x_pm_ops, scd4x_suspend, scd4x_resume);static void scd4x_stop_meas (void *state) {
@@ -688,7 +688,7 @@ static struct i2c_driver scd4x_i2c_driver = { .driver = { .name = KBUILD_MODNAME, .of_match_table = scd4x_dt_ids, - .pm = &scd4x_pm_ops + .pm = pm_sleep_ptr(&scd4x_pm_ops), }, .probe = scd4x_probe, };
Signature · 1 line
2.36.1
Jonathan Cameron
maintainerPATCH 11/36 iio: dac: ds4424: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused.
--- drivers/iio/dac/ds4424.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/iio/dac/ds4424.c +4 -4
@@ -171,7 +171,7 @@ static int ds4424_verify_chip(struct iio_dev *indio_dev)return ret; } -static int __maybe_unused ds4424_suspend (struct device *dev) +static int ds4424_suspend (struct device *dev) {struct i2c_client *client =to_i2c_client (dev);struct iio_dev *indio_dev =i2c_get_clientdata (client);
@@ -189,7 +189,7 @@ static int __maybe_unused ds4424_suspend(struct device *dev)return ret; } -static int __maybe_unused ds4424_resume (struct device *dev) +static int ds4424_resume (struct device *dev) {struct i2c_client *client =to_i2c_client (dev);struct iio_dev *indio_dev =i2c_get_clientdata (client);
@@ -206,7 +206,7 @@ static int __maybe_unused ds4424_resume(struct device *dev)return ret; } -static SIMPLE_DEV_PM_OPS(ds4424_pm_ops, ds4424_suspend, ds4424_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(ds4424_pm_ops, ds4424_suspend, ds4424_resume);static const struct iio_info ds4424_info = { .read_raw = ds4424_read_raw,
@@ -312,7 +312,7 @@ static struct i2c_driver ds4424_driver = { .driver = { .name = "ds4424", .of_match_table = ds4424_of_match, - .pm = &ds4424_pm_ops, + .pm = pm_sleep_ptr(&ds4424_pm_ops), }, .probe = ds4424_probe, .remove = ds4424_remove,
Signature · 1 line
2.36.1
A message that is not in the archive (sent off-list or not yet received): CABEhyf8EezacO8hSCDtz8kDnWeTWFJYBz0XJufjmyprv5u3rmw@mail.gmail.com
Jonathan Cameron
maintainerRe: [PATCH 11/36] iio: dac: ds4424: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
Quoted 2 lines · On Thu, 23 Jun 2022 11:04:12 -0700 Ismail Kose <[email protected]> wrote:
signed-off
ismail.
Hi Ismail,
Thanks for taking a look.
As with the other one, please reply with an
Acked-by tag fully stated as that's what we need to apply it to the patch (and what automated tooling like b4 will be looking for.
Thanks,
Jonathan
Quoted 64 lines · Jonathan Cameron
Quoted 61 lines
From: Jonathan Cameron <[email protected]>
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions
__maybe_unused.Signed-off-by Jonathan Cameron <[email protected]>Cc Ismail H. Kose <[email protected]>--- drivers/iio/dac/ds4424.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/iio/dac/ds4424.c +1
-1@@ -171,7 +171,7 @@ static int ds4424_verify_chip(struct iio_dev *indio_dev)return ret; } -static int __maybe_unused ds4424_suspend (struct device *dev) +static int ds4424_suspend (struct device *dev) {struct i2c_client *client =to_i2c_client (dev);struct iio_dev *indio_dev = i2c_get_clientdata(client);drivers/iio/dac/ds4424.c +1
-1@@ -189,7 +189,7 @@ static int __maybe_unused ds4424_suspend(struct device *dev)return ret; } -static int __maybe_unused ds4424_resume (struct device *dev) +static int ds4424_resume (struct device *dev) {struct i2c_client *client =to_i2c_client (dev);struct iio_dev *indio_dev = i2c_get_clientdata(client);drivers/iio/dac/ds4424.c +1
-1@@ -206,7 +206,7 @@ static int __maybe_unused ds4424_resume(struct device *dev)return ret; } -static SIMPLE_DEV_PM_OPS(ds4424_pm_ops, ds4424_suspend, ds4424_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(ds4424_pm_ops, ds4424_suspend, ds4424_resume);static const struct iio_info ds4424_info = { .read_raw = ds4424_read_raw,drivers/iio/dac/ds4424.c +1
-2@@ -312,7 +312,7 @@ static struct i2c_driver ds4424_driver = { .driver = { .name = "ds4424", .of_match_table = ds4424_of_match, - .pm = &ds4424_pm_ops, + .pm = pm_sleep_ptr(&ds4424_pm_ops), }, .probe = ds4424_probe, .remove = ds4424_remove, --2.36.1
Jonathan Cameron
maintainerPATCH 12/36 iio: dac: ltc1660: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused.
--- drivers/iio/dac/ltc1660.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/iio/dac/ltc1660.c +5 -4
@@ -137,20 +137,21 @@ static const struct iio_info ltc1660_info = { .write_raw = <c1660_write_raw, }; -static int __maybe_unused ltc1660_suspend (struct device *dev) +static int ltc1660_suspend (struct device *dev) {struct ltc1660_priv *priv =iio_priv (spi_get_drvdata (to_spi_device (dev)));return regmap_write (priv->regmap,LTC1660_REG_SLEEP ,0x00 ); } -static int __maybe_unused ltc1660_resume (struct device *dev) +static int ltc1660_resume (struct device *dev) {struct ltc1660_priv *priv =iio_priv (spi_get_drvdata (to_spi_device (dev)));return regmap_write (priv->regmap,LTC1660_REG_WAKE ,0x00 ); } -static SIMPLE_DEV_PM_OPS(ltc1660_pm_ops, ltc1660_suspend, ltc1660_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(ltc1660_pm_ops, ltc1660_suspend, + ltc1660_resume);static int ltc1660_probe (struct spi_device *spi) {
@@ -233,7 +234,7 @@ static struct spi_driver ltc1660_driver = { .driver = { .name = "ltc1660", .of_match_table = ltc1660_dt_ids, - .pm = <c1660_pm_ops, + .pm = pm_sleep_ptr(<c1660_pm_ops), }, .probe = ltc1660_probe, .remove = ltc1660_remove,
Signature · 1 line
2.36.1
Re: [PATCH 12/36] iio: dac: ltc1660: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
Quoted 9 lines · Jonathan Cameron
From: Jonathan Cameron <[email protected]>
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions
__maybe_unused.Signed-off-by Jonathan Cameron <[email protected]>Cc Marcus Folkesson <[email protected]>---
Jonathan Cameron
maintainerPATCH 13/36 iio: dac: max517: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused.
--- drivers/iio/dac/max517.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/iio/dac/max517.c +4 -4
@@ -100,21 +100,21 @@ static int max517_write_raw(struct iio_dev *indio_dev,return ret; } -static int __maybe_unused max517_suspend (struct device *dev) +static int max517_suspend (struct device *dev) {u8 outbuf =COMMAND_PD ;return i2c_master_send (to_i2c_client (dev), &outbuf,1 ); } -static int __maybe_unused max517_resume (struct device *dev) +static int max517_resume (struct device *dev) {u8 outbuf =0 ;return i2c_master_send (to_i2c_client (dev), &outbuf,1 ); } -static SIMPLE_DEV_PM_OPS(max517_pm_ops, max517_suspend, max517_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(max517_pm_ops, max517_suspend, max517_resume);static const struct iio_info max517_info = { .read_raw = max517_read_raw,
@@ -201,7 +201,7 @@ MODULE_DEVICE_TABLE(i2c, max517_id);static struct i2c_driver max517_driver = { .driver = { .name =MAX517_DRV_NAME , - .pm = &max517_pm_ops, + .pm =pm_sleep_ptr (&max517_pm_ops), }, .probe = max517_probe, .id_table = max517_id,
Signature · 1 line
2.36.1
Jonathan Cameron
maintainerPATCH 14/36 iio: dac: max5821: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused.
--- drivers/iio/dac/max5821.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/iio/dac/max5821.c +5 -4
@@ -267,7 +267,7 @@ static int max5821_write_raw(struct iio_dev *indio_dev, } } -static int __maybe_unused max5821_suspend(struct device *dev) +static int max5821_suspend(struct device *dev) { u8 outbuf[2] = { MAX5821_EXTENDED_COMMAND_MODE, MAX5821_EXTENDED_DAC_A |
@@ -277,7 +277,7 @@ static int __maybe_unused max5821_suspend(struct device *dev)return i2c_master_send (to_i2c_client (dev), outbuf,2 ); } -static int __maybe_unused max5821_resume(struct device *dev) +static int max5821_resume(struct device *dev) { u8 outbuf[2] = { MAX5821_EXTENDED_COMMAND_MODE, MAX5821_EXTENDED_DAC_A |
@@ -287,7 +287,8 @@ static int __maybe_unused max5821_resume(struct device *dev)return i2c_master_send (to_i2c_client (dev), outbuf,2 ); } -static SIMPLE_DEV_PM_OPS(max5821_pm_ops, max5821_suspend, max5821_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(max5821_pm_ops, max5821_suspend, + max5821_resume);static const struct iio_info max5821_info = { .read_raw = max5821_read_raw,
@@ -374,7 +375,7 @@ static struct i2c_driver max5821_driver = { .driver = { .name = "max5821", .of_match_table = max5821_of_match, - .pm = &max5821_pm_ops, + .pm = pm_sleep_ptr(&max5821_pm_ops), }, .probe = max5821_probe, .id_table = max5821_id,
Signature · 1 line
2.36.1
A message that is not in the archive (sent off-list or not yet received): CABEhyf-N-hi7z3SQK4FRWyztwJ=3t17NZT-gGCEugQhUkpcZQA@mail.gmail.com
Jonathan Cameron
maintainerRe: [PATCH 14/36] iio: dac: max5821: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
Quoted 2 lines · On Thu, 23 Jun 2022 10:58:30 -0700 Ismail Kose <[email protected]> wrote:
Signed-off
ismail
Tag for this would be
Acked-by
as you aren't involved in the sign of chain for this one, rather you are reviewing.
If you can confirm that it would be much appreciated.
Quoted 63 lines · Jonathan Cameron
Quoted 60 lines
From: Jonathan Cameron <[email protected]>
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions
__maybe_unused.Signed-off-by Jonathan Cameron <[email protected]>Cc Philippe Reynes <[email protected]>--- drivers/iio/dac/max5821.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)drivers/iio/dac/max5821.c +2
-2@@ -267,7 +267,7 @@ static int max5821_write_raw(struct iio_dev *indio_dev, } } -static int __maybe_unused max5821_suspend(struct device *dev) +static int max5821_suspend(struct device *dev) { u8 outbuf[2] = { MAX5821_EXTENDED_COMMAND_MODE, MAX5821_EXTENDED_DAC_A |@@ -277,7 +277,7 @@ static int __maybe_unused max5821_suspend(struct device *dev)return i2c_master_send (to_i2c_client (dev), outbuf,2 ); } -static int __maybe_unused max5821_resume (struct device *dev) +static int max5821_resume (struct device *dev) {u8 outbuf[2 ] = {MAX5821_EXTENDED_COMMAND_MODE ,MAX5821_EXTENDED_DAC_A |drivers/iio/dac/max5821.c +2
-1@@ -287,7 +287,8 @@ static int __maybe_unused max5821_resume(struct device *dev)return i2c_master_send (to_i2c_client (dev), outbuf,2 ); } -static SIMPLE_DEV_PM_OPS(max5821_pm_ops, max5821_suspend, max5821_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(max5821_pm_ops, max5821_suspend, + max5821_resume);static const struct iio_info max5821_info = {.read_raw = max5821_read_raw,drivers/iio/dac/max5821.c +1
-2@@ -374,7 +375,7 @@ static struct i2c_driver max5821_driver = { .driver = { .name = "max5821", .of_match_table = max5821_of_match, - .pm = &max5821_pm_ops, + .pm = pm_sleep_ptr(&max5821_pm_ops), }, .probe = max5821_probe, .id_table = max5821_id, --2.36.1
Jonathan Cameron
maintainerPATCH 15/36 iio: dac: mcp4725: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused.
--- drivers/iio/dac/mcp4725.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/iio/dac/mcp4725.c +5 -4
@@ -42,7 +42,7 @@ struct mcp4725_data {struct regulator *vref_reg; }; -static int __maybe_unused mcp4725_suspend (struct device *dev) +static int mcp4725_suspend (struct device *dev) {struct mcp4725_data *data =iio_priv (i2c_get_clientdata (to_i2c_client (dev)));
@@ -55,7 +55,7 @@ static int __maybe_unused mcp4725_suspend(struct device *dev)return i2c_master_send (data->client, outbuf,2 ); } -static int __maybe_unused mcp4725_resume (struct device *dev) +static int mcp4725_resume (struct device *dev) {struct mcp4725_data *data =iio_priv (i2c_get_clientdata (to_i2c_client (dev)));
@@ -68,7 +68,8 @@ static int __maybe_unused mcp4725_resume(struct device *dev)return i2c_master_send (data->client, outbuf,2 ); } -static SIMPLE_DEV_PM_OPS(mcp4725_pm_ops, mcp4725_suspend, mcp4725_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(mcp4725_pm_ops, mcp4725_suspend, + mcp4725_resume);static ssize_t mcp4725_store_eeprom (struct device *dev,struct device_attribute *attr,const char *buf,size_t len)
@@ -523,7 +524,7 @@ static struct i2c_driver mcp4725_driver = { .driver = { .name = MCP4725_DRV_NAME, .of_match_table = mcp4725_of_match, - .pm = &mcp4725_pm_ops, + .pm = pm_sleep_ptr(&mcp4725_pm_ops), }, .probe = mcp4725_probe, .remove = mcp4725_remove,
Signature · 1 line
2.36.1
Jonathan Cameron
maintainerPATCH 16/36 iio: gyro: itg3200: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused.
--- drivers/iio/gyro/itg3200_core.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/iio/gyro/itg3200_core.c +5 -4
@@ -364,7 +364,7 @@ static int itg3200_remove(struct i2c_client *client)return 0 ; } -static int __maybe_unused itg3200_suspend (struct device *dev) +static int itg3200_suspend (struct device *dev) {struct iio_dev *indio_dev =dev_get_drvdata (dev);struct itg3200 *st =iio_priv (indio_dev);
@@ -375,14 +375,15 @@ static int __maybe_unused itg3200_suspend(struct device *dev) ITG3200_SLEEP); } -static int __maybe_unused itg3200_resume (struct device *dev) +static int itg3200_resume (struct device *dev) {struct iio_dev *indio_dev =dev_get_drvdata (dev);return itg3200_initial_setup (indio_dev); } -static SIMPLE_DEV_PM_OPS(itg3200_pm_ops, itg3200_suspend, itg3200_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(itg3200_pm_ops, itg3200_suspend, + itg3200_resume);static const struct i2c_device_id itg3200_id[] = { {"itg3200" ,0 },
@@ -400,7 +401,7 @@ static struct i2c_driver itg3200_driver = { .driver = { .name = "itg3200", .of_match_table = itg3200_of_match, - .pm = &itg3200_pm_ops, + .pm = pm_sleep_ptr(&itg3200_pm_ops), }, .id_table = itg3200_id, .probe = itg3200_probe,
Signature · 1 line
2.36.1
Jonathan Cameron
maintainerPATCH 17/36 iio: health: afe4403: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused.
--- drivers/iio/health/afe4403.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/iio/health/afe4403.c +5 -4
@@ -408,7 +408,7 @@ static const struct of_device_id afe4403_of_match[] = { };MODULE_DEVICE_TABLE (of, afe4403_of_match); -static int __maybe_unused afe4403_suspend (struct device *dev) +static int afe4403_suspend (struct device *dev) {struct iio_dev *indio_dev =spi_get_drvdata (to_spi_device (dev));struct afe4403_data *afe =iio_priv (indio_dev);
@@ -429,7 +429,7 @@ static int __maybe_unused afe4403_suspend(struct device *dev)return 0 ; } -static int __maybe_unused afe4403_resume (struct device *dev) +static int afe4403_resume (struct device *dev) {struct iio_dev *indio_dev =spi_get_drvdata (to_spi_device (dev));struct afe4403_data *afe =iio_priv (indio_dev);
@@ -449,7 +449,8 @@ static int __maybe_unused afe4403_resume(struct device *dev)return 0 ; } -static SIMPLE_DEV_PM_OPS(afe4403_pm_ops, afe4403_suspend, afe4403_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(afe4403_pm_ops, afe4403_suspend, + afe4403_resume);static int afe4403_probe (struct spi_device *spi) {
@@ -598,7 +599,7 @@ static struct spi_driver afe4403_spi_driver = { .driver = { .name = AFE4403_DRIVER_NAME, .of_match_table = afe4403_of_match, - .pm = &afe4403_pm_ops, + .pm = pm_sleep_ptr(&afe4403_pm_ops), }, .probe = afe4403_probe, .remove = afe4403_remove,
Signature · 1 line
2.36.1
Jonathan Cameron
maintainerPATCH 18/36 iio: health: afe4404: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused.
--- drivers/iio/health/afe4404.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/iio/health/afe4404.c +5 -4
@@ -415,7 +415,7 @@ static const struct of_device_id afe4404_of_match[] = { };MODULE_DEVICE_TABLE (of, afe4404_of_match); -static int __maybe_unused afe4404_suspend (struct device *dev) +static int afe4404_suspend (struct device *dev) {struct iio_dev *indio_dev =i2c_get_clientdata (to_i2c_client (dev));struct afe4404_data *afe =iio_priv (indio_dev);
@@ -436,7 +436,7 @@ static int __maybe_unused afe4404_suspend(struct device *dev)return 0 ; } -static int __maybe_unused afe4404_resume (struct device *dev) +static int afe4404_resume (struct device *dev) {struct iio_dev *indio_dev =i2c_get_clientdata (to_i2c_client (dev));struct afe4404_data *afe =iio_priv (indio_dev);
@@ -456,7 +456,8 @@ static int __maybe_unused afe4404_resume(struct device *dev)return 0 ; } -static SIMPLE_DEV_PM_OPS(afe4404_pm_ops, afe4404_suspend, afe4404_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(afe4404_pm_ops, afe4404_suspend, + afe4404_resume);static int afe4404_probe (struct i2c_client *client,const struct i2c_device_id *id)
@@ -607,7 +608,7 @@ static struct i2c_driver afe4404_i2c_driver = { .driver = { .name = AFE4404_DRIVER_NAME, .of_match_table = afe4404_of_match, - .pm = &afe4404_pm_ops, + .pm = pm_sleep_ptr(&afe4404_pm_ops), }, .probe = afe4404_probe, .remove = afe4404_remove,
Signature · 1 line
2.36.1
Jonathan Cameron
maintainerPATCH 19/36 iio: light: al3010: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused.
--- drivers/iio/light/al3010.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/iio/light/al3010.c +4 -4
@@ -200,17 +200,17 @@ static int al3010_probe(struct i2c_client *client,return devm_iio_device_register (&client->dev, indio_dev); } -static int __maybe_unused al3010_suspend (struct device *dev) +static int al3010_suspend (struct device *dev) {return al3010_set_pwr (to_i2c_client (dev), false); } -static int __maybe_unused al3010_resume (struct device *dev) +static int al3010_resume (struct device *dev) {return al3010_set_pwr (to_i2c_client (dev), true); } -static SIMPLE_DEV_PM_OPS(al3010_pm_ops, al3010_suspend, al3010_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(al3010_pm_ops, al3010_suspend, al3010_resume);static const struct i2c_device_id al3010_id[] = { {"al3010" , },
@@ -228,7 +228,7 @@ static struct i2c_driver al3010_driver = { .driver = { .name = AL3010_DRV_NAME, .of_match_table = al3010_of_match, - .pm = &al3010_pm_ops, + .pm = pm_sleep_ptr(&al3010_pm_ops), }, .probe = al3010_probe, .id_table = al3010_id,
Signature · 1 line
2.36.1
Re: [PATCH 19/36] iio: light: al3010: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
both patches 19 and 20:
Quoted 46 lines · Jonathan Cameron
From: Jonathan Cameron <[email protected]>
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions
__maybe_unused.Signed-off-by Jonathan Cameron <[email protected]>Cc David Heidelberg <[email protected]>--- drivers/iio/light/al3010.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/iio/light/al3010.c +4
-4@@ -200,17 +200,17 @@ static int al3010_probe(struct i2c_client *client,return devm_iio_device_register (&client->dev, indio_dev); } -static int __maybe_unused al3010_suspend (struct device *dev) +static int al3010_suspend (struct device *dev) {return al3010_set_pwr (to_i2c_client (dev), false); } -static int __maybe_unused al3010_resume (struct device *dev) +static int al3010_resume (struct device *dev) {return al3010_set_pwr (to_i2c_client (dev), true); } -static SIMPLE_DEV_PM_OPS(al3010_pm_ops, al3010_suspend, al3010_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(al3010_pm_ops, al3010_suspend, al3010_resume);static const struct i2c_device_id al3010_id[] = { {"al3010" , },@@ -228,7 +228,7 @@ static struct i2c_driver al3010_driver = { .driver = { .name = AL3010_DRV_NAME, .of_match_table = al3010_of_match, - .pm = &al3010_pm_ops, + .pm = pm_sleep_ptr(&al3010_pm_ops), }, .probe = al3010_probe, .id_table = al3010_id,
Signature · 4 lines
David Heidelberg Consultant Software Engineer Matrix: @okias:matrix.org
Jonathan Cameron
maintainerPATCH 20/36 iio: light: al3320a: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused.
--- drivers/iio/light/al3320a.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/iio/light/al3320a.c +5 -4
@@ -223,17 +223,18 @@ static int al3320a_probe(struct i2c_client *client,return devm_iio_device_register (&client->dev, indio_dev); } -static int __maybe_unused al3320a_suspend (struct device *dev) +static int al3320a_suspend (struct device *dev) {return al3320a_set_pwr (to_i2c_client (dev), false); } -static int __maybe_unused al3320a_resume (struct device *dev) +static int al3320a_resume (struct device *dev) {return al3320a_set_pwr (to_i2c_client (dev), true); } -static SIMPLE_DEV_PM_OPS(al3320a_pm_ops, al3320a_suspend, al3320a_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(al3320a_pm_ops, al3320a_suspend, + al3320a_resume);static const struct i2c_device_id al3320a_id[] = { {"al3320a" ,0 },
@@ -251,7 +252,7 @@ static struct i2c_driver al3320a_driver = { .driver = { .name = AL3320A_DRV_NAME, .of_match_table = al3320a_of_match, - .pm = &al3320a_pm_ops, + .pm = pm_sleep_ptr(&al3320a_pm_ops), }, .probe = al3320a_probe, .id_table = al3320a_id,
Signature · 1 line
2.36.1
Re: [PATCH 20/36] iio: light: al3320a: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
Quoted 8 lines · On Tue, 21 Jun 2022 21:27:03 +0100 Jonathan Cameron <[email protected]> wrote:
From: Jonathan Cameron <[email protected]>
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions
__maybe_unused.Signed-off-by Jonathan Cameron <[email protected]>Cc David Heidelberg <[email protected]>
I'll just copy this here from reply to patch 19 so b4 will do everything automatically for me.
both patches 19 and 20:
Quoted 39 lines
--- drivers/iio/light/al3320a.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)drivers/iio/light/al3320a.c +5
-4@@ -223,17 +223,18 @@ static int al3320a_probe(struct i2c_client *client,return devm_iio_device_register (&client->dev, indio_dev); } -static int __maybe_unused al3320a_suspend (struct device *dev) +static int al3320a_suspend (struct device *dev) {return al3320a_set_pwr (to_i2c_client (dev), false); } -static int __maybe_unused al3320a_resume (struct device *dev) +static int al3320a_resume (struct device *dev) {return al3320a_set_pwr (to_i2c_client (dev), true); } -static SIMPLE_DEV_PM_OPS(al3320a_pm_ops, al3320a_suspend, al3320a_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(al3320a_pm_ops, al3320a_suspend, + al3320a_resume);static const struct i2c_device_id al3320a_id[] = { {"al3320a" ,0 },@@ -251,7 +252,7 @@ static struct i2c_driver al3320a_driver = { .driver = { .name = AL3320A_DRV_NAME, .of_match_table = al3320a_of_match, - .pm = &al3320a_pm_ops, + .pm = pm_sleep_ptr(&al3320a_pm_ops), }, .probe = al3320a_probe, .id_table = al3320a_id,
Jonathan Cameron
maintainerPATCH 21/36 iio: light: as73211: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused.
--- drivers/iio/light/as73211.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/iio/light/as73211.c +5 -4
@@ -755,21 +755,22 @@ static int as73211_probe(struct i2c_client *client)return devm_iio_device_register (dev, indio_dev); } -static int __maybe_unused as73211_suspend (struct device *dev) +static int as73211_suspend (struct device *dev) {struct iio_dev *indio_dev =i2c_get_clientdata (to_i2c_client (dev));return as73211_power (indio_dev, false); } -static int __maybe_unused as73211_resume (struct device *dev) +static int as73211_resume (struct device *dev) {struct iio_dev *indio_dev =i2c_get_clientdata (to_i2c_client (dev));return as73211_power (indio_dev, true); } -static SIMPLE_DEV_PM_OPS(as73211_pm_ops, as73211_suspend, as73211_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(as73211_pm_ops, as73211_suspend, + as73211_resume);static const struct of_device_id as73211_of_match[] = { { .compatible ="ams,as73211" },
@@ -787,7 +788,7 @@ static struct i2c_driver as73211_driver = { .driver = { .name = AS73211_DRV_NAME, .of_match_table = as73211_of_match, - .pm = &as73211_pm_ops, + .pm = pm_sleep_ptr(&as73211_pm_ops), }, .probe_new = as73211_probe, .id_table = as73211_id,
Signature · 1 line
2.36.1
Re: [PATCH 21/36] iio: light: as73211: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
Quoted 8 lines · Jonathan Cameron
From: Jonathan Cameron <[email protected]>
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions
__maybe_unused.Signed-off-by Jonathan Cameron <[email protected]>Cc Christian Eggers <[email protected]>
Jonathan Cameron
maintainerPATCH 22/36 iio: light: bh1750: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused.
--- drivers/iio/light/bh1750.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/iio/light/bh1750.c +3 -3
@@ -277,7 +277,7 @@ static int bh1750_remove(struct i2c_client *client)return 0 ; } -static int __maybe_unused bh1750_suspend (struct device *dev) +static int bh1750_suspend (struct device *dev) {int ret; struct bh1750_data *data =
@@ -294,7 +294,7 @@ static int __maybe_unused bh1750_suspend(struct device *dev)return ret; } -static SIMPLE_DEV_PM_OPS(bh1750_pm_ops, bh1750_suspend, NULL); +static DEFINE_SIMPLE_DEV_PM_OPS(bh1750_pm_ops, bh1750_suspend, NULL);static const struct i2c_device_id bh1750_id[] = { {"bh1710" ,BH1710 },
@@ -320,7 +320,7 @@ static struct i2c_driver bh1750_driver = { .driver = { .name = "bh1750", .of_match_table = bh1750_of_match, - .pm = &bh1750_pm_ops, + .pm = pm_sleep_ptr(&bh1750_pm_ops), }, .probe = bh1750_probe, .remove = bh1750_remove,
Signature · 1 line
2.36.1
Jonathan Cameron
maintainerPATCH 23/36 iio: light: cm3605: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused.
--- drivers/iio/light/cm3605.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-)
drivers/iio/light/cm3605.c +5 -8
@@ -278,7 +278,7 @@ static int cm3605_remove(struct platform_device *pdev)return 0 ; } -static int __maybe_unused cm3605_pm_suspend (struct device *dev) +static int cm3605_pm_suspend (struct device *dev) {struct iio_dev *indio_dev =dev_get_drvdata (dev);struct cm3605 *cm3605 =iio_priv (indio_dev);
@@ -289,7 +289,7 @@ static int __maybe_unused cm3605_pm_suspend(struct device *dev)return 0 ; } -static int __maybe_unused cm3605_pm_resume (struct device *dev) +static int cm3605_pm_resume (struct device *dev) {struct iio_dev *indio_dev =dev_get_drvdata (dev);struct cm3605 *cm3605 =iio_priv (indio_dev);
@@ -302,11 +302,8 @@ static int __maybe_unused cm3605_pm_resume(struct device *dev)return 0 ; } - -static const struct dev_pm_ops cm3605_dev_pm_ops = { -SET_SYSTEM_SLEEP_PM_OPS (cm3605_pm_suspend, - cm3605_pm_resume) -}; +static DEFINE_SIMPLE_DEV_PM_OPS(cm3605_dev_pm_ops, cm3605_pm_suspend, + cm3605_pm_resume);static const struct of_device_id cm3605_of_match[] = { {.compatible ="capella,cm3605" },
@@ -318,7 +315,7 @@ static struct platform_driver cm3605_driver = { .driver = { .name = "cm3605", .of_match_table = cm3605_of_match, - .pm = &cm3605_dev_pm_ops, + .pm = pm_sleep_ptr(&cm3605_dev_pm_ops), }, .probe = cm3605_probe, .remove = cm3605_remove,
Signature · 1 line
2.36.1
Jonathan Cameron
maintainerPATCH 24/36 iio: proximity: cros_ec_mkbp: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused.
--- drivers/iio/proximity/cros_ec_mkbp_proximity.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/iio/proximity/cros_ec_mkbp_proximity.c +4 -4
@@ -184,7 +184,7 @@ static const struct iio_info cros_ec_mkbp_proximity_info = { .write_event_config = cros_ec_mkbp_proximity_write_event_config, }; -static __maybe_unused int cros_ec_mkbp_proximity_resume (struct device *dev) +static int cros_ec_mkbp_proximity_resume (struct device *dev) {struct cros_ec_mkbp_proximity_data *data =dev_get_drvdata (dev);struct cros_ec_device *ec = data->ec;
@@ -201,8 +201,8 @@ static __maybe_unused int cros_ec_mkbp_proximity_resume(struct device *dev)return 0 ; } -static SIMPLE_DEV_PM_OPS(cros_ec_mkbp_proximity_pm_ops, NULL, - cros_ec_mkbp_proximity_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(cros_ec_mkbp_proximity_pm_ops, NULL, + cros_ec_mkbp_proximity_resume);static int cros_ec_mkbp_proximity_probe (struct platform_device *pdev) {
@@ -260,7 +260,7 @@ static struct platform_driver cros_ec_mkbp_proximity_driver = { .driver = { .name = "cros-ec-mkbp-proximity", .of_match_table = cros_ec_mkbp_proximity_of_match, - .pm = &cros_ec_mkbp_proximity_pm_ops, + .pm = pm_sleep_ptr(&cros_ec_mkbp_proximity_pm_ops), }, .probe = cros_ec_mkbp_proximity_probe, .remove = cros_ec_mkbp_proximity_remove,
Signature · 1 line
2.36.1
Re: [PATCH 24/36] iio: proximity: cros_ec_mkbp: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
Quoted 11 lines · Jonathan Cameron
From: Jonathan Cameron <[email protected]>
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions
__maybe_unused.Signed-off-by Jonathan Cameron <[email protected]>Cc Enric Balletbo i Serra <[email protected]>Cc Gwendal Grignou <[email protected]>Cc Stephen Boyd <[email protected]>
Quoted 40 lines
--- drivers/iio/proximity/cros_ec_mkbp_proximity.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/iio/proximity/cros_ec_mkbp_proximity.c +4
-5@@ -184,7 +184,7 @@ static const struct iio_info cros_ec_mkbp_proximity_info = { .write_event_config = cros_ec_mkbp_proximity_write_event_config, }; -static __maybe_unused int cros_ec_mkbp_proximity_resume (struct device *dev) +static int cros_ec_mkbp_proximity_resume (struct device *dev) {struct cros_ec_mkbp_proximity_data *data =dev_get_drvdata (dev);struct cros_ec_device *ec = data->ec;@@ -201,8 +201,8 @@ static __maybe_unused int cros_ec_mkbp_proximity_resume(struct device *dev)return 0 ; } -static SIMPLE_DEV_PM_OPS(cros_ec_mkbp_proximity_pm_ops, NULL, - cros_ec_mkbp_proximity_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(cros_ec_mkbp_proximity_pm_ops, NULL, + cros_ec_mkbp_proximity_resume);static int cros_ec_mkbp_proximity_probe (struct platform_device *pdev) {@@ -260,7 +260,7 @@ static struct platform_driver cros_ec_mkbp_proximity_driver = { .driver = { .name = "cros-ec-mkbp-proximity", .of_match_table = cros_ec_mkbp_proximity_of_match, - .pm = &cros_ec_mkbp_proximity_pm_ops, + .pm = pm_sleep_ptr(&cros_ec_mkbp_proximity_pm_ops), }, .probe = cros_ec_mkbp_proximity_probe, .remove = cros_ec_mkbp_proximity_remove, --2.36.1
Jonathan Cameron
maintainerPATCH 25/36 iio: temperature: ltc2983: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused.
--- drivers/iio/temperature/ltc2983.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/iio/temperature/ltc2983.c +5 -4
@@ -1534,7 +1534,7 @@ static int ltc2983_probe(struct spi_device *spi)return devm_iio_device_register (&spi->dev, indio_dev); } -static int __maybe_unused ltc2983_resume (struct device *dev) +static int ltc2983_resume (struct device *dev) {struct ltc2983_data *st =spi_get_drvdata (to_spi_device (dev));int dummy;
@@ -1545,14 +1545,15 @@ static int __maybe_unused ltc2983_resume(struct device *dev)return ltc2983_setup (st, false); } -static int __maybe_unused ltc2983_suspend (struct device *dev) +static int ltc2983_suspend (struct device *dev) {struct ltc2983_data *st =spi_get_drvdata (to_spi_device (dev));return regmap_write (st->regmap,LTC2983_STATUS_REG ,LTC2983_SLEEP ); } -static SIMPLE_DEV_PM_OPS(ltc2983_pm_ops, ltc2983_suspend, ltc2983_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(ltc2983_pm_ops, ltc2983_suspend, + ltc2983_resume);static const struct spi_device_id ltc2983_id_table[] = { {"ltc2983" },
@@ -1570,7 +1571,7 @@ static struct spi_driver ltc2983_driver = { .driver = { .name = "ltc2983", .of_match_table = ltc2983_of_match, - .pm = <c2983_pm_ops, + .pm = pm_sleep_ptr(<c2983_pm_ops), }, .probe = ltc2983_probe, .id_table = ltc2983_id_table,
Signature · 1 line
2.36.1
RE: [PATCH 25/36] iio: temperature: ltc2983: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
Quoted 33 lines
From: Jonathan Cameron <[email protected]>
Sent: Tuesday, June 21, 2022 10:27 PM
To: [email protected]; Paul Cercueil <[email protected]>
Cc: Alexandre Belloni <[email protected]>; Brian Masney <[email protected]>; David Heidelberg <[email protected]>; Cai Huoqing <[email protected]>; Christian Eggers <[email protected]>; Enric Balletbo i Serra <[email protected]>; Eugen Hristev <[email protected]>; Gwendal Grignou <[email protected]>; Haibo Chen <[email protected]>; Hui Liu <[email protected]>; Joe Sandom <[email protected]>; Ismail H . Kose <[email protected]>; Lars-Peter Clausen <[email protected]>; Linus Walleij <[email protected]>; Ludovic Desroches <[email protected]>; Nicolas Ferre <[email protected]>; Marcus Folkesson <[email protected]>; Martin Blumenstingl <[email protected]>; Mathieu Othacehe <[email protected]>; Michal Simek <[email protected]>; Miquel Raynal <[email protected]>; Sa, Nuno <[email protected]>; Parthiban Nallathambi <[email protected]>; Philippe Reynes <[email protected]>; Philippe Schenker <[email protected]>; Rishi Gupta <[email protected]>; Roan van Dijk <[email protected]>; Stephen Boyd <[email protected]>; Tomasz Duszynski <[email protected]>; Zhiyong Tao <[email protected]>; Jonathan Cameron <[email protected]>
Subject: [PATCH 25/36] iio: temperature: ltc2983: Switch toDEFINE_SIMPLE_DEV_PM_OPS()andpm_sleep_ptr()From: Jonathan Cameron <[email protected]>
Quoted 8 lines
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to
mark pm functions__maybe_unused.Signed-off-by Jonathan Cameron <[email protected]>Cc Nuno Sá <[email protected]>---
Jonathan Cameron
maintainerPATCH 26/36 iio: light: us5182: Switch from CONFIG_PM guards to pm_ptr() etc
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Letting the compiler remove these functions when the kernel is built without CONFIG_PM support is simpler and less error prone than the use of #ifdef based config guards.
Removing instances of this approach from IIO also stops them being copied into new drivers.
Very likely it would be safe to use DEFINE_RUNTIME_DEV_PM_OPS() here, but that would be a functional change.
--- drivers/iio/light/us5182d.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/iio/light/us5182d.c +3 -5
@@ -922,7 +922,6 @@ static int us5182d_remove(struct i2c_client *client)return 0 ; } -#if defined(CONFIG_PM_SLEEP ) || defined(CONFIG_PM )static int us5182d_suspend (struct device *dev) {struct iio_dev *indio_dev =i2c_get_clientdata (to_i2c_client (dev));
@@ -945,11 +944,10 @@ static int us5182d_resume(struct device *dev)return 0 ; } -#endif static const struct dev_pm_ops us5182d_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(us5182d_suspend, us5182d_resume) -SET_RUNTIME_PM_OPS (us5182d_suspend, us5182d_resume,NULL ) + SYSTEM_SLEEP_PM_OPS(us5182d_suspend, us5182d_resume) +RUNTIME_PM_OPS (us5182d_suspend, us5182d_resume,NULL ) };static const struct acpi_device_id us5182d_acpi_match[] = {
@@ -975,7 +973,7 @@ MODULE_DEVICE_TABLE(of, us5182d_of_match);static struct i2c_driver us5182d_driver = { .driver = { .name =US5182D_DRV_NAME , - .pm = &us5182d_pm_ops, + .pm =pm_ptr (&us5182d_pm_ops), .of_match_table = us5182d_of_match, .acpi_match_table =ACPI_PTR (us5182d_acpi_match), },
Signature · 1 line
2.36.1
Jonathan Cameron
maintainerPATCH 27/36 iio: adc: imx8qxp: Switch to DEFINE_RUNTIME_DEV_PM_OPS and pm_ptr()
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Switching to these newer macros allows the compiler to remove the unused functions and struct dev_pm_ops if !CONFIG_PM without the need to mark anything __maybe_unused.
--- drivers/iio/adc/imx8qxp-adc.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)
drivers/iio/adc/imx8qxp-adc.c +6 -7
@@ -417,7 +417,7 @@ static int imx8qxp_adc_remove(struct platform_device *pdev)return 0 ; } -static __maybe_unused int imx8qxp_adc_runtime_suspend (struct device *dev) +static int imx8qxp_adc_runtime_suspend (struct device *dev) {struct iio_dev *indio_dev =dev_get_drvdata (dev);struct imx8qxp_adc *adc =iio_priv (indio_dev);
@@ -431,7 +431,7 @@ static __maybe_unused int imx8qxp_adc_runtime_suspend(struct device *dev)return 0 ; } -static __maybe_unused int imx8qxp_adc_runtime_resume (struct device *dev) +static int imx8qxp_adc_runtime_resume (struct device *dev) {struct iio_dev *indio_dev =dev_get_drvdata (dev);struct imx8qxp_adc *adc =iio_priv (indio_dev);
@@ -468,10 +468,9 @@ static __maybe_unused int imx8qxp_adc_runtime_resume(struct device *dev)return ret; } -static const struct dev_pm_ops imx8qxp_adc_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) -SET_RUNTIME_PM_OPS (imx8qxp_adc_runtime_suspend, imx8qxp_adc_runtime_resume,NULL ) -}; +static DEFINE_RUNTIME_DEV_PM_OPS(imx8qxp_adc_pm_ops, + imx8qxp_adc_runtime_suspend, + imx8qxp_adc_runtime_resume, NULL);static const struct of_device_id imx8qxp_adc_match[] = { { .compatible ="nxp,imx8qxp-adc" , },
@@ -485,7 +484,7 @@ static struct platform_driver imx8qxp_adc_driver = { .driver = { .name = ADC_DRIVER_NAME, .of_match_table = imx8qxp_adc_match, - .pm = &imx8qxp_adc_pm_ops, + .pm = pm_ptr(&imx8qxp_adc_pm_ops), }, };
Signature · 1 line
2.36.1
RE: [PATCH 27/36] iio: adc: imx8qxp: Switch to DEFINE_RUNTIME_DEV_PM_OPS and pm_ptr()
Quoted 27 lines
-----Original Message-----
From: Jonathan Cameron <[email protected]>
Sent: 2022年6月22日 4:27
To: [email protected]; Paul Cercueil <[email protected]>
Cc: Alexandre Belloni <[email protected]>; Brian Masney <[email protected]>; David Heidelberg <[email protected]>; Cai Huoqing <[email protected]>; Christian Eggers <[email protected]>; Enric Balletbo i Serra <[email protected]>; Eugen Hristev <[email protected]>; Gwendal Grignou <[email protected]>; Bough Chen <[email protected]>; Hui Liu <[email protected]>; Joe Sandom <[email protected]>; Ismail H . Kose <[email protected]>; Lars-Peter Clausen <[email protected]>; Linus Walleij <[email protected]>; Ludovic Desroches <[email protected]>; Nicolas Ferre <[email protected]>; Marcus Folkesson <[email protected]>; Martin Blumenstingl <[email protected]>; Mathieu Othacehe <[email protected]>; Michal Simek <[email protected]>; Miquel Raynal <[email protected]>; Nuno Sá <[email protected]>; Parthiban Nallathambi <[email protected]>; Philippe Reynes <[email protected]>; Philippe Schenker <[email protected]>; Rishi Gupta <[email protected]>; Roan van Dijk <[email protected]>; Stephen Boyd <[email protected]>; Tomasz Duszynski <[email protected]>; Zhiyong Tao <[email protected]>; Jonathan Cameron <[email protected]>
Subject: [PATCH 27/36] iio: adc: imx8qxp: Switch toDEFINE_RUNTIME_DEV_PM_OPSandpm_ptr()
Quoted 8 lines
From: Jonathan Cameron <[email protected]>
Switching to these newer macros allows the compiler to remove the unused functions and struct
dev_pm_opsif !CONFIG_PM without the need to mark anything__maybe_unused.Signed-off-by Jonathan Cameron <[email protected]>Cc Cai Huoqing <[email protected]>
Quoted 54 lines
--- drivers/iio/adc/imx8qxp-adc.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)drivers/iio/adc/imx8qxp-adc.c index renamed from drivers/iio/adc/imx8qxp-adc.c +0
-0
e8c9a69e10eb..e48446784a0a100644drivers/iio/adc/imx8qxp-adc.c +1
-1@@ -417,7 +417,7 @@ static int imx8qxp_adc_remove(struct platform_device *pdev)return 0 ; } -static __maybe_unused int imx8qxp_adc_runtime_suspend (struct device *dev) +static int imx8qxp_adc_runtime_suspend (struct device *dev) {struct iio_dev *indio_dev =dev_get_drvdata (dev);struct
imx8qxp_adc*adc =iio_priv(indio_dev); @@ -431,7 +431,7 @@
static__maybe_unusedintimx8qxp_adc_runtime_suspend(struct device *dev)drivers/iio/adc/imx8qxp-adc.c +1
-1return 0 ; } -static __maybe_unused int imx8qxp_adc_runtime_resume (struct device *dev) +static int imx8qxp_adc_runtime_resume (struct device *dev) {struct iio_dev *indio_dev =dev_get_drvdata (dev); struct imx8qxp_adc *adc = iio_priv(indio_dev); @@ -468,10 +468,9 @@static
__maybe_unusedintimx8qxp_adc_runtime_resume(struct device *dev)drivers/iio/adc/imx8qxp-adc.c +0
-2return ret; } -static const struct dev_pm_ops imx8qxp_adc_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
pm_runtime_force_resume)drivers/iio/adc/imx8qxp-adc.c +0
-1- SET_RUNTIME_PM_OPS(imx8qxp_adc_runtime_suspend,
imx8qxp_adc_runtime_resume, NULL)drivers/iio/adc/imx8qxp-adc.c +4
-3-}; +static DEFINE_RUNTIME_DEV_PM_OPS(imx8qxp_adc_pm_ops, + imx8qxp_adc_runtime_suspend, + imx8qxp_adc_runtime_resume, NULL);static const struct of_device_id imx8qxp_adc_match[] = { { .compatible ="nxp,imx8qxp-adc" , },@@ -485,7 +484,7 @@ static struct platform_driver imx8qxp_adc_driver = { .driver = { .name = ADC_DRIVER_NAME, .of_match_table = imx8qxp_adc_match, - .pm = &imx8qxp_adc_pm_ops, + .pm = pm_ptr(&imx8qxp_adc_pm_ops), }, }; --2.36.1
Jonathan Cameron
maintainerPATCH 28/36 iio: light: gp2ap002: Switch to DEFINE_RUNTIME_DEV_PM_OPS and pm_ptr()
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Switching to these newer macros allows use of pm_ptr() to remove the unused functions and structure if !CONFIG_PM without the need to mark anything __maybe_unused.
--- drivers/iio/light/gp2ap002.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-)
drivers/iio/light/gp2ap002.c +5 -9
@@ -635,7 +635,7 @@ static int gp2ap002_remove(struct i2c_client *client)return 0 ; } -static int __maybe_unused gp2ap002_runtime_suspend (struct device *dev) +static int gp2ap002_runtime_suspend (struct device *dev) {struct iio_dev *indio_dev =dev_get_drvdata (dev);struct gp2ap002 *gp2ap002 =iio_priv (indio_dev);
@@ -660,7 +660,7 @@ static int __maybe_unused gp2ap002_runtime_suspend(struct device *dev)return 0 ; } -static int __maybe_unused gp2ap002_runtime_resume (struct device *dev) +static int gp2ap002_runtime_resume (struct device *dev) {struct iio_dev *indio_dev =dev_get_drvdata (dev);struct gp2ap002 *gp2ap002 =iio_priv (indio_dev);
@@ -691,12 +691,8 @@ static int __maybe_unused gp2ap002_runtime_resume(struct device *dev)return 0 ; } -static const struct dev_pm_ops gp2ap002_dev_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, - pm_runtime_force_resume) -SET_RUNTIME_PM_OPS (gp2ap002_runtime_suspend, - gp2ap002_runtime_resume,NULL ) -}; +static DEFINE_RUNTIME_DEV_PM_OPS(gp2ap002_dev_pm_ops, gp2ap002_runtime_suspend, + gp2ap002_runtime_resume, NULL);static const struct i2c_device_id gp2ap002_id_table[] = { {"gp2ap002" ,0 },
@@ -715,7 +711,7 @@ static struct i2c_driver gp2ap002_driver = { .driver = { .name = "gp2ap002", .of_match_table = gp2ap002_of_match, - .pm = &gp2ap002_dev_pm_ops, + .pm = pm_ptr(&gp2ap002_dev_pm_ops), }, .probe = gp2ap002_probe, .remove = gp2ap002_remove,
Signature · 1 line
2.36.1
Jonathan Cameron
maintainerPATCH 29/36 iio: light: isl29028: Use DEFINE_RUNTIME_DEV_PM_OPS() and pm_ptr()
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Using these new macros allows removal of unused pm_ops structure and functions if !CONFIG_PM without the need to mark the functions __maybe_unused.
--- drivers/iio/light/isl29028.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-)
drivers/iio/light/isl29028.c +5 -8
@@ -651,7 +651,7 @@ static int isl29028_remove(struct i2c_client *client)return 0 ; } -static int __maybe_unused isl29028_suspend (struct device *dev) +static int isl29028_suspend (struct device *dev) {struct iio_dev *indio_dev =i2c_get_clientdata (to_i2c_client (dev));struct isl29028_chip *chip =iio_priv (indio_dev);
@@ -666,7 +666,7 @@ static int __maybe_unused isl29028_suspend(struct device *dev)return ret; } -static int __maybe_unused isl29028_resume (struct device *dev) +static int isl29028_resume (struct device *dev) {/** * The specific component (ALS/IR or proximity) will enable itself as
@@ -676,11 +676,8 @@ static int __maybe_unused isl29028_resume(struct device *dev)return 0 ; } -static const struct dev_pm_ops isl29028_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, - pm_runtime_force_resume) -SET_RUNTIME_PM_OPS (isl29028_suspend, isl29028_resume,NULL ) -}; +static DEFINE_RUNTIME_DEV_PM_OPS(isl29028_pm_ops, isl29028_suspend, + isl29028_resume, NULL);static const struct i2c_device_id isl29028_id[] = { {"isl29028" ,0 },
@@ -700,7 +697,7 @@ MODULE_DEVICE_TABLE(of, isl29028_of_match);static struct i2c_driver isl29028_driver = { .driver = { .name ="isl29028" , - .pm = &isl29028_pm_ops, + .pm =pm_ptr (&isl29028_pm_ops), .of_match_table = isl29028_of_match, }, .probe = isl29028_probe,
Signature · 1 line
2.36.1
Re: [PATCH 29/36] iio: light: isl29028: Use DEFINE_RUNTIME_DEV_PM_OPS() and pm_ptr()
Quoted 8 lines · Jonathan Cameron
From: Jonathan Cameron <[email protected]>
Using these new macros allows removal of unused
pm_opsstructure and functions if !CONFIG_PM without the need to mark the functions__maybe_unused.Signed-off-by Jonathan Cameron <[email protected]>Cc Brian Masney <[email protected]>
Jonathan Cameron
maintainerPATCH 30/36 iio: light: tsl2583: Use DEFINE_RUNTIME_DEV_PM_OPS and pm_ptr()
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Using these new macros allows removal of unused pm_ops structure and functions if !CONFIG_PM without the need to mark the function __maybe_unused.
--- drivers/iio/light/tsl2583.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-)
drivers/iio/light/tsl2583.c +5 -8
@@ -888,7 +888,7 @@ static int tsl2583_remove(struct i2c_client *client)return 0 ; } -static int __maybe_unused tsl2583_suspend (struct device *dev) +static int tsl2583_suspend (struct device *dev) {struct iio_dev *indio_dev =i2c_get_clientdata (to_i2c_client (dev));struct tsl2583_chip *chip =iio_priv (indio_dev);
@@ -903,7 +903,7 @@ static int __maybe_unused tsl2583_suspend(struct device *dev)return ret; } -static int __maybe_unused tsl2583_resume (struct device *dev) +static int tsl2583_resume (struct device *dev) {struct iio_dev *indio_dev =i2c_get_clientdata (to_i2c_client (dev));struct tsl2583_chip *chip =iio_priv (indio_dev);
@@ -918,11 +918,8 @@ static int __maybe_unused tsl2583_resume(struct device *dev)return ret; } -static const struct dev_pm_ops tsl2583_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, - pm_runtime_force_resume) -SET_RUNTIME_PM_OPS (tsl2583_suspend, tsl2583_resume,NULL ) -}; +static DEFINE_RUNTIME_DEV_PM_OPS(tsl2583_pm_ops, tsl2583_suspend, + tsl2583_resume, NULL);static const struct i2c_device_id tsl2583_idtable[] = { {"tsl2580" ,0 },
@@ -944,7 +941,7 @@ MODULE_DEVICE_TABLE(of, tsl2583_of_match);static struct i2c_driver tsl2583_driver = { .driver = { .name ="tsl2583" , - .pm = &tsl2583_pm_ops, + .pm =pm_ptr (&tsl2583_pm_ops), .of_match_table = tsl2583_of_match, }, .id_table = tsl2583_idtable,
Signature · 1 line
2.36.1
Re: [PATCH 30/36] iio: light: tsl2583: Use DEFINE_RUNTIME_DEV_PM_OPS and pm_ptr()
Quoted 8 lines · Jonathan Cameron
From: Jonathan Cameron <[email protected]>
Using these new macros allows removal of unused
pm_opsstructure and functions if !CONFIG_PM without the need to mark the function__maybe_unused.Signed-off-by Jonathan Cameron <[email protected]>Cc Brian Masney <[email protected]>
Jonathan Cameron
maintainerPATCH 31/36 iio: light: tsl2591: Use DEFINE_RUNTIME_DEV_PM_OPS() and pm_ptr()
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Using these new macros allows removal of unused pm_ops structure and functions if !CONFIG_PM without the need to mark the functions __maybe_unused.
--- drivers/iio/light/tsl2591.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)
drivers/iio/light/tsl2591.c +5 -7
@@ -1019,7 +1019,7 @@ static const struct iio_info tsl2591_info_no_irq = { .read_avail = tsl2591_read_available, }; -static int __maybe_unused tsl2591_suspend (struct device *dev) +static int tsl2591_suspend (struct device *dev) {struct iio_dev *indio_dev =dev_get_drvdata (dev);struct tsl2591_chip *chip =iio_priv (indio_dev);
@@ -1032,7 +1032,7 @@ static int __maybe_unused tsl2591_suspend(struct device *dev)return ret; } -static int __maybe_unused tsl2591_resume (struct device *dev) +static int tsl2591_resume (struct device *dev) {int power_state =TSL2591_PWR_ON |TSL2591_ENABLE_ALS ;struct iio_dev *indio_dev =dev_get_drvdata (dev);
@@ -1049,10 +1049,8 @@ static int __maybe_unused tsl2591_resume(struct device *dev)return ret; } -static const struct dev_pm_ops tsl2591_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) -SET_RUNTIME_PM_OPS (tsl2591_suspend, tsl2591_resume,NULL ) -}; +static DEFINE_RUNTIME_DEV_PM_OPS(tsl2591_pm_ops, tsl2591_suspend, + tsl2591_resume, NULL);static irqreturn_t tsl2591_event_handler (int irq,void *private) {
@@ -1213,7 +1211,7 @@ MODULE_DEVICE_TABLE(of, tsl2591_of_match);static struct i2c_driver tsl2591_driver = { .driver = { .name ="tsl2591" , - .pm = &tsl2591_pm_ops, + .pm =pm_ptr (&tsl2591_pm_ops), .of_match_table = tsl2591_of_match, }, .probe_new = tsl2591_probe
Signature · 1 line
2.36.1
Jonathan Cameron
maintainerPATCH 32/36 iio: light: vcnl4000: Use DEFINE_RUNTIME_DEV_PM_OPS() and pm_ptr() macros
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Using these new macros allows the compiler to remove the unused dev_pm_ops structure and related functions if !CONFIG_PM without the need to mark the functions __maybe_unused.
--- drivers/iio/light/vcnl4000.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-)
drivers/iio/light/vcnl4000.c +5 -9
@@ -1130,7 +1130,7 @@ static int vcnl4000_remove(struct i2c_client *client)return 0 ; } -static int __maybe_unused vcnl4000_runtime_suspend (struct device *dev) +static int vcnl4000_runtime_suspend (struct device *dev) {struct iio_dev *indio_dev =i2c_get_clientdata (to_i2c_client (dev));struct vcnl4000_data *data =iio_priv (indio_dev);
@@ -1138,7 +1138,7 @@ static int __maybe_unused vcnl4000_runtime_suspend(struct device *dev)return data->chip_spec->set_power_state (data, false); } -static int __maybe_unused vcnl4000_runtime_resume (struct device *dev) +static int vcnl4000_runtime_resume (struct device *dev) {struct iio_dev *indio_dev =i2c_get_clientdata (to_i2c_client (dev));struct vcnl4000_data *data =iio_priv (indio_dev);
@@ -1146,17 +1146,13 @@ static int __maybe_unused vcnl4000_runtime_resume(struct device *dev)return data->chip_spec->set_power_state (data, true); } -static const struct dev_pm_ops vcnl4000_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, - pm_runtime_force_resume) -SET_RUNTIME_PM_OPS (vcnl4000_runtime_suspend, - vcnl4000_runtime_resume,NULL ) -}; +static DEFINE_RUNTIME_DEV_PM_OPS(vcnl4000_pm_ops, vcnl4000_runtime_suspend, + vcnl4000_runtime_resume, NULL);static struct i2c_driver vcnl4000_driver = { .driver = { .name =VCNL4000_DRV_NAME , - .pm = &vcnl4000_pm_ops, + .pm =pm_ptr (&vcnl4000_pm_ops), .of_match_table = vcnl_4000_of_match, }, .probe = vcnl4000_probe,
Signature · 1 line
2.36.1
Jonathan Cameron
maintainerPATCH 33/36 iio: light: vcnl4035: Use DEFINE_RUNTIME_DEV_PM_OPS() and pm_ptr() macros
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Using these new macros allows the compiler to remove the unused dev_pm_ops structure and related functions if !CONFIG_PM without the need to mark the functions __maybe_unused.
--- drivers/iio/light/vcnl4035.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-)
drivers/iio/light/vcnl4035.c +5 -9
@@ -620,7 +620,7 @@ static int vcnl4035_remove(struct i2c_client *client)return 0 ; } -static int __maybe_unused vcnl4035_runtime_suspend (struct device *dev) +static int vcnl4035_runtime_suspend (struct device *dev) {struct iio_dev *indio_dev =i2c_get_clientdata (to_i2c_client (dev));struct vcnl4035_data *data =iio_priv (indio_dev);
@@ -632,7 +632,7 @@ static int __maybe_unused vcnl4035_runtime_suspend(struct device *dev)return ret; } -static int __maybe_unused vcnl4035_runtime_resume (struct device *dev) +static int vcnl4035_runtime_resume (struct device *dev) {struct iio_dev *indio_dev =i2c_get_clientdata (to_i2c_client (dev));struct vcnl4035_data *data =iio_priv (indio_dev);
@@ -649,12 +649,8 @@ static int __maybe_unused vcnl4035_runtime_resume(struct device *dev)return 0 ; } -static const struct dev_pm_ops vcnl4035_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, - pm_runtime_force_resume) -SET_RUNTIME_PM_OPS (vcnl4035_runtime_suspend, - vcnl4035_runtime_resume,NULL ) -}; +static DEFINE_RUNTIME_DEV_PM_OPS(vcnl4035_pm_ops, vcnl4035_runtime_suspend, + vcnl4035_runtime_resume, NULL);static const struct i2c_device_id vcnl4035_id[] = { {"vcnl4035" ,0 },
@@ -671,7 +667,7 @@ MODULE_DEVICE_TABLE(of, vcnl4035_of_match);static struct i2c_driver vcnl4035_driver = { .driver = { .name =VCNL4035_DRV_NAME , - .pm = &vcnl4035_pm_ops, + .pm =pm_ptr (&vcnl4035_pm_ops), .of_match_table = vcnl4035_of_match, }, .probe = vcnl4035_probe,
Signature · 1 line
2.36.1
Jonathan Cameron
maintainerPATCH 34/36 iio: light: veml6030: Use DEFINE_RUNTIME_DEV_PM_OPS() and pm_ptr() macros
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Using these new macros allows the compiler to remove the unused dev_pm_ops structure and related functions if !CONFIG_PM without the need to mark the functions __maybe_unused.
--- drivers/iio/light/veml6030.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-)
drivers/iio/light/veml6030.c +5 -9
@@ -846,7 +846,7 @@ static int veml6030_probe(struct i2c_client *client,return devm_iio_device_register (&client->dev, indio_dev); } -static int __maybe_unused veml6030_runtime_suspend (struct device *dev) +static int veml6030_runtime_suspend (struct device *dev) {int ret;struct iio_dev *indio_dev =i2c_get_clientdata (to_i2c_client (dev));
@@ -859,7 +859,7 @@ static int __maybe_unused veml6030_runtime_suspend(struct device *dev)return ret; } -static int __maybe_unused veml6030_runtime_resume (struct device *dev) +static int veml6030_runtime_resume (struct device *dev) {int ret;struct iio_dev *indio_dev =i2c_get_clientdata (to_i2c_client (dev));
@@ -872,12 +872,8 @@ static int __maybe_unused veml6030_runtime_resume(struct device *dev)return ret; } -static const struct dev_pm_ops veml6030_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, - pm_runtime_force_resume) -SET_RUNTIME_PM_OPS (veml6030_runtime_suspend, - veml6030_runtime_resume,NULL ) -}; +static DEFINE_RUNTIME_DEV_PM_OPS(veml6030_pm_ops, veml6030_runtime_suspend, + veml6030_runtime_resume, NULL);static const struct of_device_id veml6030_of_match[] = { { .compatible ="vishay,veml6030" },
@@ -895,7 +891,7 @@ static struct i2c_driver veml6030_driver = { .driver = { .name = "veml6030", .of_match_table = veml6030_of_match, - .pm = &veml6030_pm_ops, + .pm = pm_ptr(&veml6030_pm_ops), }, .probe = veml6030_probe, .id_table = veml6030_id,
Signature · 1 line
2.36.1
Re: [PATCH 34/36] iio: light: veml6030: Use DEFINE_RUNTIME_DEV_PM_OPS() and pm_ptr() macros
Quoted 60 lines · Jonathan Cameron
From: Jonathan Cameron <[email protected]>
Using these new macros allows the compiler to remove the unused
dev_pm_opsstructure and related functions if !CONFIG_PM without the need to mark the functions__maybe_unused.Signed-off-by Jonathan Cameron <[email protected]>Cc Rishi Gupta <[email protected]>--- drivers/iio/light/veml6030.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-)drivers/iio/light/veml6030.c +5
-10@@ -846,7 +846,7 @@ static int veml6030_probe(struct i2c_client *client,return devm_iio_device_register (&client->dev, indio_dev); } -static int __maybe_unused veml6030_runtime_suspend (struct device *dev) +static int veml6030_runtime_suspend (struct device *dev) {int ret;struct iio_dev *indio_dev =i2c_get_clientdata (to_i2c_client (dev));@@ -859,7 +859,7 @@ static int __maybe_unused veml6030_runtime_suspend(struct device *dev)return ret; } -static int __maybe_unused veml6030_runtime_resume (struct device *dev) +static int veml6030_runtime_resume (struct device *dev) {int ret;struct iio_dev *indio_dev =i2c_get_clientdata (to_i2c_client (dev));@@ -872,12 +872,8 @@ static int __maybe_unused veml6030_runtime_resume(struct device *dev)return ret; } -static const struct dev_pm_ops veml6030_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, - pm_runtime_force_resume) -SET_RUNTIME_PM_OPS (veml6030_runtime_suspend, - veml6030_runtime_resume,NULL ) -}; +static DEFINE_RUNTIME_DEV_PM_OPS(veml6030_pm_ops, veml6030_runtime_suspend, + veml6030_runtime_resume, NULL);static const struct of_device_id veml6030_of_match[] = { { .compatible ="vishay,veml6030" },@@ -895,7 +891,7 @@ static struct i2c_driver veml6030_driver = { .driver = { .name = "veml6030", .of_match_table = veml6030_of_match, - .pm = &veml6030_pm_ops, + .pm = pm_ptr(&veml6030_pm_ops), }, .probe = veml6030_probe, .id_table = veml6030_id, --
Quoted 2 lines
2.36.1
Jonathan Cameron
maintainerPATCH 35/36 iio: magnetometer: ak8974: Use DEFINE_RUNTIME_DEV_PM_OPS() and pm_ptr() macros
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Using these new macros allows the compiler to remove the unused dev_pm_ops structure and related functions if !CONFIG_PM without the need to mark the functions __maybe_unused.
--- drivers/iio/magnetometer/ak8974.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-)
drivers/iio/magnetometer/ak8974.c +5 -9
@@ -985,7 +985,7 @@ static int ak8974_remove(struct i2c_client *i2c)return 0 ; } -static int __maybe_unused ak8974_runtime_suspend (struct device *dev) +static int ak8974_runtime_suspend (struct device *dev) {struct ak8974 *ak8974 =iio_priv (i2c_get_clientdata (to_i2c_client (dev)));
@@ -996,7 +996,7 @@ static int __maybe_unused ak8974_runtime_suspend(struct device *dev)return 0 ; } -static int __maybe_unused ak8974_runtime_resume (struct device *dev) +static int ak8974_runtime_resume (struct device *dev) {struct ak8974 *ak8974 =iio_priv (i2c_get_clientdata (to_i2c_client (dev)));
@@ -1024,12 +1024,8 @@ static int __maybe_unused ak8974_runtime_resume(struct device *dev)return ret; } -static const struct dev_pm_ops ak8974_dev_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, - pm_runtime_force_resume) -SET_RUNTIME_PM_OPS (ak8974_runtime_suspend, - ak8974_runtime_resume,NULL ) -}; +static DEFINE_RUNTIME_DEV_PM_OPS(ak8974_dev_pm_ops, ak8974_runtime_suspend, + ak8974_runtime_resume, NULL);static const struct i2c_device_id ak8974_id[] = { {"ami305" ,0 },
@@ -1050,7 +1046,7 @@ MODULE_DEVICE_TABLE(of, ak8974_of_match);static struct i2c_driver ak8974_driver = { .driver = { .name ="ak8974" , - .pm = &ak8974_dev_pm_ops, + .pm =pm_ptr (&ak8974_dev_pm_ops), .of_match_table = ak8974_of_match, }, .probe = ak8974_probe,
Signature · 1 line
2.36.1
Jonathan Cameron
maintainerPATCH 36/36 iio: magn: yas530: Use DEFINE_RUNTIME_DEV_PM_OPS() and pm_ptr() macros
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Using these new macros allows the compiler to remove the unused dev_pm_ops structure and related functions if !CONFIG_PM without the need to mark the functions __maybe_unused.
--- drivers/iio/magnetometer/yamaha-yas530.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-)
drivers/iio/magnetometer/yamaha-yas530.c +5 -9
@@ -965,7 +965,7 @@ static int yas5xx_remove(struct i2c_client *i2c)return 0 ; } -static int __maybe_unused yas5xx_runtime_suspend (struct device *dev) +static int yas5xx_runtime_suspend (struct device *dev) {struct iio_dev *indio_dev =dev_get_drvdata (dev);struct yas5xx *yas5xx =iio_priv (indio_dev);
@@ -976,7 +976,7 @@ static int __maybe_unused yas5xx_runtime_suspend(struct device *dev)return 0 ; } -static int __maybe_unused yas5xx_runtime_resume (struct device *dev) +static int yas5xx_runtime_resume (struct device *dev) {struct iio_dev *indio_dev =dev_get_drvdata (dev);struct yas5xx *yas5xx =iio_priv (indio_dev);
@@ -1011,12 +1011,8 @@ static int __maybe_unused yas5xx_runtime_resume(struct device *dev)return ret; } -static const struct dev_pm_ops yas5xx_dev_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, - pm_runtime_force_resume) -SET_RUNTIME_PM_OPS (yas5xx_runtime_suspend, - yas5xx_runtime_resume,NULL ) -}; +static DEFINE_RUNTIME_DEV_PM_OPS(yas5xx_dev_pm_ops, yas5xx_runtime_suspend, + yas5xx_runtime_resume, NULL);static const struct i2c_device_id yas5xx_id[] = { {"yas530" , },
@@ -1038,7 +1034,7 @@ static struct i2c_driver yas5xx_driver = { .driver = { .name = "yas5xx", .of_match_table = yas5xx_of_match, - .pm = &yas5xx_dev_pm_ops, + .pm = pm_ptr(&yas5xx_dev_pm_ops), }, .probe = yas5xx_probe, .remove = yas5xx_remove,
Signature · 1 line
2.36.1
Hi Jonathan,
Every patch looks fine to me, so:
for the whole series.
Cheers,
-Paul
Quoted 141 lines · Jonathan Cameron
From: Jonathan Cameron <[email protected]>
After Paul's work [1] to cleanup us the PM related macros allow
use ofpm_ptr()andpm_sleep_ptr()making the compiler figure
out what structures and functions can be dropped without__maybe_unused
mess, I've been working through converting IIO.
[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/include/linux/pm.h?id=c06ef740d401d0f4ab188882bf6f8d9cf0f75eafThis particular set is the low hanging fruit. The majority of the remainder in IIO require more thought because:
1) They only have runtime pm callbacks, but no sleep ones. Need to check there is no reason we can't use use the
force_runtime_suspend
approach.
2) Odd cases like using same functions for sleep and runtime pm but not via force runtime suspend.
3) Other weird corner cases where I want to take a closer look before sending them out (I think some of them are buggy).Anyhow, whilst I've CC'd a lot of people I suspect some will no longer be active on these addresses - hence if anyone has time to look at a few patches rather than just the ones for drivers they maintain that would be much appreciated. In some cases I haven't CC'd anyone on a particular patch because I'm fairly sure the author is not longer at the same address. Any review of those ones in particular would be great.
Thanks,
Jonathan
Jonathan Cameron (36):
iio: accel: bma220: Switch toDEFINE_SIMPLE_DEV_PM_OPS()andpm_sleep_ptr() iio: adc: ad799x: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: adc: at91-sam5d2: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: adc: imx7d_adc: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: adc: meson_saradc: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: adc: mt6577_auxadc: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: adc: stmpe-adc: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: adc: ti-am335x: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: adc: xilinx-ams: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: chemical: scd4x: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: dac: ds4424: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: dac: ltc1660: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: dac: max517: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: dac: max5821: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: dac: mcp4725: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: gyro: itg3200: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: health: afe4403: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: health: afe4404: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: light: al3010: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: light: al3320a: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: light: as73211: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: light: bh1750: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: light: cm3605: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: proximity: cros_ec_mkbp: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: temperature: ltc2983: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()iio: light: us5182: Switch from
CONFIG_PMguards topm_ptr()etc
iio: adc: imx8qxp: Switch toDEFINE_RUNTIME_DEV_PM_OPSandpm_ptr()
iio: light: gp2ap002: Switch toDEFINE_RUNTIME_DEV_PM_OPSandpm_ptr()
iio: light: isl29028: UseDEFINE_RUNTIME_DEV_PM_OPS()andpm_ptr()
iio: light: tsl2583: UseDEFINE_RUNTIME_DEV_PM_OPSandpm_ptr()
iio: light: tsl2591: UseDEFINE_RUNTIME_DEV_PM_OPS()andpm_ptr()
iio: light: vcnl4000: UseDEFINE_RUNTIME_DEV_PM_OPS()andpm_ptr()
macros
iio: light: vcnl4035: UseDEFINE_RUNTIME_DEV_PM_OPS()andpm_ptr()
macros
iio: light: veml6030: UseDEFINE_RUNTIME_DEV_PM_OPS()andpm_ptr()
macros
iio: magnetometer: ak8974: UseDEFINE_RUNTIME_DEV_PM_OPS()and
pm_ptr()macros
iio: magn: yas530: UseDEFINE_RUNTIME_DEV_PM_OPS()andpm_ptr()
macrosdrivers/iio/accel/bma220_spi.c | 8 ++++---- drivers/iio/adc/ad799x.c | 8 ++++---- drivers/iio/adc/at91-sama5d2_adc.c | 9 +++++---- drivers/iio/adc/imx7d_adc.c | 5 +++-- drivers/iio/adc/imx8qxp-adc.c | 13 ++++++------- drivers/iio/adc/meson_saradc.c | 10 +++++----- drivers/iio/adc/mt6577_auxadc.c | 12 ++++++------ drivers/iio/adc/stmpe-adc.c | 6 +++--- drivers/iio/adc/ti_am335x_adc.c | 8 ++++---- drivers/iio/adc/xilinx-ams.c | 8 ++++---- drivers/iio/chemical/scd4x.c | 8 ++++---- drivers/iio/dac/ds4424.c | 8 ++++---- drivers/iio/dac/ltc1660.c | 9 +++++---- drivers/iio/dac/max517.c | 8 ++++---- drivers/iio/dac/max5821.c | 9 +++++---- drivers/iio/dac/mcp4725.c | 9 +++++---- drivers/iio/gyro/itg3200_core.c | 9 +++++---- drivers/iio/health/afe4403.c | 9 +++++---- drivers/iio/health/afe4404.c | 9 +++++---- drivers/iio/light/al3010.c | 8 ++++---- drivers/iio/light/al3320a.c | 9 +++++---- drivers/iio/light/as73211.c | 9 +++++---- drivers/iio/light/bh1750.c | 6 +++--- drivers/iio/light/cm3605.c | 13 +++++-------- drivers/iio/light/gp2ap002.c | 14 +++++--------- drivers/iio/light/isl29028.c | 13 +++++-------- drivers/iio/light/tsl2583.c | 13 +++++-------- drivers/iio/light/tsl2591.c | 12 +++++------- drivers/iio/light/us5182d.c | 8 +++----- drivers/iio/light/vcnl4000.c | 14 +++++--------- drivers/iio/light/vcnl4035.c | 14 +++++--------- drivers/iio/light/veml6030.c | 14 +++++--------- drivers/iio/magnetometer/ak8974.c | 14 +++++--------- drivers/iio/magnetometer/yamaha-yas530.c | 14 +++++--------- drivers/iio/proximity/cros_ec_mkbp_proximity.c | 8 ++++---- drivers/iio/temperature/ltc2983.c | 9 +++++---- 36 files changed, 165 insertions(+), 192 deletions(-)--
2.36.1
Jonathan Cameron
maintainerQuoted 5 lines · On Tue, 28 Jun 2022 00:13:45 +0100 Paul Cercueil <[email protected]> wrote:
Hi Jonathan,
Every patch looks fine to me, so:
Reviewed-by Paul Cercueil <[email protected]>
Thanks!
Series applied to the togreg branch of iio.git and pushed out as testing for a very brief exposure to 0-day before letting next see them.
Thanks,
Jonathan
Quoted 158 lines
for the whole series.
Cheers,
-PaulQuoted 147 lines · Jonathan Cameron
From: Jonathan Cameron <[email protected]>
After Paul's work [1] to cleanup us the PM related macros allow use of
pm_ptr()andpm_sleep_ptr()making the compiler figure out what structures and functions can be dropped without__maybe_unused
mess, I've been working through converting IIO.
[1]
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/include/linux/pm.h?id=c06ef740d401d0f4ab188882bf6f8d9cf0f75eafThis particular set is the low hanging fruit. The majority of the remainder in IIO require more thought because:
1) They only have runtime pm callbacks, but no sleep ones. Need to check
there is no reason we can't use use theforce_runtime_suspend
approach.
2) Odd cases like using same functions for sleep and runtime pm but not
via force runtime suspend.
3) Other weird corner cases where I want to take a closer look before sending them out (I think some of them are buggy).Anyhow, whilst I've CC'd a lot of people I suspect some will no longer be active on these addresses - hence if anyone has time to look at a few
patches rather than just the ones for drivers they maintain that would be much appreciated. In some cases I haven't CC'd anyone on a particular
patch because I'm fairly sure the author is not longer at the same address. Any review of those ones in particular would be great.Thanks,
Jonathan
Jonathan Cameron (36):
iio: accel: bma220: Switch toDEFINE_SIMPLE_DEV_PM_OPS()andpm_sleep_ptr() iio: adc: ad799x: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: adc: at91-sam5d2: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: adc: imx7d_adc: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: adc: meson_saradc: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: adc: mt6577_auxadc: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: adc: stmpe-adc: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: adc: ti-am335x: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: adc: xilinx-ams: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: chemical: scd4x: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: dac: ds4424: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: dac: ltc1660: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: dac: max517: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: dac: max5821: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: dac: mcp4725: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: gyro: itg3200: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: health: afe4403: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: health: afe4404: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: light: al3010: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: light: al3320a: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: light: as73211: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: light: bh1750: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: light: cm3605: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: proximity: cros_ec_mkbp: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() iio: temperature: ltc2983: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()iio: light: us5182: Switch from
CONFIG_PMguards topm_ptr()etc
iio: adc: imx8qxp: Switch toDEFINE_RUNTIME_DEV_PM_OPSandpm_ptr()
iio: light: gp2ap002: Switch toDEFINE_RUNTIME_DEV_PM_OPSandpm_ptr()
iio: light: isl29028: UseDEFINE_RUNTIME_DEV_PM_OPS()andpm_ptr()
iio: light: tsl2583: UseDEFINE_RUNTIME_DEV_PM_OPSandpm_ptr()
iio: light: tsl2591: UseDEFINE_RUNTIME_DEV_PM_OPS()andpm_ptr()
iio: light: vcnl4000: UseDEFINE_RUNTIME_DEV_PM_OPS()andpm_ptr()
macros
iio: light: vcnl4035: UseDEFINE_RUNTIME_DEV_PM_OPS()andpm_ptr()
macros
iio: light: veml6030: UseDEFINE_RUNTIME_DEV_PM_OPS()andpm_ptr()
macros
iio: magnetometer: ak8974: UseDEFINE_RUNTIME_DEV_PM_OPS()and
pm_ptr()macros
iio: magn: yas530: UseDEFINE_RUNTIME_DEV_PM_OPS()andpm_ptr()
macrosdrivers/iio/accel/bma220_spi.c | 8 ++++---- drivers/iio/adc/ad799x.c | 8 ++++---- drivers/iio/adc/at91-sama5d2_adc.c | 9 +++++---- drivers/iio/adc/imx7d_adc.c | 5 +++-- drivers/iio/adc/imx8qxp-adc.c | 13 ++++++------- drivers/iio/adc/meson_saradc.c | 10 +++++----- drivers/iio/adc/mt6577_auxadc.c | 12 ++++++------ drivers/iio/adc/stmpe-adc.c | 6 +++--- drivers/iio/adc/ti_am335x_adc.c | 8 ++++---- drivers/iio/adc/xilinx-ams.c | 8 ++++---- drivers/iio/chemical/scd4x.c | 8 ++++---- drivers/iio/dac/ds4424.c | 8 ++++---- drivers/iio/dac/ltc1660.c | 9 +++++---- drivers/iio/dac/max517.c | 8 ++++---- drivers/iio/dac/max5821.c | 9 +++++---- drivers/iio/dac/mcp4725.c | 9 +++++---- drivers/iio/gyro/itg3200_core.c | 9 +++++---- drivers/iio/health/afe4403.c | 9 +++++---- drivers/iio/health/afe4404.c | 9 +++++---- drivers/iio/light/al3010.c | 8 ++++---- drivers/iio/light/al3320a.c | 9 +++++---- drivers/iio/light/as73211.c | 9 +++++---- drivers/iio/light/bh1750.c | 6 +++--- drivers/iio/light/cm3605.c | 13 +++++-------- drivers/iio/light/gp2ap002.c | 14 +++++--------- drivers/iio/light/isl29028.c | 13 +++++-------- drivers/iio/light/tsl2583.c | 13 +++++-------- drivers/iio/light/tsl2591.c | 12 +++++------- drivers/iio/light/us5182d.c | 8 +++----- drivers/iio/light/vcnl4000.c | 14 +++++--------- drivers/iio/light/vcnl4035.c | 14 +++++--------- drivers/iio/light/veml6030.c | 14 +++++--------- drivers/iio/magnetometer/ak8974.c | 14 +++++--------- drivers/iio/magnetometer/yamaha-yas530.c | 14 +++++--------- drivers/iio/proximity/cros_ec_mkbp_proximity.c | 8 ++++---- drivers/iio/temperature/ltc2983.c | 9 +++++---- 36 files changed, 165 insertions(+), 192 deletions(-)--
2.36.1