Skip to content

platform/x86: thinkpad_acpi: Enable devres for subdriver .init callbacks

Kurt Borja lkml platform-driver-x86 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2platform/x86: thinkpad_acpi: Move subdriver initialization to tpacpi_pdriver's probe.drivers/platform/x86/thinkpad_acpi.c+62 -740 replies
2/2platform/x86: thinkpad_acpi: Move HWMON initialization to tpacpi_hwmon_pdriver's probedrivers/platform/x86/thinkpad_acpi.c+17 -272 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchMark Pearson
1/2
2/2R-b T-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 0/2] platform/x86: thinkpad_acpi: Enable devres for subdriver .init callbacks

Hi all,

It was reported by Mark [1] that if subdrivers used devres, the tpacpi_pdev wouldn't bind successfully to the device, thus failing to create the various sysfs attributes that this driver exposes.

The original problem is already fixed, however a complete solution was due.

The approach I took is to let the driver core manage the lifetimes of the subdrivers (details in Patch [1/2]). This enables devres for subdrivers and IMO makes the code more maintainable (because of the lifetime gurantees).

This was compile tested only, because (unfortunately) I don't own a thinkpad so some testing is absolutely required, as this is an extremely intricate driver.

Based on top of the for-next branch.

~ Kurt
---
[1] https://lore.kernel.org/platform-driver-x86/[email protected]/#t

Kurt Borja (2):
platform/x86: thinkpad_acpi: Move subdriver initialization to
tpacpi_pdriver's probe.
platform/x86: thinkpad_acpi: Move HWMON initialization to
tpacpi_hwmon_pdriver's probe

 drivers/platform/x86/thinkpad_acpi.c | 176 ++++++++++++---------------
 1 file changed, 77 insertions(+), 99 deletions(-)

base-commit: d497c47481f8e8f13e3191c9a707ed942d3bb3d7

Signature · 1 line
2.48.1