Re: [RFC PATCH 1/3] platform/x86: uniwill-laptop: Make super key init lineup with other inits

From: Ilpo Järvinen

Date: Wed Apr 22 2026 - 05:34:00 EST


On Tue, 21 Apr 2026, Werner Sembach wrote:

> The super key init, while being trivial, was the only one not in its own
> method and before the EC init.
>
> Make an own method and move it after EC init and probe call to make it
> consistent with other initialization steps.
>
> Signed-off-by: Werner Sembach <wse@xxxxxxxxxxxxxxxxxxx>
> ---
> drivers/platform/x86/uniwill/uniwill-acpi.c | 16 ++++++++++++----
> 1 file changed, 12 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/platform/x86/uniwill/uniwill-acpi.c b/drivers/platform/x86/uniwill/uniwill-acpi.c
> index 766bc1ee192d2..7d1fdbacc6871 100644
> --- a/drivers/platform/x86/uniwill/uniwill-acpi.c
> +++ b/drivers/platform/x86/uniwill/uniwill-acpi.c
> @@ -768,6 +768,14 @@ static ssize_t super_key_enable_show(struct device *dev, struct device_attribute
>
> static DEVICE_ATTR_RW(super_key_enable);
>
> +static int super_key_enable_init(struct uniwill_data *data)
> +{
> + if (!uniwill_device_supports(data, UNIWILL_FEATURE_SUPER_KEY))
> + return 0;
> +
> + return devm_mutex_init(&data->dev, &data->super_key_lock);
> +}
> +
> static int uniwill_write_touchpad_toggle_enable(struct uniwill_data *data, bool status)
> {
> unsigned int value;
> @@ -1869,10 +1877,6 @@ static int uniwill_probe(struct platform_device *pdev)
>
> data->regmap = regmap;
>
> - ret = devm_mutex_init(&pdev->dev, &data->super_key_lock);
> - if (ret < 0)
> - return ret;
> -
> ret = uniwill_ec_init(data);
> if (ret < 0)
> return ret;
> @@ -1890,6 +1894,10 @@ static int uniwill_probe(struct platform_device *pdev)
> return ret;
> }
>
> + ret = super_key_enable_init(data);
> + if (ret < 0)
> + return ret;
> +
> ret = uniwill_battery_init(data);
> if (ret < 0)
> return ret;
>

Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@xxxxxxxxxxxxxxx>

--
i.