Skip to content

platform/x86: toshiba_acpi: move acpi add/remove to device-managed routines

Alexandru Ardelean linux-iio lkml platform-driver-x86 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest10 patches 16 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10platform/x86: toshiba_acpi: bind life-time of toshiba_acpi_dev to parentdrivers/platform/x86/toshiba_acpi.c+2 -42 replies
2/10platform/x86: toshiba_acpi: use devm_add_action_or_reset() for singleton cleardrivers/platform/x86/toshiba_acpi.c+12 -31 reply
3/10platform/x86: toshiba_acpi: bind registration of miscdev object to parentdrivers/platform/x86/toshiba_acpi.c+12 -21 reply
4/10platform/x86: toshiba_acpi: use device-managed functions for input devicedrivers/platform/x86/toshiba_acpi.c+36 -191 reply
5/10platform/x86: toshiba_acpi: register backlight with device-managed variantdrivers/platform/x86/toshiba_acpi.c+10 -101 reply
6/10platform/x86: toshiba_acpi: use devm_led_classdev_register() for LEDsdrivers/platform/x86/toshiba_acpi.c+9 -71 reply
7/10platform/x86: toshiba_acpi: use device-managed functions for accelerometerdrivers/platform/x86/toshiba_acpi.c+3 -81 reply
8/10platform/x86: toshiba_acpi: use device-managed for wwan_rfkill managementdrivers/platform/x86/toshiba_acpi.c+31 -91 reply
9/10platform/x86: toshiba_acpi: use device-managed for sysfs removaldrivers/platform/x86/toshiba_acpi.c+15 -141 reply
10/10platform/x86: toshiba_acpi: bind proc entries creation to parentdrivers/platform/x86/toshiba_acpi.c+21 -241 reply

Reviews trailers per patch

7 of 10 patches have a Reviewed-by or Acked-by.

PatchJonathan Cameron
1/10
2/10
3/10A-b
4/10
5/10R-b
6/10R-b
7/10R-b
8/10R-b
9/10R-b
10/10R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/10] platform/x86: toshiba_acpi: move acpi add/remove to device-managed routines

This changeset tries to do a conversion of the toshiba_acpi driver to use only device-managed routines. The driver registers as a singleton, so no more than one device can be registered at a time.

My main intent here is to try to convert the iio_device_alloc() and iio_device_register() to their devm_ variants.

Usually, when converting a registration call to device-managed variant, the init order must be preserved. And the deregistration order must be a mirror of the registration (in reverse order).

This change tries to do that, by using devm_ variants where available and devm_add_action_or_reset() where this isn't possible.
Some deregistration ordering is changed, because it wasn't exactly mirroring (in reverse) the init order.

For the IIO subsystem, the toshiba_acpi driver is the only user of iio_device_alloc(). If this changeset is accepted (after discussion), I will propose to remove the iio_device_alloc() function.

While I admit this may look like an overzealous effort to use devm_ everywhere (in IIO at least), for me it's a fun/interesting excercise.

Alexandru Ardelean (10):
platform/x86: toshiba_acpi: bind life-time of toshiba_acpi_dev to
parent
platform/x86: toshiba_acpi: use devm_add_action_or_reset() for
singleton clear
platform/x86: toshiba_acpi: bind registration of miscdev object to
parent
platform/x86: toshiba_acpi: use device-managed functions for input
device
platform/x86: toshiba_acpi: register backlight with device-managed
variant
platform/x86: toshiba_acpi: use devm_led_classdev_register() for LEDs platform/x86: toshiba_acpi: use device-managed functions for
accelerometer
platform/x86: toshiba_acpi: use device-managed for wwan_rfkill
management
platform/x86: toshiba_acpi: use device-managed for sysfs removal platform/x86: toshiba_acpi: bind proc entries creation to parent

 drivers/platform/x86/toshiba_acpi.c | 249 +++++++++++++++++-----------
 1 file changed, 150 insertions(+), 99 deletions(-)
Signature · 1 line
2.30.2