From nobody Fri Apr 10 01:00:55 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5912F26E706; Wed, 4 Mar 2026 18:55:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772650545; cv=none; b=n1ACpysoXYEdWaS1pCupfiE+U6makTWLZUMI5m4uyeHhQIOZte4SWLn0ybNWUJRMuZQmOd48Oq+0pBJdXSyxzDRWH8GAgMagGk4nJCpqBRoinu8z2by48Oq4l5DZTpSB7yfLD1J9i9tla960vrsq96U3YDjfEI/tG9Z87Td/OAo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772650545; c=relaxed/simple; bh=xjT6WTJcnXYr+ovaB1HIY41Fj5oLXC7PQvl+9n8hlLE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=bk3cddxrl8eJIXC2Lrl0c1HT5P71aZzgCx1ElM5NhJdKpzfzeEHwgxE5UCTl5zAiZ0RSmehsrAuFQKITKAn5+pNcXYIcaE5Ja/5fYTAS6cHxjISCE70yxgv+bS7zy7QZ4MOUkENo/uvSwz4EmPn07At620lx94xc1siypH2Ay8U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=uJm1IkvI; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="uJm1IkvI" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 79195C2BC86; Wed, 4 Mar 2026 18:55:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772650545; bh=xjT6WTJcnXYr+ovaB1HIY41Fj5oLXC7PQvl+9n8hlLE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uJm1IkvIrhH/5uJ8AnnNeTjkPxvVeZuTVcC8j6Sowmx7Gni8E98gXiUsik+PgfhNZ NrFTnqqlYUpoO9dhnIGqR6V5QSTx2xgCSpbpSASg3mqodtE0f8BN/DCxpWv6mBMu7y dzGxLfwMGnyQhGXk/1QgB9zvdEnsPL860nWlWn3TWGB+Xb4FY7emDn5/X3Me9geq0R wFedjGADzq7MNgig7ttetekMKuiCeGhuyZYKNrv+p+vmPSH7bBbieV6PWXvj7mq/Cp SNj6c86QAYPSGgv42GF4QGD4+6mUTLeYrH2rbJWTFpDtGmZFZh+NQ0+SLDlFYLlav0 ZgUJrJrwEh0qQ== From: "Rafael J. Wysocki" To: Ilpo =?ISO-8859-1?Q?J=E4rvinen?= Cc: LKML , Linux ACPI , Hans de Goede , Maximilian Luz , platform-driver-x86@vger.kernel.org Subject: [PATCH v1 2/3] platform/surface: surfacepro3_button: Register ACPI notify handler Date: Wed, 04 Mar 2026 19:54:47 +0100 Message-ID: <1881356.TLkxdtWsSY@rafael.j.wysocki> Organization: Linux Kernel Development In-Reply-To: <2909929.BEx9A2HvPv@rafael.j.wysocki> References: <2909929.BEx9A2HvPv@rafael.j.wysocki> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: "Rafael J. Wysocki" To facilitate subsequent conversion of the driver to a platform one, make it install an ACPI notify handler directly instead of using a .notify() callback in struct acpi_driver. No intentional functional impact. Signed-off-by: Rafael J. Wysocki --- drivers/platform/surface/surfacepro3_button.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/platform/surface/surfacepro3_button.c b/drivers/platfo= rm/surface/surfacepro3_button.c index a6c9d4d370be..6d394daf5bc4 100644 --- a/drivers/platform/surface/surfacepro3_button.c +++ b/drivers/platform/surface/surfacepro3_button.c @@ -72,8 +72,9 @@ struct surface_button { bool suspended; }; =20 -static void surface_button_notify(struct acpi_device *device, u32 event) +static void surface_button_notify(acpi_handle handle, u32 event, void *dat= a) { + struct acpi_device *device =3D data; struct surface_button *button =3D acpi_driver_data(device); struct input_dev *input; int key_code =3D KEY_RESERVED; @@ -227,6 +228,15 @@ static int surface_button_add(struct acpi_device *devi= ce) goto err_free_input; =20 device_init_wakeup(&device->dev, true); + + error =3D acpi_dev_install_notify_handler(device, ACPI_DEVICE_NOTIFY, + surface_button_notify, device); + if (error) { + device_init_wakeup(&device->dev, false); + input_unregister_device(input); + goto err_free_button; + } + dev_info(&device->dev, "%s [%s]\n", acpi_device_name(device), acpi_device_bid(device)); return 0; @@ -242,6 +252,8 @@ static void surface_button_remove(struct acpi_device *d= evice) { struct surface_button *button =3D acpi_driver_data(device); =20 + acpi_dev_remove_notify_handler(device, ACPI_DEVICE_NOTIFY, + surface_button_notify); device_init_wakeup(&device->dev, false); input_unregister_device(button->input); kfree(button); @@ -257,7 +269,6 @@ static struct acpi_driver surface_button_driver =3D { .ops =3D { .add =3D surface_button_add, .remove =3D surface_button_remove, - .notify =3D surface_button_notify, }, .drv.pm =3D &surface_button_pm, }; --=20 2.51.0