From: Jonathan Woithe <jwoithe@just42.net>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
"Hans de Goede" <hansg@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
"Linux ACPI" <linux-acpi@vger.kernel.org>,
"Corentin Chary" <corentin.chary@gmail.com>,
"Luke D. Jones" <luke@ljones.dev>,
"Denis Benato" <denis.benato@linux.dev>,
"Pali Rohár" <pali@kernel.org>, "Robert Gerlach" <khnz@gmx.de>,
"Matan Ziv-Av" <matan@svgalib.org>,
"Kenneth Chan" <kenneth.t.chan@gmail.com>,
"Mattia Dongili" <malattia@linux.it>,
"Jeremy Soller" <jeremy@system76.com>,
"Azael Avalos" <coproscefalo@gmail.com>,
"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
platform-driver-x86@vger.kernel.org
Subject: Re: [PATCH v1] platform/x86: Check ACPI_COMPANION() against NULL during probe
Date: Tue, 12 May 2026 09:46:06 +0930 [thread overview]
Message-ID: <agJxRrDj2M42R8S1@marvin.atrad.com.au> (raw)
In-Reply-To: <5990022.DvuYhMxLoT@rafael.j.wysocki>
On Mon, May 11, 2026 at 09:48:26PM +0200, Rafael J. Wysocki wrote:
> From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
>
> Every platform driver can be forced to match a device that doesn't match
> its list of device IDs because of device_match_driver_override(), so
> platform drivers that rely on the existence of a device's ACPI companion
> object need to verify its presence.
>
> Accordingly, add requisite ACPI_COMPANION() or ACPI_HANDLE() checks
> against NULL to multiple platform/x86 drivers that have been converted
> to platform drivers from ACPI drivers recently.
For the fujitsu-laptop portions of the patch as below:
Acked-by: Jonathan Woithe <jwoithe@just42.net>
Regards
jonathan
--
> :
> Fixes: 6da22b031a3c ("platform/x86: fujitsu: Convert laptop driver to a platform one")
> Fixes: d5c9212ccfaa ("platform/x86: fujitsu: Convert backlight driver to a platform one")
> :
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
> drivers/platform/x86/fujitsu-laptop.c | 12 ++++++++++--
> :
> --- a/drivers/platform/x86/fujitsu-laptop.c
> +++ b/drivers/platform/x86/fujitsu-laptop.c
> @@ -530,10 +530,14 @@ static void acpi_fujitsu_bl_notify(acpi_
>
> static int acpi_fujitsu_bl_probe(struct platform_device *pdev)
> {
> - struct acpi_device *device = ACPI_COMPANION(&pdev->dev);
> + struct acpi_device *device;
> struct fujitsu_bl *priv;
> int ret;
>
> + device = ACPI_COMPANION(&pdev->dev);
> + if (!device)
> + return -ENODEV;
> +
> if (acpi_video_get_backlight_type() != acpi_backlight_vendor)
> return -ENODEV;
>
> @@ -993,10 +997,14 @@ static void acpi_fujitsu_laptop_notify(a
>
> static int acpi_fujitsu_laptop_probe(struct platform_device *pdev)
> {
> - struct acpi_device *device = ACPI_COMPANION(&pdev->dev);
> struct fujitsu_laptop *priv;
> + struct acpi_device *device;
> int ret, i = 0;
>
> + device = ACPI_COMPANION(&pdev->dev);
> + if (!device)
> + return -ENODEV;
> +
> priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
> if (!priv)
> return -ENOMEM;
next prev parent reply other threads:[~2026-05-12 0:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-11 19:48 [PATCH v1] platform/x86: Check ACPI_COMPANION() against NULL during probe Rafael J. Wysocki
2026-05-12 0:16 ` Jonathan Woithe [this message]
2026-05-12 7:25 ` Andy Shevchenko
2026-05-12 9:50 ` Rafael J. Wysocki
2026-05-12 9:53 ` Ilpo Järvinen
2026-05-12 10:31 ` Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=agJxRrDj2M42R8S1@marvin.atrad.com.au \
--to=jwoithe@just42.net \
--cc=andriy.shevchenko@linux.intel.com \
--cc=coproscefalo@gmail.com \
--cc=corentin.chary@gmail.com \
--cc=denis.benato@linux.dev \
--cc=hansg@kernel.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=jeremy@system76.com \
--cc=kenneth.t.chan@gmail.com \
--cc=khnz@gmx.de \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luke@ljones.dev \
--cc=malattia@linux.it \
--cc=matan@svgalib.org \
--cc=pali@kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
--cc=rafael@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox