[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANLzEkuV3r6hQeB_e5qHm7eWLF2VftH-U9sbED30wWmu29UEyg@mail.gmail.com>
Date: Thu, 5 Jan 2023 10:44:41 -0800
From: Benson Leung <bleung@...omium.org>
To: Prashant Malani <pmalani@...omium.org>
Cc: linux-kernel@...r.kernel.org, chrome-platform@...ts.linux.dev
Subject: Re: [PATCH 1/2] platform/chrome: cros_typec_switch: Use fwnode* prop check
Hi Prashant,
On Tue, Jan 3, 2023 at 10:09 PM Prashant Malani <pmalani@...omium.org> wrote:
>
> Using device_property_present() multiple times on an ACPI device
> leads to kernel panics on Chromebook systems. This happens when there
> is > 1 boolean property in an ACPI device which is created dynamically
> by the BIOS as part of SSDT[1] on Chromebook systems
>
> Since fwnode_* can handle simple device tree properties equally
> well, switch to using the fwnode_property_present() function
> version. This will avoid panics and make the usage consistent
> when we introduce a check for the 2nd property in a subsequent patch.
>
> [1] https://wiki.osdev.org/SSDT
>
> Signed-off-by: Prashant Malani <pmalani@...omium.org>
Reviewed-by: Benson Leung <bleung@...omium.org>
Thanks,
Benson
> ---
> drivers/platform/chrome/cros_typec_switch.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/platform/chrome/cros_typec_switch.c b/drivers/platform/chrome/cros_typec_switch.c
> index a26219e97c93..2536bda03bf3 100644
> --- a/drivers/platform/chrome/cros_typec_switch.c
> +++ b/drivers/platform/chrome/cros_typec_switch.c
> @@ -254,7 +254,7 @@ static int cros_typec_register_switches(struct cros_typec_switch_data *sdata)
>
> dev_dbg(dev, "Retimer switch registered for index %llu\n", index);
>
> - if (!device_property_present(fwnode->dev, "mode-switch"))
> + if (!fwnode_property_present(fwnode, "mode-switch"))
> continue;
>
> ret = cros_typec_register_mode_switch(port, fwnode);
> --
> 2.39.0.314.g84b9a713c41-goog
>
>
--
Benson Leung
Staff Software Engineer
Chrome OS Kernel
Google Inc.
bleung@...gle.com
Chromium OS Project
bleung@...omium.org
Powered by blists - more mailing lists