From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 480B2C32771 for ; Wed, 21 Sep 2022 08:57:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229587AbiIUI52 (ORCPT ); Wed, 21 Sep 2022 04:57:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229437AbiIUI51 (ORCPT ); Wed, 21 Sep 2022 04:57:27 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A6DB7A508 for ; Wed, 21 Sep 2022 01:57:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663750645; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=rJ2ErdyQTAyiYTcLgq8sj/xj/vsAzmqF5/djLR4auwc=; b=f31eLihK2VgSnilZibme/tGUFOnL3ER+6VIcvmxM12uk2Hsft0PIniVj0E8tjVbR/p+stP Wuj9bw7BynImsfSbuo3xYPz8HRfRCkfHpD1HXfxj6qId2SZm7Vw3fJxjORLL867ZODxoBN rACbdFOvk5E/HfSIIybg91bJAP4ccH0= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-204-ct5KlvW2N5azvCKauDKB7A-1; Wed, 21 Sep 2022 04:57:23 -0400 X-MC-Unique: ct5KlvW2N5azvCKauDKB7A-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7C653862FDC; Wed, 21 Sep 2022 08:57:23 +0000 (UTC) Received: from mail.corp.redhat.com (unknown [10.39.194.185]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 916DB1121339; Wed, 21 Sep 2022 08:57:22 +0000 (UTC) Date: Wed, 21 Sep 2022 10:57:20 +0200 From: Benjamin Tissoires To: Icenowy Zheng Cc: "Daniel J . Ogorchock" , Jiri Kosina , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] HID: nintendo: deregister home LED when it fails Message-ID: <20220921085720.xacimuggkdr5nmfd@mail.corp.redhat.com> References: <20220415100432.23453-1-icenowy@aosc.io> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220415100432.23453-1-icenowy@aosc.io> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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 > --- > 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 >