From nobody Thu Apr 2 20:21:29 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 129F6748F; Thu, 12 Feb 2026 13:33:17 +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=1770903198; cv=none; b=PFh2EKYE4gEAjqjlDKtoBsxgW3RcUGUd+3EiCfBlUn77JU4d/DEMAj+RiCl59SrQkswNM9n+ZAf4B22YShlsSfjwHxjRoiZ5ElsTPyvRvWDboONHXhZ/A2DPi2onfWtlFULkdB00SW7gRPvCKl8T2rKWcZ88l14PNI/kD9P90Ho= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770903198; c=relaxed/simple; bh=+KpPuJAQPI6tZ+eexHuBI3ipLgn3veZf1J6uzjG5gqg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=e9Nhv8h2fmv3qKvoDQszcWiUqaxN270s9AYesL/654HFlb2NVDsPXPg2VwcBrcwWpIRZ5poJt47N+BFZSzP1iuPaEnkXLoANe0l7hbiGPVMt/JYcZbwbMKKAQ0NkZt8vUlogi2wajgkmleO/pul3SKX1x4CL24x3EInHIicGRcw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nJl4LyWY; 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="nJl4LyWY" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AE82EC4CEF7; Thu, 12 Feb 2026 13:33:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770903197; bh=+KpPuJAQPI6tZ+eexHuBI3ipLgn3veZf1J6uzjG5gqg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nJl4LyWYIqVPtliM4QSPNOAWfwv9D+x84iE7KRfc+wUW2hOvDFerWhBKDaLG1SCqh nNkvjGBhiS70bXIds2pZHPNcihs2ma3wJtAU9YPSTb+fsK8Xu9NgCK0K1CIDHf9cM7 /YzUAvpZfsx69nSJt+1pxk3OQWxKEwbAqjYohHeNzxkoAnIzEJNILDrTYYU8D/66hd fdj4GwkfIr+uvSjWjqEwugk5d0Hs2IOf6137Hx5Zb3Tndtez8uLQKg18UBfdRnEF9b n5085QO5ttMmpEP0xLV6/6t2GAHaPn9Rp8Bk6r4RwS/meU9n0YL4wr6ZrNbjqvmLGE O/x9w3+dXOuOw== From: "Rafael J. Wysocki" To: Linux ACPI Cc: LKML , Linux PM Subject: [PATCH v1 2/2] ACPI: button: Tweak acpi_button_remove() Date: Thu, 12 Feb 2026 14:33:00 +0100 Message-ID: <13948466.uLZWGnKmhe@rafael.j.wysocki> Organization: Linux Kernel Development In-Reply-To: <2400697.ElGaqSPkdT@rafael.j.wysocki> References: <2400697.ElGaqSPkdT@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 Modify acpi_button_remove() to get the ACPI device object pointer from button->adev instead of retrieving it with the help of the ACPI_COMPANION() macro to reduce overhead slightly. While at it, rename the struct acpi_device pointer variable in acpi_button_remove() to adev. No intentional functional impact. Signed-off-by: Rafael J. Wysocki --- drivers/acpi/button.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/drivers/acpi/button.c +++ b/drivers/acpi/button.c @@ -672,10 +672,10 @@ err_free_button: =20 static void acpi_button_remove(struct platform_device *pdev) { - struct acpi_device *device =3D ACPI_COMPANION(&pdev->dev); struct acpi_button *button =3D platform_get_drvdata(pdev); + struct acpi_device *adev =3D button->adev; =20 - switch (device->device_type) { + switch (adev->device_type) { case ACPI_BUS_TYPE_POWER_BUTTON: acpi_remove_fixed_event_handler(ACPI_EVENT_POWER_BUTTON, acpi_button_event); @@ -685,7 +685,7 @@ static void acpi_button_remove(struct pl acpi_button_event); break; default: - acpi_remove_notify_handler(device->handle, ACPI_DEVICE_NOTIFY, + acpi_remove_notify_handler(adev->handle, ACPI_DEVICE_NOTIFY, button->type =3D=3D ACPI_BUTTON_TYPE_LID ? acpi_lid_notify : acpi_button_notify);