mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Armin Wolf <W_Armin@gmx.de>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: "Hans de Goede" <hdegoede@redhat.com>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] platform/x86: wmi: Fix wmi_dev_probe()
Date: Sat, 6 Jan 2024 23:04:55 +0100	[thread overview]
Message-ID: <19a31d3b-d13a-4665-9c84-55cdabfad3f8@gmx.de> (raw)
In-Reply-To: <9c81251b-bc87-4ca3-bb86-843dc85e5145@moroto.mountain>

Am 05.01.24 um 14:47 schrieb Dan Carpenter:

> This has a reversed if statement so it accidentally disables the wmi
> method before returning.

Good catch, you are absolutely right!
And on top of that it also breaks WMI event drivers since the WMI_PROBED
flag will not be set when the driver successfully probes and instead will
be set when the driver fails to probe.

For the patch:
Reviewed-by: Armin Wolf <W_Armin@gmx.de>

Thanks,
Armin Wolf

>
> Fixes: 704af3a40747 ("platform/x86: wmi: Remove chardev interface")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
>   drivers/platform/x86/wmi.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
> index 157f1ce8ac0a..e6f6fa2fd080 100644
> --- a/drivers/platform/x86/wmi.c
> +++ b/drivers/platform/x86/wmi.c
> @@ -868,7 +868,7 @@ static int wmi_dev_probe(struct device *dev)
>   	if (wdriver->probe) {
>   		ret = wdriver->probe(dev_to_wdev(dev),
>   				find_guid_context(wblock, wdriver));
> -		if (!ret) {
> +		if (ret) {
>   			if (ACPI_FAILURE(wmi_method_enable(wblock, false)))
>   				dev_warn(dev, "Failed to disable device\n");
>

  reply	other threads:[~2024-01-06 22:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-05 13:47 Dan Carpenter
2024-01-06 22:04 ` Armin Wolf [this message]
2024-01-08 14:55 ` Hans de Goede

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=19a31d3b-d13a-4665-9c84-55cdabfad3f8@gmx.de \
    --to=w_armin@gmx.de \
    --cc=dan.carpenter@linaro.org \
    --cc=hdegoede@redhat.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.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

all inboxes | Powered by JetHome®