mbox series

[v2,00/51] iio: Tree wide switch from CONFIG_PM* to pm_[sleep]_ptr etc.

Message ID 20220102125617.1259804-1-jic23@kernel.org (mailing list archive)
Headers show
Series iio: Tree wide switch from CONFIG_PM* to pm_[sleep]_ptr etc. | expand

Message

Jonathan Cameron Jan. 2, 2022, 12:55 p.m. UTC
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Previously "iio: Tree wide switch from CONFIG_PM* to __maybe_unused etc."

Note I've kept tags given for v1 having concluded the changes were fairly
minor, but if anyone wants me to drop a tag let me know (it was a bit
borderline in my view).

I have a follow up series to convert the existing cases that looked like the
results of the v1 version of this series but will sit on that until this
has had some review given this set is already rather too large.  For those
I'll probably do some groupings rather than one patch per file.

In the discussion of v1 Paul proposed a change to how pm_ptr() and
related macros are defined to remove the need to mark the various
functions as __maybe_unused.  That culminated in the patch:

https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git/commit/?id=1a3c7bb088266fa2db017be299f91f1c1894c857

which is currently queued up by Rafael in the linux-pm tree for the
merge window.  This series depends on that patch.

So the main changes since v1:

* Drop all the __maybe_unused markings
* Switch from SIMPLE_DEV_PM_OPS() to DEFINE_SIMPLE_DEV_PM_OPS()
* Switch from SET_RUNTIME_PM_OPS() to RUNTIME_PM_OPS()
* Switch from SET_SYSTEM_SLEEP_PM_OPS() to SYSTEM_SLEEP_PM_OPS()
* Use pm_sleep_ptr() with DEFINE_SIMPLE_DEV_PM_OPS() cases
* Use pm_ptr() with al other cases
* Drop patches change cases where the dev_pm_ops structure is exported
  to other modules as the compiler can't remove those cases automatically
  and more thought is needed.
* Add some additional drivers that I'd missed on the first round.

Note this does not cover all cases of CONFIG_PM* in IIO as some are
considerably more complicated and this approach may not be suitable.

Overall motivation for the series remains the same as for V1:
* Code reduction and improvement in readability.
* Reduce the chance I'll have to ask people to change how they do
  this in future drivers (cut and paste fun)

Note that in some cases letting the compiler remove the code results
in small reductions in module size, particularly when CONFIG_PM_SLEEP
is not defined.

I've kept this at one patch per driver as personally I prefer to
do this for all but most trivial of patches as it makes backports that
cross with this series simpler (though they will now require the
dependency called out above). It also avoids the complexity of tagging
when people wish to call out the subset they have reviewed.

Note there are drivers in here where the author has probably moved
onto other things, so if people have time to review patches in addition
to those I've explicitly cc'd them on that would be great!

Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Anson Huang <anson.huang@nxp.com>
Cc: Brian Masney <masneyb@onstation.org>
Cc: Crt Mori <cmo@melexis.com>
Cc: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>
Cc: Icenowy Zheng <icenowy@aosc.io>
Cc: Jonathan Albrieux <jonathan.albrieux@gmail.com>
Cc: Krzysztof Kozlowski <krzk@kernel.org>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Luca Weiss <luca@z3ntu.xyz>
Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
Cc: Manivannan Sadhasivam <mani@kernel.org>
Cc: Martijn Braam <martijn@brixit.nl>
Cc: Maslov Dmitry <maslovdmitry@seeed.cc>
Cc: Matt Ranostay <matt.ranostay@konsulko.com
Cc: Mikko Koivunen <mikko.koivunen@fi.rohmeurope.com>
Cc: Olivier Moysan <olivier.moysan@foss.st.com>
Cc: Stefan-Gabriel Mirea <stefan-gabriel.mirea@nxp.com>
Cc: Vaishnav M A <vaishnav@beagleboard.org>

Jonathan Cameron (51):
  iio:accel:da311: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
    etc
  iio:accel:da280: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
    etc
  iio:accel:dmard06: Switch from CONFIG_PM_SLEEP guards to
    pm_sleep_ptr() etc
  iio:accel:dmard10: Switch from CONFIG_PM guards to pm_sleep_ptr() etc
  iio:accel:mc3230: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
    etc
  iio:accel:mma7660: Switch from CONFIG_PM_SLEEP guards to
    pm_sleep_ptr()
  iio:accel:mma9551: Switch from CONFIG_PM guards to pm_ptr() etc
  iio:accel:mma9553: Switch from CONFIG_PM guards to pm_ptr() etc
  iio:accel:stk8ba50: Switch from CONFIG_PM_SLEEP guards to
    pm_sleep_ptr() etc
  iio:accel:kxsd9: Switch from CONFIG_PM guards to pm_ptr() etc
  iio:adc:ab8500: Switch from CONFIG_PM guards to pm_ptr() etc
  iio:adc:at91-adc: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
    etc
  iio:adc:exynos_adc: Switch from CONFIG_PM_SLEEP guards to
    pm_sleep_ptr()
  iio:adc:palmas_gpadc: Switch from CONFIG_PM_SLEEP guards to
    pm_sleep_ptr()
  iio:adc:stm32:Switch from CONFIG_PM guards to pm_ptr()
  iio:adc:rcar: Switch from CONFIG_PM guards to pm_ptr() etc
  iio:adc:rockchip: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
    etc
  iio:adc:twl6030: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
    etc
  iio:adc:vf610: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
    etc
  iio:common:ssp: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
    etc
  iio:dac:vf610: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
    etc
  iio:light:apds9300: Switch from CONFIG_PM_SLEEP guards to
    pm_sleep_ptr() etc
  iio:light:bh1780: Switch from CONFIG_PM guards to pm_ptr() etc
  iio:light:cm3232: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
    etc
  iio:light:isl29018: Switch from CONFIG_PM_SLEEP guards to
    pm_sleep_ptr()
  iio:light:isl29125: Switch from CONFIG_PM_SLEEP guards to
    pm_sleep_ptr() etc
  iio:light:jsa1212: Switch from CONFIG_PM_SLEEP guards to
    pm_sleep_ptr() etc
  iio:light:ltr501: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
    etc
  iio:light:stk3310: Switch from CONFIG_PM_SLEEP guards to
    pm_sleep_ptr() etc
  iio:light:tcs3414: Switch from CONFIG_PM_SLEEP guards to
    pm_sleep_ptr() etc
  iio:light:tcs3472: Switch from CONFIG_PM_SLEEP guards to
    pm_sleep_ptr() etc
  iio:light:tsl2563: Switch from CONFIG_PM_SLEEP guards to
    pm_sleep_ptr() etc
  iio:light:tsl4531: Switch from CONFIG_PM_SLEEP guards to
    pm_sleep_ptr() etc
  iio:light:us5182: Switch from CONFIG_PM guards to pm_ptr() etc
  iio:magn:ak8975: Switch from CONFIG_PM guards to pm_ptr() etc
  iio:magn:mag3110: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
    etc
  iio:magn:mmc35240: Switch from CONFIG_PM_SLEEP guards to
    pm_sleep_ptr() etc
  iio:pressure:mpl3115: Switch from CONFIG_PM_SLEEP guards to
    pm_sleep_ptr() etc
  iio:proximity:as3935: Switch from CONFIG_PM_SLEEP guards to
    pm_sleep_ptr() etc
  iio:proximity:pulsedlight: Switch from CONFIG_PM guards to pm_ptr()
    etc
  iio:proximity:rfd77492: Switch from CONFIG_PM_SLEEP guards to
    pm_sleep_ptr() etc
  iio:proximity:sx9500: Switch from CONFIG_PM_SLEEP guards to
    pm_sleep_ptr() etc
  iio:temperature:tmp006: Switch from CONFIG_PM_SLEEP guards to
    pm_sleep_ptr() etc
  iio:temperature:tmp007: Switch from CONFIG_PM_SLEEP guards to
    pm_sleep_ptr() etc
  iio:chemical:atlas: Switch from CONFIG_PM guards to pm_ptr() etc
  iio:accel:stk8312: Switch from CONFIG_PM_SLEEP guards to
    pm_sleep_ptr() etc
  iio:accel:bma180: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
    etc
  iio:dac:m62332: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
    etc
  iio:imu:kmx61: Switch from CONFIG_PM* guards to pm_ptr() etc
  iio:light:rpr0521: Switch from CONFIG_PM guards to pm_ptr() etc
  iio:temperature:mlx90614: Switch from CONFIG_PM* guards to pm_ptr()
    etc

 drivers/iio/accel/bma180.c                        |  9 ++-------
 drivers/iio/accel/da280.c                         |  6 ++----
 drivers/iio/accel/da311.c                         |  6 ++----
 drivers/iio/accel/dmard06.c                       | 10 +++-------
 drivers/iio/accel/dmard10.c                       |  7 +++----
 drivers/iio/accel/kxsd9-i2c.c                     |  2 +-
 drivers/iio/accel/kxsd9-spi.c                     |  2 +-
 drivers/iio/accel/kxsd9.c                         |  8 ++------
 drivers/iio/accel/mc3230.c                        |  6 ++----
 drivers/iio/accel/mma7660.c                       | 10 ++--------
 drivers/iio/accel/mma9551.c                       | 11 +++--------
 drivers/iio/accel/mma9553.c                       | 11 +++--------
 drivers/iio/accel/stk8312.c                       | 10 ++--------
 drivers/iio/accel/stk8ba50.c                      | 10 ++--------
 drivers/iio/adc/ab8500-gpadc.c                    | 12 ++++--------
 drivers/iio/adc/at91_adc.c                        |  6 ++----
 drivers/iio/adc/exynos_adc.c                      | 10 ++++------
 drivers/iio/adc/palmas_gpadc.c                    | 10 +++-------
 drivers/iio/adc/rcar-gyroadc.c                    |  6 ++----
 drivers/iio/adc/rockchip_saradc.c                 |  6 ++----
 drivers/iio/adc/stm32-adc-core.c                  | 13 +++++--------
 drivers/iio/adc/stm32-adc.c                       | 12 ++++--------
 drivers/iio/adc/twl6030-gpadc.c                   |  8 +++-----
 drivers/iio/adc/vf610_adc.c                       |  6 ++----
 drivers/iio/chemical/atlas-sensor.c               |  7 ++-----
 drivers/iio/common/ssp_sensors/ssp_dev.c          |  8 ++------
 drivers/iio/dac/m62332.c                          |  9 ++-------
 drivers/iio/dac/vf610_dac.c                       |  6 ++----
 drivers/iio/imu/kmx61.c                           | 10 +++-------
 drivers/iio/light/apds9300.c                      |  9 ++-------
 drivers/iio/light/bh1780.c                        | 10 +++-------
 drivers/iio/light/cm3232.c                        |  9 ++-------
 drivers/iio/light/isl29018.c                      |  9 ++-------
 drivers/iio/light/isl29125.c                      |  6 ++----
 drivers/iio/light/jsa1212.c                       | 10 ++--------
 drivers/iio/light/ltr501.c                        |  6 ++----
 drivers/iio/light/rpr0521.c                       |  7 ++-----
 drivers/iio/light/stk3310.c                       | 10 ++--------
 drivers/iio/light/tcs3414.c                       |  6 ++----
 drivers/iio/light/tcs3472.c                       |  6 ++----
 drivers/iio/light/tsl2563.c                       |  9 ++-------
 drivers/iio/light/tsl4531.c                       |  9 ++-------
 drivers/iio/light/us5182d.c                       |  8 +++-----
 drivers/iio/magnetometer/ak8975.c                 | 10 +++-------
 drivers/iio/magnetometer/mag3110.c                |  9 ++-------
 drivers/iio/magnetometer/mmc35240.c               |  8 ++------
 drivers/iio/pressure/mpl3115.c                    |  9 ++-------
 drivers/iio/proximity/as3935.c                    | 10 ++--------
 drivers/iio/proximity/pulsedlight-lidar-lite-v2.c |  7 ++-----
 drivers/iio/proximity/rfd77402.c                  |  6 ++----
 drivers/iio/proximity/sx9500.c                    |  8 ++------
 drivers/iio/temperature/mlx90614.c                | 12 ++++--------
 drivers/iio/temperature/tmp006.c                  |  6 ++----
 drivers/iio/temperature/tmp007.c                  |  6 ++----
 54 files changed, 127 insertions(+), 315 deletions(-)