mbox series

[00/14] power: reset: Drop platform_driver_probe() and convert to platform remove callback returning void

Message ID 20231104211501.3676352-16-u.kleine-koenig@pengutronix.de (mailing list archive)
Headers show
Series power: reset: Drop platform_driver_probe() and convert to platform remove callback returning void | expand

Message

Uwe Kleine-König Nov. 4, 2023, 9:15 p.m. UTC
Hello,

there are two different types of patches here that would justify to
different series. But as the patches are not independant I chose to put
them in a single series.

The first three patches drop usage of platform_driver_probe(). This is a
concept that isn't so relevant any more today. I didn't check, but it
saves typically only a few 100k and there are thoughts to deprecate it
to simplify the core. Getting the usage right is not trivial though the
at91 drivers got it nearly right. The alternative to these patches is to
add __ref to the driver struct ideally with a comment describing the
need like is e.g. done in commit 5b44abbc39ca ("platform/x86: hp-wmi::
Mark driver struct with __refdata to prevent section mismatch warning").

The remaining patches convert the platform drivers to .remove_new(), see
commit 5c5a7680e67b ("platform: Provide a remove callback that returns
no value") for an extended explanation and the eventual goal. All
conversions but one are trivial as the remove functions return zero
unconditionally. The only exception is the tps65086-restart driver.

Best regards
Uwe

Uwe Kleine-König (14):
  power: reset: at91-poweroff: Stop using module_platform_driver_probe()
  power: reset: at91-reset:: Stop using module_platform_driver_probe()
  power: reset: at91-sama5d2_shdwc: Stop using
    module_platform_driver_probe()
  power: reset: as3722-poweroff: Convert to platform remove callback
    returning void
  power: reset: at91-poweroff: Convert to platform remove callback
    returning void
  power: reset: atc260x-poweroff: Convert to platform remove callback
    returning void
  power: reset: ltc2952-poweroff: Convert to platform remove callback
    returning void
  power: reset: mt6323-poweroff: Convert to platform remove callback
    returning void
  power: reset: qnap-poweroff: Convert to platform remove callback
    returning void
  power: reset: regulator-poweroff: Convert to platform remove callback
    returning void
  power: reset: restart-poweroff: Convert to platform remove callback
    returning void
  power: reset: rmobile-reset: Convert to platform remove callback
    returning void
  power: reset: syscon-poweroff: Convert to platform remove callback
    returning void
  power: reset: tps65086-restart: Convert to platform remove callback
    returning void

 drivers/power/reset/as3722-poweroff.c    |  6 ++----
 drivers/power/reset/at91-poweroff.c      | 11 +++++------
 drivers/power/reset/at91-reset.c         |  9 +++++----
 drivers/power/reset/at91-sama5d2_shdwc.c |  9 +++++----
 drivers/power/reset/atc260x-poweroff.c   |  6 ++----
 drivers/power/reset/ltc2952-poweroff.c   |  5 ++---
 drivers/power/reset/mt6323-poweroff.c    |  6 ++----
 drivers/power/reset/qnap-poweroff.c      |  5 ++---
 drivers/power/reset/regulator-poweroff.c |  6 ++----
 drivers/power/reset/restart-poweroff.c   |  6 ++----
 drivers/power/reset/rmobile-reset.c      |  5 ++---
 drivers/power/reset/syscon-poweroff.c    |  6 ++----
 drivers/power/reset/tps65086-restart.c   | 12 +++++++-----
 13 files changed, 40 insertions(+), 52 deletions(-)


base-commit: e27090b1413ff236ca1aec26d6b022149115de2c

Comments

Uwe Kleine-König Nov. 5, 2023, 9:53 a.m. UTC | #1
Hello Sebastian,

On Sat, Nov 04, 2023 at 10:15:02PM +0100, Uwe Kleine-König wrote:
> there are two different types of patches here that would justify to
> different series. But as the patches are not independant I chose to put
> them in a single series.
> 
> The first three patches drop usage of platform_driver_probe(). This is a
> concept that isn't so relevant any more today. I didn't check, but it
> saves typically only a few 100k and there are thoughts to deprecate it
> to simplify the core. Getting the usage right is not trivial though the
> at91 drivers got it nearly right. The alternative to these patches is to
> add __ref to the driver struct ideally with a comment describing the
> need like is e.g. done in commit 5b44abbc39ca ("platform/x86: hp-wmi::
> Mark driver struct with __refdata to prevent section mismatch warning").
> 
> The remaining patches convert the platform drivers to .remove_new(), see
> commit 5c5a7680e67b ("platform: Provide a remove callback that returns
> no value") for an extended explanation and the eventual goal. All
> conversions but one are trivial as the remove functions return zero
> unconditionally. The only exception is the tps65086-restart driver.

I forgot to convert two of the drivers that used platform_driver_probe()
before. I added them as patches 15 and 16 to this series in the hope
that b4 (or whatever tool you use to apply patches) gets that right.

> Uwe Kleine-König (14):
>   power: reset: at91-poweroff: Stop using module_platform_driver_probe()
>   power: reset: at91-reset:: Stop using module_platform_driver_probe()

If you could do s/::/:/ on that patch description that would be great.
(Or should I resend for that?)

Best regards
Uwe
Sebastian Reichel Nov. 16, 2023, 12:38 a.m. UTC | #2
On Sat, 04 Nov 2023 22:15:02 +0100, Uwe Kleine-König wrote:
> there are two different types of patches here that would justify to
> different series. But as the patches are not independant I chose to put
> them in a single series.
> 
> The first three patches drop usage of platform_driver_probe(). This is a
> concept that isn't so relevant any more today. I didn't check, but it
> saves typically only a few 100k and there are thoughts to deprecate it
> to simplify the core. Getting the usage right is not trivial though the
> at91 drivers got it nearly right. The alternative to these patches is to
> add __ref to the driver struct ideally with a comment describing the
> need like is e.g. done in commit 5b44abbc39ca ("platform/x86: hp-wmi::
> Mark driver struct with __refdata to prevent section mismatch warning").
> 
> [...]

Applied, thanks!

[01/14] power: reset: at91-poweroff: Stop using module_platform_driver_probe()
        commit: 099806de68b75a0fe114376b1ee162fdff572ecc
[02/14] power: reset: at91-reset:: Stop using module_platform_driver_probe()
        commit: 12389c657b623da34ba9b30306e13919d0b42f3a
[03/14] power: reset: at91-sama5d2_shdwc: Stop using module_platform_driver_probe()
        commit: dde74a5de817e0a011e4783cf26295d7f6fdca26
[04/14] power: reset: as3722-poweroff: Convert to platform remove callback returning void
        commit: 904e582f0c7282b3d7c76c73c06f3ad3b0910335
[05/14] power: reset: at91-poweroff: Convert to platform remove callback returning void
        commit: a31438ece3ec27057c77822b0b0bc0614798c425
[06/14] power: reset: atc260x-poweroff: Convert to platform remove callback returning void
        commit: 6f539f3151721f1c90fcdafa2962c19a8efc1afc
[07/14] power: reset: ltc2952-poweroff: Convert to platform remove callback returning void
        commit: 6642b13206b2225b0d75451f5dd763574a2c8bb0
[08/14] power: reset: mt6323-poweroff: Convert to platform remove callback returning void
        commit: 99f7fa6c7cc573ebe2529959723b71b4d12ec2f5
[09/14] power: reset: qnap-poweroff: Convert to platform remove callback returning void
        commit: 1a0457ab2ce81d92c2077a79080141d924884c5f
[10/14] power: reset: regulator-poweroff: Convert to platform remove callback returning void
        commit: 6f7be7b2f15a654a5f08b7d37df282c171b9380b
[11/14] power: reset: restart-poweroff: Convert to platform remove callback returning void
        commit: aedd4da0aa27fe9d0b03b3fbf62376aebbfc385b
[12/14] power: reset: rmobile-reset: Convert to platform remove callback returning void
        commit: 30d26d2be83de0d036f59f384b805dd3bf4bf5ef
[13/14] power: reset: syscon-poweroff: Convert to platform remove callback returning void
        commit: 2973706c4160ed8c1e695b4dfef4bdb3124c5753
[14/14] power: reset: tps65086-restart: Convert to platform remove callback returning void
        commit: 0bf7207e09673144df6425b2cad8bcb015e3501a
[15/15] power: reset: at91-reset: Convert to platform remove callback returning void
        commit: 20cea2b59abe33b80536b936b6729c88d1de2624
[16/16] power: reset: at91-sama5d2_shdwc: Convert to platform remove callback returning void
        commit: 054eb2377523530404fb64c24c8747feb022c5b4

Best regards,