Re: [PATCH RFC] power: reset: restart-poweroff: convert to module

From: Andrew Lunn
Date: Wed Feb 21 2024 - 16:56:06 EST


On Wed, Feb 21, 2024 at 06:46:07PM +0100, A. Sverdlin wrote:
> From: Alexander Sverdlin <alexander.sverdlin@xxxxxxxxxxx>
>
> The necessity of having a fake platform device for a generic, platform
> independent functionality is not obvious.
> Some platforms requre device tree modification for this, some would require
> ACPI tables modification, while functionality may be useful even to
> end-users without required expertise. Convert the platform driver to
> a simple module.

> @@ -47,15 +45,8 @@ static const struct of_device_id of_restart_poweroff_match[] = {
> };
> MODULE_DEVICE_TABLE(of, of_restart_poweroff_match);
>
> -static struct platform_driver restart_poweroff_driver = {
> - .probe = restart_poweroff_probe,
> - .remove = restart_poweroff_remove,
> - .driver = {
> - .name = "poweroff-restart",
> - .of_match_table = of_restart_poweroff_match,
> - },
> -};

of_restart_poweroff_match now seems to be disconnected from the
driver.

kirkwood-linkstation.dtsi: compatible = "restart-poweroff";
kirkwood-lsxl.dtsi: compatible = "restart-poweroff";
orion5x-linkstation.dtsi: compatible = "restart-poweroff";
orion5x-lswsgl.dts: compatible = "restart-poweroff";

How do these devices get this driver loaded?

This appears to be another reason to NACK it.

Andrew