[PATCH PoC 0/3] ACPI/PNP/HISI_LPC: Refactor ACPI platform code for reuse

From: John Garry
Date: Tue Aug 16 2022 - 07:56:04 EST


This series attempts to refactor the ACPI platform device creation code
such that it may reused in the HiSilicon LPC driver. The topic was
recently discussed at the following:
https://lore.kernel.org/lkml/CAJZ5v0hkiOqhWyOcd2vjj-tcyHWB-cK=Dae-3sifhRfcbKWWGg@xxxxxxxxxxxxxx/

So first off I'll say that I am not advocating pursing the changes in this
series, but just wanted to share to show others how it would look.

Apart from requiring PNP driver changes, the API in
acpi_create_platform_device_ops() ain't pretty. And also the PNP change
means that the LPC uart changes from ttyS1 -> ttyS0, which would be a
nuisance for anyone still using a board which uses the LPC UART.

I have a separate change to show how the HiSilicon LPC driver would look
by using platform_device_register_full() instead, and it is a lot neater:
https://github.com/hisilicon/kernel-dev/commits/private-topic-lpc-6.0-platform-full

Anyway, the commit messages should describe anything else needed to be
known.

Please share any comments, thanks.

John Garry (3):
ACPI / PNP: Don't add enumeration_by_parent devices
ACPI: platform: Refactor acpi_create_platform_device()
bus: hisi_lpc: Use acpi_create_platform_device_ops()

drivers/acpi/acpi_platform.c | 37 ++++++--
drivers/bus/hisi_lpc.c | 165 +++++++++++++++--------------------
drivers/pnp/pnpacpi/core.c | 13 ++-
include/linux/acpi.h | 17 +++-
4 files changed, 122 insertions(+), 110 deletions(-)

--
2.35.3