linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
To: Icenowy Zheng <icenowy@aosc.io>
Cc: "Daniel J . Ogorchock" <djogorchock@gmail.com>,
	Jiri Kosina <jikos@kernel.org>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] HID: nintendo: deregister home LED when it fails
Date: Wed, 21 Sep 2022 10:57:20 +0200	[thread overview]
Message-ID: <20220921085720.xacimuggkdr5nmfd@mail.corp.redhat.com> (raw)
In-Reply-To: <20220415100432.23453-1-icenowy@aosc.io>

On Apr 15 2022, Icenowy Zheng wrote:
> Some Pro Controller compatible controllers do not support home LED, and
> will fail when setting it. Currently this leads to probe failure.
> 
> Change the code that fails probing to deregistering home LED.
> 
> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
> ---
>  drivers/hid/hid-nintendo.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/hid/hid-nintendo.c b/drivers/hid/hid-nintendo.c
> index 2204de889739..ed93287c3afc 100644
> --- a/drivers/hid/hid-nintendo.c
> +++ b/drivers/hid/hid-nintendo.c
> @@ -1900,9 +1900,8 @@ static int joycon_leds_create(struct joycon_ctlr *ctlr)
>  		/* Set the home LED to 0 as default state */
>  		ret = joycon_home_led_brightness_set(led, 0);
>  		if (ret) {
> -			hid_err(hdev, "Failed to set home LED dflt; ret=%d\n",
> -									ret);
> -			return ret;
> +			hid_warn(hdev, "Failed to set home LED dflt, unregistering home LED");

I have s/dflt/default/ and applied to for-6.1/nintendo in hid.git

FWIW, I wondered really hard if we should or not clean up led->name that
devm_kzalloc-ed just a few lines above, but in the end it doesn't add
much to do it now instead of at remove time.

Thanks for the patch and the reviews!

Cheers,
Benjamin

> +			devm_led_classdev_unregister(&hdev->dev, led);
>  		}
>  	}
>  
> -- 
> 2.35.1
> 


      parent reply	other threads:[~2022-09-21  8:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-15 10:04 [PATCH] HID: nintendo: deregister home LED when it fails Icenowy Zheng
2022-04-18 14:17 ` Silvan Jegen
2022-07-20 18:47 ` Nils Helmig
2022-09-20 22:09 ` Daniel Ogorchock
2022-09-21  8:57 ` Benjamin Tissoires [this message]

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=20220921085720.xacimuggkdr5nmfd@mail.corp.redhat.com \
    --to=benjamin.tissoires@redhat.com \
    --cc=djogorchock@gmail.com \
    --cc=icenowy@aosc.io \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@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;
as well as URLs for NNTP newsgroup(s).