From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 131222F49F6 for ; Sat, 28 Feb 2026 17:04:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772298278; cv=none; b=NtE1IK/1XiD6TxMvJJyt9vZO1QkJ0tnz/44R3xhvSu5yccD0uaVU0xh6jQx+R4Yxz5GoimfkPRm8DvAEVLBLiQ2kDP7I0OT+BOUj5XhZVVzwMfvluYn70NjIXSsZwcphfuewqWKAGva+ibePkKyKHKXPf5N1NKT159LCTRt1jkM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772298278; c=relaxed/simple; bh=vfk5oWr6+MC3tbftUpoDnEcCStih+EdR8IGYQq3G6+U=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=dNQGwuudyk0JtX90dAtGd4DtZ/06l9Cwf2vi5wLCCYrFE4YR2mhQJXzQkzilgvxWlGV+4438d/W9prF/yZLAHg539hUFRx89kveWo4erOlzQzR/A5rTDgKGO2bH0ZbSmhpkq5q6aEKdgWl88W/QX9CDTC0ZLWOqetAyUMo9VWZ0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=g+80QtgC; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="g+80QtgC" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-48069a48629so33453895e9.0 for ; Sat, 28 Feb 2026 09:04:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772298275; x=1772903075; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=ipIyvKGS8RA5V5Uwrv0KbmHM1BtJzJk2sHameAMPWss=; b=g+80QtgCIOmHLcCi8YxMfoEbT6hlVCTHChygTphK/D/NxqiOsjebfEYmQ8ecoIKYCa 4x60B4Dq9Q+cnn8YIMiSPoUyCyda+zC7F/VhtPo88jWQUcFkft1Dy6f2dRL4u8TsjY3J yWK6YkKaRLn9nEpKWHLQCCu4DGAsKQVAKmXvnANmYuWUSvnbop4d0v0OgcyhTnv2GqwP 4hCRl0PEDDBNVrkIbkPN1rJvfPV9i8243EAiqKbTGJuC5WKQWaYHaZ5L2jO7UgLedwge S6yDNYHtOJPoaOTOS4ZnnM8sf7P/eO3PktT+XOstwvdzNXs9j/WkJE2tsEg31NFogFI1 gC7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772298275; x=1772903075; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ipIyvKGS8RA5V5Uwrv0KbmHM1BtJzJk2sHameAMPWss=; b=Y5s7r7Sj0wFdDoGvMuUFP2HktSytmJFmXD+JXUYCjav0eAC9VPgv3Czo0zCMBU7sdH 42RNC/IvMgD61SaRJ+WhS5OBRaJbV97z/3zSSWTHgIj3nXC9sZZfuXnpsaMUB+bg1X0L 3d3upTHPWRl4yJZ0ULOWDxi4pRC1O/lPemlmv1Cm8kxuSe6aOdHHpFoX2u8XDlvPTU1Q Yk9PUnDrZKByqm5QapWHvciY5q1E043XacacF9YhnkO/jeRj1N1fdrzSRuCV2fdHjLHv Zhl5RCllXGZC2/VGw7MM1onpke63kFJByfA8c0Zbpxhfw/fXof0PdeKD8v2Q9kFYgfQE AoyQ== X-Forwarded-Encrypted: i=1; AJvYcCW6s0RG/Q3PQp6IyH6RW09NvZuHz4HYnb3VFi/RlCIyvYCft3ofrw6zFM63JvuHP97AKs27Z7+zI9MCbI+V1XKQGb3X@vger.kernel.org X-Gm-Message-State: AOJu0YxVarqZIuAFdZyXxUQFm3WoEwpUlFxj08jNwwIiGXNk8zZHfOsi bq6NxCicdttptpC45i4uY1ACgFSSIWCsIKut3HcXK/TdbKkdzzUEX8Mm X-Gm-Gg: ATEYQzxjHq15jC+FXceMmqdKsuBM8zE4i3t53b3oYzPGWwIfcvH5iR7rFUvbAEYPrSE KEJhVp0nQMunVvS4B43W/XB3qDumVxeOZOys/CwCaECNQ7+Zanlviwf6eFC0SWiur3jzFpvtAP1 405ROG3nIk6QkJzIYPTBOFiTHgZjDhDzmpw2dX/CqMZoMm2WPFnFK2tNpd3lvhj+gVKU9P134hi atygSWVDsN0bg0qkZLE7n2fLD+vqh+Tm7Oi5btG1occPLCmPoW1v+DDyvjkkG+puHKlUrASgcVt BA9sMlE3KR1nvpOrOTfKItiY2O8iZ62HxVsCWwTnq+VoWgchOj9RBS5d6hvSn1JgAfD5JBSQbyf 3obAMpN7Uad6EXM2PeLbHhunffCliXmAeKXTbbYRwtqzIJK6CfTaMRW/l8fF+6YEDxt2dUTRJtE UASHhr5PdrvROZW1oR0ar5yPTWapo5PoftPuA= X-Received: by 2002:a05:600c:3b02:b0:483:6fe1:c057 with SMTP id 5b1f17b1804b1-483c9c02efcmr116143755e9.21.1772298275197; Sat, 28 Feb 2026 09:04:35 -0800 (PST) Received: from [192.168.1.121] ([151.95.146.136]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-483c3b3474dsm167336535e9.1.2026.02.28.09.04.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 28 Feb 2026 09:04:34 -0800 (PST) Message-ID: <14eae871-5cb0-4847-963f-e3d382a3fc2b@gmail.com> Date: Sat, 28 Feb 2026 18:04:34 +0100 Precedence: bulk X-Mailing-List: platform-driver-x86@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 2/2] platform/x86: eeepc-laptop: Convert ACPI driver to a platform one To: "Rafael J. Wysocki" , =?UTF-8?Q?Ilpo_J=C3=A4rvinen?= Cc: Hans de Goede , LKML , Linux ACPI , platform-driver-x86@vger.kernel.org, Corentin Chary , "Luke D. Jones" References: <7916328.EvYhyI6sBW@rafael.j.wysocki> <3329436.5fSG56mABF@rafael.j.wysocki> Content-Language: en-US, it-IT, en-US-large From: Denis Benato In-Reply-To: <3329436.5fSG56mABF@rafael.j.wysocki> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 2/28/26 16:22, Rafael J. Wysocki wrote: > From: "Rafael J. Wysocki" > > In all cases in which a struct acpi_driver is used for binding a driver > to an ACPI device object, a corresponding platform device is created by > the ACPI core and that device is regarded as a proper representation of > underlying hardware. Accordingly, a struct platform_driver should be > used by driver code to bind to that device. There are multiple reasons > why drivers should not bind directly to ACPI device objects [1]. > > Overall, it is better to bind drivers to platform devices than to their > ACPI companions, so convert the EEEPC laptop ACPI driver to a platform > one. > > While this is not expected to alter functionality, it changes sysfs > layout and so it will be visible to user space. > > Link: https://lore.kernel.org/all/2396510.ElGaqSPkdT@rafael.j.wysocki/ [1] > Signed-off-by: Rafael J. Wysocki Reviewed-by: Denis Benato > --- > drivers/platform/x86/eeepc-laptop.c | 32 +++++++++++++++-------------- > 1 file changed, 17 insertions(+), 15 deletions(-) > > diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c > index 626a99a71fce..02a71095920e 100644 > --- a/drivers/platform/x86/eeepc-laptop.c > +++ b/drivers/platform/x86/eeepc-laptop.c > @@ -1361,8 +1361,9 @@ static void eeepc_enable_camera(struct eeepc_laptop *eeepc) > > static bool eeepc_device_present; > > -static int eeepc_acpi_add(struct acpi_device *device) > +static int eeepc_acpi_probe(struct platform_device *pdev) > { > + struct acpi_device *device = ACPI_COMPANION(&pdev->dev); > struct eeepc_laptop *eeepc; > int result; > > @@ -1373,9 +1374,10 @@ static int eeepc_acpi_add(struct acpi_device *device) > eeepc->handle = device->handle; > strscpy(acpi_device_name(device), EEEPC_ACPI_DEVICE_NAME); > strscpy(acpi_device_class(device), EEEPC_ACPI_CLASS); > - device->driver_data = eeepc; > eeepc->device = device; > > + platform_set_drvdata(pdev, eeepc); > + > eeepc->hotplug_disabled = hotplug_disabled; > > eeepc_dmi_check(eeepc); > @@ -1448,11 +1450,12 @@ static int eeepc_acpi_add(struct acpi_device *device) > return result; > } > > -static void eeepc_acpi_remove(struct acpi_device *device) > +static void eeepc_acpi_remove(struct platform_device *pdev) > { > - struct eeepc_laptop *eeepc = acpi_driver_data(device); > + struct eeepc_laptop *eeepc = platform_get_drvdata(pdev); > > - acpi_dev_remove_notify_handler(device, ACPI_ALL_NOTIFY, eeepc_acpi_notify); > + acpi_dev_remove_notify_handler(ACPI_COMPANION(&pdev->dev), > + ACPI_ALL_NOTIFY, eeepc_acpi_notify); > eeepc_backlight_exit(eeepc); > eeepc_rfkill_exit(eeepc); > eeepc_input_exit(eeepc); > @@ -1469,13 +1472,12 @@ static const struct acpi_device_id eeepc_device_ids[] = { > }; > MODULE_DEVICE_TABLE(acpi, eeepc_device_ids); > > -static struct acpi_driver eeepc_acpi_driver = { > - .name = EEEPC_LAPTOP_NAME, > - .class = EEEPC_ACPI_CLASS, > - .ids = eeepc_device_ids, > - .ops = { > - .add = eeepc_acpi_add, > - .remove = eeepc_acpi_remove, > +static struct platform_driver eeepc_acpi_driver = { > + .probe = eeepc_acpi_probe, > + .remove = eeepc_acpi_remove, > + .driver = { > + .name = EEEPC_LAPTOP_NAME, > + .acpi_match_table = eeepc_device_ids, > }, > }; > > @@ -1488,7 +1490,7 @@ static int __init eeepc_laptop_init(void) > if (result < 0) > return result; > > - result = acpi_bus_register_driver(&eeepc_acpi_driver); > + result = platform_driver_register(&eeepc_acpi_driver); > if (result < 0) > goto fail_acpi_driver; > > @@ -1500,7 +1502,7 @@ static int __init eeepc_laptop_init(void) > return 0; > > fail_no_device: > - acpi_bus_unregister_driver(&eeepc_acpi_driver); > + platform_driver_unregister(&eeepc_acpi_driver); > fail_acpi_driver: > platform_driver_unregister(&platform_driver); > return result; > @@ -1508,7 +1510,7 @@ static int __init eeepc_laptop_init(void) > > static void __exit eeepc_laptop_exit(void) > { > - acpi_bus_unregister_driver(&eeepc_acpi_driver); > + platform_driver_unregister(&eeepc_acpi_driver); > platform_driver_unregister(&platform_driver); > } >