All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: linux-iio@vger.kernel.org
Cc: Lars-Peter Clausen <lars@metafoo.de>,
	Paul Cercueil <paul@crapouillou.net>,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Anson Huang <anson.huang@nxp.com>,
	Brian Masney <masneyb@onstation.org>,
	Fabrice Gasnier <fabrice.gasnier@foss.st.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Heiko Stuebner <heiko.stuebner@theobroma-systems.com>,
	Icenowy Zheng <icenowy@aosc.io>,
	Jonathan Albrieux <jonathan.albrieux@gmail.com>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Luca Weiss <luca@z3ntu.xyz>,
	Ludovic Desroches <ludovic.desroches@microchip.com>,
	Manivannan Sadhasivam <mani@kernel.org>,
	Martijn Braam <martijn@brixit.nl>,
	Maslov Dmitry <maslovdmitry@seeed.cc>,
	Olivier Moysan <olivier.moysan@foss.st.com>,
	Stefan-Gabriel Mirea <stefan-gabriel.mirea@nxp.com>,
	Vaishnav M A <vaishnav@beagleboard.org>
Subject: [PATCH 00/49] iio: Tree wide switch from CONFIG_PM* to __maybe_unused etc.
Date: Tue, 23 Nov 2021 21:09:30 +0000	[thread overview]
Message-ID: <20211123211019.2271440-1-jic23@kernel.org> (raw)

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Note this series includes many drivers that are quite old and I'm not
sure have active maintainers.  Hence if anyone has time to look at some
of these beyond their own drivers and sanity check them it would be much
appreciated!

Two motivations behind this set.
1 - General code reduction and improvement in readability in these drivers.
2 - Reduce change I'll have to ask people to change how they do this in
    future patches.

Mostly this is just a case of letting the compiler work out it can remove
the PM related functions rather than using #ifdefs in the code to do so.

The __maybe_unused markings make it clear we are intentionally building
functions that the compiler can see are unused and remove in some build
configurations.

The new pm_ptr() macro is rather convenient to got futher than many of
the drivers were and when CONFIG_PM is not define ensure that the
struct dev_pm_ops can also be removed.  Note there is a subtlty in that
we only remove that whe CONFIG_PM is not defined whereas a few of these
drivers were using CONFIG_PM_SLEEP which is a tighter condition (will
remove the structure in more configurations).  I think that's a small
price to pay for the convenience this macro brings.

I did this set as one patch per driver, as personally I prefer that
option for all but the most trivial patches because it makes backports
that cross with this series simpler and also avoid the complex
tag giving we get for sets touching code from many authors.

All comments welcome.

Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Anson Huang <anson.huang@nxp.com>
Cc: Brian Masney <masneyb@onstation.org>
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: 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 (49):
  iio:accel:da311: Switch from CONFIG_PM_SLEEP guards to pm_ptr() /
    __maybe_unused
  iio:accel:da280: Switch from CONFIG_PM_SLEEP guards to pm_ptr() /
    __maybe_unused
  iio:accel:dmard06: Switch from CONFIG_PM_SLEEP guards to pm_ptr() /
    __maybe_unused
  iio:accel:dmard10: Switch from CONFIG_PM guards to pm_ptr() /
    __maybe_unused
  iio:accel:mc3230: Switch from CONFIG_PM_SLEEP guards to pm_ptr() /
    __maybe_unused
  iio:accel:mma7660: Switch from CONFIG_PM_SLEEP guards to pm_ptr() /
    __maybe_unused
  iio:accel:mma9551: Switch from CONFIG_PM guards to pm_ptr() /
    __maybe_unused
  iio:accel:mma9553: Switch from CONFIG_PM guards to pm_ptr() /
    __maybe_unused
  iio:accel:stk8ba50: Switch from CONFIG_PM_SLEEP guards to pm_ptr() /
    __maybe_unused
  iio:accel:kxsd9: Switch from CONFIG_PM guards to pm_ptr() /
    __maybe_unused
  iio:adc:ab8500: Switch from CONFIG_PM guards to pm_ptr() /
    __maybe_unused
  iio:adc:ad7606: Switch from CONFIG_PM_SLEEP guards to pm_ptr() /
    __maybe_unused
  iio:adc:at91-adc: Switch from CONFIG_PM_SLEEP guards to pm_ptr() /
    __maybe_unused
  iio:adc:exynos_adc: Switch from CONFIG_PM_SLEEP guards to pm_ptr() /
    __maybe_unused
  iio:adc:palmas_gpadc: Switch from CONFIG_PM_SLEEP guards to pm_ptr() /
    __maybe_unused
  iio:adc:stm32:Switch from CONFIG_PM guards to pm_ptr() /
    __maybe_unused
  iio:adc:rcar: Switch from CONFIG_PM guards to pm_ptr() /
    __maybe_unused
  iio:adc:rockchip: Switch from CONFIG_PM_SLEEP guards to pm_ptr() /
    __maybe_unused
  iio:adc:twl6030: Switch from CONFIG_PM_SLEEP guards to pm_ptr() /
    __maybe_unused
  iio:adc:vf610: Switch from CONFIG_PM_SLEEP guards to pm_ptr() /
    __maybe_unused
  iio:common:ssp: Switch from CONFIG_PM_SLEEP guards to pm_ptr() /
    __maybe_unused
  iio:dac:vf610: Switch from CONFIG_PM_SLEEP guards to pm_ptr() /
    __maybe_unused
  iio:light:apds9300: Switch from CONFIG_PM_SLEEP guards to pm_ptr() /
    __maybe_unused
  iio:light:bh1780: Switch from CONFIG_PM guards to pm_ptr() /
    __maybe_unused
  iio:light:cm3232: Switch from CONFIG_PM_SLEEP guards to pm_ptr() /
    __maybe_unused
  iio:light:isl29018: Switch from CONFIG_PM_SLEEP guards to pm_ptr() /
    __maybe_unused
  iio:light:isl29125: Switch from CONFIG_PM_SLEEP guards to pm_ptr() /
    __maybe_unused
  iio:light:jsa1212: Switch from CONFIG_PM_SLEEP guards to pm_ptr() /
    __maybe_unused
  iio:light:ltr501: Switch from CONFIG_PM_SLEEP guards to pm_ptr() /
    __maybe_unused
  iio:light:stk3310: Switch from CONFIG_PM_SLEEP guards to pm_ptr() /
    __maybe_unused
  iio:light:tcs3414: Switch from CONFIG_PM_SLEEP guards to pm_ptr() /
    __maybe_unused
  iio:light:tcs3472: Switch from CONFIG_PM_SLEEP guards to pm_ptr() /
    __maybe_unused
  iio:light:tsl2563: Switch from CONFIG_PM_SLEEP guards to pm_ptr() /
    __maybe_unused
  iio:light:tsl4531: Switch from CONFIG_PM_SLEEP guards to pm_ptr() /
    __maybe_unused
  iio:light:us5182: Switch from CONFIG_PM guards to pm_ptr() /
    __maybe_unused
  iio:magn:ak8975: Switch from CONFIG_PM guards to pm_ptr() /
    __maybe_unused
  iio:magn:hmc5843: Switch from CONFIG_PM_SLEEP guards to pm_ptr() /
    __maybe_unused
  iio:magn:mag3110: Switch from CONFIG_PM_SLEEP guards to pm_ptr() /
    __maybe_unused
  iio:magn:mmc35240: Switch from CONFIG_PM_SLEEP guards to pm_ptr() /
    __maybe_unused
  iio:pressure:mpl3115: Switch from CONFIG_PM_SLEEP guards to pm_ptr() /
    __maybe_unused
  iio:pressure:bmp280: Switch from CONFIG_PM guards to pm_ptr() /
    __maybe_unused
  iio:proximity:as3935: Switch from CONFIG_PM_SLEEP guards to pm_ptr() /
    __maybe_unused
  iio:proximity:pulsedlight: Switch from CONFIG_PM guards to pm_ptr() /
    __maybe_unused
  iio:proximity:rfd77492: Switch from CONFIG_PM_SLEEP guards to pm_ptr()
    / __maybe_unused
  iio:proximity:sx9500: Switch from CONFIG_PM_SLEEP guards to pm_ptr() /
    __maybe_unused
  iio:temperature:tmp006: Switch from CONFIG_PM_SLEEP guards to pm_ptr()
    / __maybe_unused
  iio:temperature:tmp007: Switch from CONFIG_PM_SLEEP guards to pm_ptr()
    / __maybe_unused
  iio:gyro:mpu3050: Switch from CONFIG_PM guards to pm_ptr() /
    __maybe_unused
  iio:chemical:atlas: Switch from CONFIG_PM guards to pm_ptr() /
    __maybe_unused

 drivers/iio/accel/da280.c                        |  6 ++----
 drivers/iio/accel/da311.c                        |  8 +++-----
 drivers/iio/accel/dmard06.c                      | 12 ++++--------
 drivers/iio/accel/dmard10.c                      |  9 ++++-----
 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                       |  8 +++-----
 drivers/iio/accel/mma7660.c                      | 12 +++---------
 drivers/iio/accel/mma9551.c                      | 16 ++++++----------
 drivers/iio/accel/mma9553.c                      | 16 ++++++----------
 drivers/iio/accel/stk8ba50.c                     | 12 +++---------
 drivers/iio/adc/ab8500-gpadc.c                   | 10 ++++------
 drivers/iio/adc/ad7606.c                         |  8 ++------
 drivers/iio/adc/ad7606.h                         |  5 -----
 drivers/iio/adc/ad7606_par.c                     |  2 +-
 drivers/iio/adc/ad7606_spi.c                     |  2 +-
 drivers/iio/adc/at91_adc.c                       |  8 +++-----
 drivers/iio/adc/exynos_adc.c                     |  8 +++-----
 drivers/iio/adc/palmas_gpadc.c                   | 14 ++++++--------
 drivers/iio/adc/rcar-gyroadc.c                   | 10 ++++------
 drivers/iio/adc/rockchip_saradc.c                |  8 +++-----
 drivers/iio/adc/stm32-adc-core.c                 | 12 +++++-------
 drivers/iio/adc/stm32-adc.c                      | 16 ++++++----------
 drivers/iio/adc/twl6030-gpadc.c                  |  8 +++-----
 drivers/iio/adc/vf610_adc.c                      |  8 +++-----
 drivers/iio/chemical/atlas-sensor.c              | 10 ++++------
 drivers/iio/common/ssp_sensors/ssp_dev.c         | 12 ++++--------
 drivers/iio/dac/vf610_dac.c                      |  8 +++-----
 drivers/iio/gyro/mpu3050-core.c                  |  8 +++-----
 drivers/iio/gyro/mpu3050-i2c.c                   |  2 +-
 drivers/iio/light/apds9300.c                     | 11 +++--------
 drivers/iio/light/bh1780.c                       | 10 ++++------
 drivers/iio/light/cm3232.c                       | 13 ++++---------
 drivers/iio/light/isl29018.c                     | 11 +++--------
 drivers/iio/light/isl29125.c                     |  8 +++-----
 drivers/iio/light/jsa1212.c                      | 12 +++---------
 drivers/iio/light/ltr501.c                       |  8 +++-----
 drivers/iio/light/stk3310.c                      | 12 +++---------
 drivers/iio/light/tcs3414.c                      |  8 +++-----
 drivers/iio/light/tcs3472.c                      |  8 +++-----
 drivers/iio/light/tsl2563.c                      | 11 +++--------
 drivers/iio/light/tsl4531.c                      | 11 +++--------
 drivers/iio/light/us5182d.c                      | 10 ++++------
 drivers/iio/magnetometer/ak8975.c                | 10 ++++------
 drivers/iio/magnetometer/hmc5843.h               |  5 -----
 drivers/iio/magnetometer/hmc5843_i2c.c           |  2 +-
 drivers/iio/magnetometer/hmc5843_spi.c           |  2 +-
 drivers/iio/magnetometer/mag3110.c               | 11 +++--------
 drivers/iio/magnetometer/mmc35240.c              | 12 ++++--------
 drivers/iio/pressure/bmp280-core.c               |  6 ++----
 drivers/iio/pressure/bmp280-i2c.c                |  2 +-
 drivers/iio/pressure/bmp280-spi.c                |  2 +-
 drivers/iio/pressure/mpl3115.c                   | 11 +++--------
 drivers/iio/proximity/as3935.c                   | 12 +++---------
 .../iio/proximity/pulsedlight-lidar-lite-v2.c    | 10 ++++------
 drivers/iio/proximity/rfd77402.c                 |  8 +++-----
 drivers/iio/proximity/sx9500.c                   | 12 ++++--------
 drivers/iio/temperature/tmp006.c                 |  8 +++-----
 drivers/iio/temperature/tmp007.c                 |  8 +++-----
 60 files changed, 180 insertions(+), 344 deletions(-)

-- 
2.34.0


             reply	other threads:[~2021-11-23 21:05 UTC|newest]

Thread overview: 83+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-23 21:09 Jonathan Cameron [this message]
2021-11-23 21:09 ` [PATCH 01/49] iio:accel:da311: Switch from CONFIG_PM_SLEEP guards to pm_ptr() / __maybe_unused Jonathan Cameron
2021-11-23 21:09 ` [PATCH 02/49] iio:accel:da280: " Jonathan Cameron
2021-11-23 22:17   ` Paul Cercueil
2021-11-24  9:48     ` Jonathan Cameron
2021-11-23 21:09 ` [PATCH 03/49] iio:accel:dmard06: " Jonathan Cameron
2021-11-23 21:09 ` [PATCH 04/49] iio:accel:dmard10: Switch from CONFIG_PM " Jonathan Cameron
2021-11-23 21:09 ` [PATCH 05/49] iio:accel:mc3230: Switch from CONFIG_PM_SLEEP " Jonathan Cameron
2021-11-23 21:37   ` Hans de Goede
2021-11-23 21:09 ` [PATCH 06/49] iio:accel:mma7660: " Jonathan Cameron
2021-11-23 21:09 ` [PATCH 07/49] iio:accel:mma9551: Switch from CONFIG_PM " Jonathan Cameron
2021-11-23 21:09 ` [PATCH 08/49] iio:accel:mma9553: " Jonathan Cameron
2021-11-23 21:09 ` [PATCH 09/49] iio:accel:stk8ba50: Switch from CONFIG_PM_SLEEP " Jonathan Cameron
2021-11-23 21:09 ` [PATCH 10/49] iio:accel:kxsd9: Switch from CONFIG_PM " Jonathan Cameron
2021-11-23 21:09 ` [PATCH 11/49] iio:adc:ab8500: " Jonathan Cameron
2021-11-25 16:55   ` Linus Walleij
2021-11-23 21:09 ` [PATCH 12/49] iio:adc:ad7606: Switch from CONFIG_PM_SLEEP " Jonathan Cameron
2022-01-01 16:27   ` Jonathan Cameron
2021-11-23 21:09 ` [PATCH 13/49] iio:adc:at91-adc: " Jonathan Cameron
2021-11-24  9:16   ` Alexandre Belloni
2021-11-23 21:09 ` [PATCH 14/49] iio:adc:exynos_adc: " Jonathan Cameron
2021-11-25  8:50   ` Krzysztof Kozlowski
2021-11-23 21:09 ` [PATCH 15/49] iio:adc:palmas_gpadc: " Jonathan Cameron
2022-01-01 16:38   ` Jonathan Cameron
2021-11-23 21:09 ` [PATCH 16/49] iio:adc:stm32:Switch from CONFIG_PM " Jonathan Cameron
2021-11-24  9:33   ` Fabrice Gasnier
2021-11-23 21:09 ` [PATCH 17/49] iio:adc:rcar: Switch " Jonathan Cameron
2021-11-23 21:09 ` [PATCH 18/49] iio:adc:rockchip: Switch from CONFIG_PM_SLEEP " Jonathan Cameron
2021-11-23 21:09 ` [PATCH 19/49] iio:adc:twl6030: " Jonathan Cameron
2021-11-23 21:09 ` [PATCH 20/49] iio:adc:vf610: " Jonathan Cameron
2021-11-23 21:09 ` [PATCH 21/49] iio:common:ssp: " Jonathan Cameron
2021-11-23 21:09 ` [PATCH 22/49] iio:dac:vf610: " Jonathan Cameron
2021-11-23 21:09 ` [PATCH 23/49] iio:light:apds9300: " Jonathan Cameron
2021-11-23 21:09 ` [PATCH 24/49] iio:light:bh1780: Switch from CONFIG_PM " Jonathan Cameron
2021-11-25 16:56   ` Linus Walleij
2021-11-23 21:09 ` [PATCH 25/49] iio:light:cm3232: Switch from CONFIG_PM_SLEEP " Jonathan Cameron
2021-11-23 21:09 ` [PATCH 26/49] iio:light:isl29018: " Jonathan Cameron
2021-11-23 21:09 ` [PATCH 27/49] iio:light:isl29125: " Jonathan Cameron
2021-11-23 21:09 ` [PATCH 28/49] iio:light:jsa1212: " Jonathan Cameron
2021-11-23 21:09 ` [PATCH 29/49] iio:light:ltr501: " Jonathan Cameron
2021-11-23 21:10 ` [PATCH 30/49] iio:light:stk3310: " Jonathan Cameron
2021-11-23 21:10 ` [PATCH 31/49] iio:light:tcs3414: " Jonathan Cameron
2021-11-23 21:10 ` [PATCH 32/49] iio:light:tcs3472: " Jonathan Cameron
2021-11-23 21:10 ` [PATCH 33/49] iio:light:tsl2563: " Jonathan Cameron
2021-11-23 21:10 ` [PATCH 34/49] iio:light:tsl4531: " Jonathan Cameron
2021-11-23 21:10 ` [PATCH 35/49] iio:light:us5182: Switch from CONFIG_PM " Jonathan Cameron
2021-11-23 21:10 ` [PATCH 36/49] iio:magn:ak8975: " Jonathan Cameron
2021-11-23 22:24   ` Matt Ranostay
2021-11-23 21:10 ` [PATCH 37/49] iio:magn:hmc5843: Switch from CONFIG_PM_SLEEP " Jonathan Cameron
2022-01-01 17:40   ` Jonathan Cameron
2021-11-23 21:10 ` [PATCH 38/49] iio:magn:mag3110: " Jonathan Cameron
2021-11-23 21:10 ` [PATCH 39/49] iio:magn:mmc35240: " Jonathan Cameron
2021-11-23 21:10 ` [PATCH 40/49] iio:pressure:mpl3115: " Jonathan Cameron
2021-11-23 21:10 ` [PATCH 41/49] iio:pressure:bmp280: Switch from CONFIG_PM " Jonathan Cameron
2021-11-25 16:56   ` Linus Walleij
2022-01-01 17:50   ` Jonathan Cameron
2021-11-23 21:10 ` [PATCH 42/49] iio:proximity:as3935: Switch from CONFIG_PM_SLEEP " Jonathan Cameron
2021-11-23 22:23   ` Matt Ranostay
2021-11-23 21:10 ` [PATCH 43/49] iio:proximity:pulsedlight: Switch from CONFIG_PM " Jonathan Cameron
2021-11-23 22:22   ` Matt Ranostay
2021-11-28 16:44     ` Jonathan Cameron
2021-11-23 21:10 ` [PATCH 44/49] iio:proximity:rfd77492: Switch from CONFIG_PM_SLEEP " Jonathan Cameron
2021-11-23 21:10 ` [PATCH 45/49] iio:proximity:sx9500: " Jonathan Cameron
2021-11-23 21:10 ` [PATCH 46/49] iio:temperature:tmp006: " Jonathan Cameron
2021-11-23 21:10 ` [PATCH 47/49] iio:temperature:tmp007: " Jonathan Cameron
2021-11-23 21:10 ` [PATCH 48/49] iio:gyro:mpu3050: Switch from CONFIG_PM " Jonathan Cameron
2021-11-25 16:56   ` Linus Walleij
2022-01-01 18:00   ` Jonathan Cameron
2021-11-23 21:10 ` [PATCH 49/49] iio:chemical:atlas: " Jonathan Cameron
2021-11-23 22:22   ` Matt Ranostay
2021-11-23 22:11 ` [PATCH 00/49] iio: Tree wide switch from CONFIG_PM* to __maybe_unused etc Paul Cercueil
2021-11-24  7:29   ` Arnd Bergmann
2021-11-24 10:11     ` Jonathan Cameron
2021-11-24 10:58       ` Paul Cercueil
2021-11-24 12:23       ` Arnd Bergmann
2021-11-24 15:10         ` Paul Cercueil
2021-11-27 18:09           ` Jonathan Cameron
2021-11-28  9:17             ` Arnd Bergmann
2021-11-28 12:44               ` Paul Cercueil
2021-11-27 18:02   ` Jonathan Cameron
2021-11-28  9:26     ` Arnd Bergmann
2021-11-28 12:30       ` Paul Cercueil
2021-11-24  0:58 ` Brian Masney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211123211019.2271440-1-jic23@kernel.org \
    --to=jic23@kernel.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=anson.huang@nxp.com \
    --cc=fabrice.gasnier@foss.st.com \
    --cc=hdegoede@redhat.com \
    --cc=heiko.stuebner@theobroma-systems.com \
    --cc=icenowy@aosc.io \
    --cc=jonathan.albrieux@gmail.com \
    --cc=krzk@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=luca@z3ntu.xyz \
    --cc=ludovic.desroches@microchip.com \
    --cc=mani@kernel.org \
    --cc=martijn@brixit.nl \
    --cc=maslovdmitry@seeed.cc \
    --cc=masneyb@onstation.org \
    --cc=olivier.moysan@foss.st.com \
    --cc=paul@crapouillou.net \
    --cc=stefan-gabriel.mirea@nxp.com \
    --cc=vaishnav@beagleboard.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.