From patchwork Mon Sep 18 04:13:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rahul Rameshbabu X-Patchwork-Id: 13388791 X-Patchwork-Delegate: jikos@jikos.cz 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 87074CD13D1 for ; Mon, 18 Sep 2023 04:15:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239527AbjIREPF (ORCPT ); Mon, 18 Sep 2023 00:15:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239502AbjIREOj (ORCPT ); Mon, 18 Sep 2023 00:14:39 -0400 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2055.outbound.protection.outlook.com [40.107.212.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 714DF115; Sun, 17 Sep 2023 21:14:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dCxnMOEP4pN98lhD7rV7Xju6Ezv+PvLqk3X1lLnnLmSHqyjQFExjYO4UNOom9QThTgFwNTtZnmg3wzc+QzA52ehNHtmzHn6Tw1+PoQZce8roYgGbH53kWpMcJiLntCzmeKu5jia7ADbG2u3kvB6F9RFEjwLtoBxRtb44BFrsfsl2O4TUvwZmJ4Oqz0z6Zsyp6RCbMgAOya3QrbY78jYQkViLAgfCiLVYrr2AKU/+/IunwMKhnWVu37lbhmUWu0UvuKn6AJkrh+lLMGTHporCIaCLUAfsw97snlCJBIFsrknR18ywFK2GdAHx1ueAhkFkNnaNyIiA/9Fv/O6ObEGUFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=r/mSGZRoFXmKdYxsE0jWoZTVm5LrJi853J+Nz9Mme7k=; b=NpDlOReKZSDr/vspu7Vf5RzmCkUNTwAwYEznCHn4IsTNUHSU1z61fPAC1NRIFz5LVX5BM5x4UVxATkg29V4AkcD0BhycssxbohJRMmCo0CwUvqlD6iO2ep9/y4rv9JJVG0pthar+jBcfsMmVMOVZ88w8yNfUcnDcnPVRuBhSU0ut6mCUypTF3180L+t/Z4bzqiIWl/mCvr3iAkSnoaUB2DZQAC15a+YdnFAYTgekFJMJIHNdnKnSJFpdgIwUiLCa0rJl0GW98yeJWdiUWCTxwu42Z5yhGdT1hjyWlT2rj5oXKa/RqpJhi/6NR+PbzLkDx2I7m+M1n52RvjYW67QVpA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=r/mSGZRoFXmKdYxsE0jWoZTVm5LrJi853J+Nz9Mme7k=; b=P5vK+wMNuDpVO8SnflM36bDUnM3WrXKqODgy7vVhosIuXYjf0Reiwu0+qXilIrsAFpLet9sJL3TB3O88zi0c7TQ0d5FnXmJh+in952ZKbyOZ0ap1S2NVEry630HB+0kHPmWhEjh+yq2zfO9EpWxsLCwDuCGQkF1//CWYZsZG2kxX6ZH9kWYR+YY3jj7iA1d9ID6hZG0pnSD9v4tuskCMbbPHUSNmCiU10CNBaBqMmg8RhJyP40ACoZ4u5FBzY4vTJ5WwjKCJCenbAToFdBHMLHKeowfzQocW5lwrS+9It+WDbmctgHcZQ4Lr11/ZMDNJhIo8g1YkQD8xPd2A/j3yzw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from BYAPR12MB2743.namprd12.prod.outlook.com (2603:10b6:a03:61::28) by SA1PR12MB5658.namprd12.prod.outlook.com (2603:10b6:806:235::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.26; Mon, 18 Sep 2023 04:14:26 +0000 Received: from BYAPR12MB2743.namprd12.prod.outlook.com ([fe80::5cc1:1ea3:4ec5:72af]) by BYAPR12MB2743.namprd12.prod.outlook.com ([fe80::5cc1:1ea3:4ec5:72af%5]) with mapi id 15.20.6792.026; Mon, 18 Sep 2023 04:14:26 +0000 From: Rahul Rameshbabu To: Jiri Kosina , Benjamin Tissoires Cc: Christophe JAILLET , kernel-janitors@vger.kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Rahul Rameshbabu Subject: [PATCH v2 1/3] HID: nvidia-shield: Fix a missing led_classdev_unregister() in the probe error handling path Date: Sun, 17 Sep 2023 21:13:43 -0700 Message-Id: <20230918041345.59859-2-rrameshbabu@nvidia.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230918041345.59859-1-rrameshbabu@nvidia.com> References: <20230918041345.59859-1-rrameshbabu@nvidia.com> X-ClientProxiedBy: SJ0PR05CA0205.namprd05.prod.outlook.com (2603:10b6:a03:330::30) To BYAPR12MB2743.namprd12.prod.outlook.com (2603:10b6:a03:61::28) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR12MB2743:EE_|SA1PR12MB5658:EE_ X-MS-Office365-Filtering-Correlation-Id: e8b7e1fa-3e46-435d-40bb-08dbb7fdbf48 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eETfqazqbfpQOsSgBp+FUgQd0Xwh8KmrQ7MVZOcqvwwMf+ykLZNsTmGqS17jqgB8fyEOV6Y1AeXwV2Lt69F3qA3V1m/SJYle8ZCsAQLHuvjcM8JG0qruPW+0TcDSFgIeHzbXqgQiQOQ8eRIJ9dFYHVhvvJWNhi8kGYWn9S+uN0goLTdQFVLOMtOlFOHL6WfZg+vE39KYtxVlSeEb4iPKjpMR9lAowX/Xs297Y6A+eZbZ4aSjjkJBEqI9FugpqOT4Cy3mhVkyHBBw6fZtoHUfduC1itTCOs90SWCmnY6jeK2hA3wPJ6QoY0nVUiHHr/QbTLLiiu2d1nIVtqVAZl4H5D4BmhRPdLxm5wiBiyCxSRSPa/ELpEZoCMxaBiF/mXwA5c9c1cyAYBiKAxIvgKLEhJ9LpoKO8VnFKP5RP+PEmNyp3kDHOI6m1KzVRlENxn4D3d9ieSX6N1engAYipuDb59Mkzafti7dnfiioZOwP1i+l1k8O7D/R/REQ4bZXi4bvABEjNf83fm+uii3rTh0v4J53CpNI/elevSriZ4JNYu71xyjTZjWAGpMCoYGnVWPh X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR12MB2743.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(39860400002)(376002)(396003)(366004)(346002)(451199024)(1800799009)(186009)(6486002)(5660300002)(6506007)(86362001)(6512007)(54906003)(316002)(66946007)(41300700001)(38100700002)(66556008)(66476007)(110136005)(6666004)(478600001)(2616005)(8936002)(8676002)(26005)(2906002)(36756003)(107886003)(1076003)(4326008)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: YwoegYwzFl82KOlvnq+GUZqVvMZ7Y5CZLkJStbH3D38oQee63CJFrcazAQKOFb8Fs6a/jS5sGB/hTW75+GOd7jnsrM6PnsvFlrJ/juKmP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T0oOdLWh50H6mijHUhMDXQ51RxN19LGQjKfXdLKQRm1AO0Ya08qxX8jCKLEGld4MTVs7zPVZnkYx6CgxnbkYhNdcl34HHNJNG5TU2q3x7yrMffqMGtxt1O/yFbzxx/f+wHvC7kFwJEudrbVa+7ZmPYEArxRGYtmYqd9o8HdTsu8sfUuBUQl7TVmZXuVPYGRJ5OzAPiic+91oTmbIxBoRMX98CjV6ybSfjlLFJlE1BVgr0ADn+96OFLha0hWtCClUV8qWIj+6mMQ5Uii8X2BKgr6ehD2uujwVsyNkTT32WThn2TqT4sXz2c0rYRQ9dDKWccfu1+Y0QJCZgKbQB3sE2kjGfXS1JpZNzgvw9bQfKBW3tzUFZ6wRCYNlaUWfBzoLAKo/GjjYf9tTasaa+oowDrWRcxvuk7AEHSv X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: e8b7e1fa-3e46-435d-40bb-08dbb7fdbf48 X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB2743.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Sep 2023 04:14:26.7984 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: PXHfaatUL3Su7Yc4ssEyELrknnz7CDMAUn9qTAoRr0/JQoz9eRyb/K2mSPUo8uh1H5Tfc+3MY7wWs16p4HUJ7Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB5658 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org From: Christophe JAILLET The commit in Fixes updated the error handling path of thunderstrike_create() and the remove function but not the error handling path of shield_probe(), should an error occur after a successful thunderstrike_create() call. Add the missing call. Make sure it is safe to call in the probe error handling path by preventing the led_classdev from attempting to set the LED brightness to the off state on unregister. Fixes: f88af60e74a5 ("HID: nvidia-shield: Support LED functionality for Thunderstrike") Signed-off-by: Christophe JAILLET Reviewed-by: Rahul Rameshbabu --- Notes: Changes: v1->v2: - Add the LED_RETAIN_AT_SHUTDOWN flag to prevent led_classdev_unregister from trying to set the LED to off before a successful call to hid_hw_start. drivers/hid/hid-nvidia-shield.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/hid/hid-nvidia-shield.c b/drivers/hid/hid-nvidia-shield.c index 43784bb57d3f..c144641452d3 100644 --- a/drivers/hid/hid-nvidia-shield.c +++ b/drivers/hid/hid-nvidia-shield.c @@ -801,7 +801,7 @@ static inline int thunderstrike_led_create(struct thunderstrike *ts) led->name = devm_kasprintf(&ts->base.hdev->dev, GFP_KERNEL, "thunderstrike%d:blue:led", ts->id); led->max_brightness = 1; - led->flags = LED_CORE_SUSPENDRESUME; + led->flags = LED_CORE_SUSPENDRESUME | LED_RETAIN_AT_SHUTDOWN; led->brightness_get = &thunderstrike_led_get_brightness; led->brightness_set = &thunderstrike_led_set_brightness; @@ -1076,6 +1076,7 @@ static int shield_probe(struct hid_device *hdev, const struct hid_device_id *id) err_haptics: if (ts->haptics_dev) input_unregister_device(ts->haptics_dev); + led_classdev_unregister(&ts->led_dev); return ret; } From patchwork Mon Sep 18 04:13:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rahul Rameshbabu X-Patchwork-Id: 13388793 X-Patchwork-Delegate: jikos@jikos.cz 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 CC5A8CD13D9 for ; Mon, 18 Sep 2023 04:15:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239538AbjIREPG (ORCPT ); Mon, 18 Sep 2023 00:15:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239512AbjIREOj (ORCPT ); Mon, 18 Sep 2023 00:14:39 -0400 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2055.outbound.protection.outlook.com [40.107.212.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF615C6; Sun, 17 Sep 2023 21:14:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MX1VGqdqdnndUryxNZxQrCz41WPJDQ7M5E0FOBctU7wxYFM98bWK5COBzjMAD72qJjUAagocr0Ki8bfwt3HNi4NAp0qvGNCCD0BC9YhUu/5/AJyHrd+SRopHMvCztKoOpemFh7pG6h6EaYLHjNmk5hjzPvJNkclkOcZJJLYkKG1tPEl3ZNdqPpabNIQ0xnp0TjXdrkLwCf8TczILdsCWAEiiUPJK/wJQOorI8e0E+bMakVKBbmCWO/1CCJucrlgh9pV895ZzjyYWdLvUpxdmZ4S0e4AHydctZbFVGEPaNN1p5392XT6AAbLI8VUpuTneFOpeVrH0dmeOBHQxc/Xgpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=DDkAfZKRnYEYRLCh+DVXLuzacnaY5ysTyeoTP8bolCY=; b=OeUFfSe9dtaohXWCg1wrE0WbPz8UP0KRhwVLoUPQNSrQhhiHgAblEqLrNuqCaYu1J2or6j7D8A/A5i7CYtzf1nut5XxDM117m1oEryLMSrMUYeYgx13KJAyKOo5aDtWP16uSHtB+fGxFTJwzFHWpiXiKr4SSBhCevD6fM88Z1wMLlxu/kfZXVbo7Rwl+lgGWd1K+lSfkjleoh2/pQGmlvHaAnXXfRCN73FmokgOsp2ptyXW/BXdzBEiHUzfgYdaPCgub9uEASLnxF4T2YaKIdIJZUsvb0C2mlGSiovstjwPTorI8ndh82VK9rzJbBDdrog7h/qcnu4kAeuEyjDSkjg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DDkAfZKRnYEYRLCh+DVXLuzacnaY5ysTyeoTP8bolCY=; b=J6aFPoIQA6v3fI6o2odCFRxWfUq6N7nz3J3+EJN2j5z9xiVQyM6QQO2YINO3TVTb5HBWbmsktEJ9S1/HpnfAM+38nleAQ9Q+4ly9kPwgxWS/c4tDM8aJajyzHrBfH2243PmElPpYzurIfNL0ycuGYD/OxeTYuaEdmfYtvRfRqf1vN/6NunrDC/TGZeh6hymiTFemdQSK/IJw68uQ4Tdqi8BQjG3jsZHmcwAipkOSNozhQfZTTEE8GMpSknYyXRo8sUKS2X2p20WC88LECBpDKsBsvtqyz0/1JsBh82oa8/PimdfF+6dUTxPU2PKysh+HzpnOwEN/itXJmQeihdXDRw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from BYAPR12MB2743.namprd12.prod.outlook.com (2603:10b6:a03:61::28) by SA1PR12MB5658.namprd12.prod.outlook.com (2603:10b6:806:235::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.26; Mon, 18 Sep 2023 04:14:28 +0000 Received: from BYAPR12MB2743.namprd12.prod.outlook.com ([fe80::5cc1:1ea3:4ec5:72af]) by BYAPR12MB2743.namprd12.prod.outlook.com ([fe80::5cc1:1ea3:4ec5:72af%5]) with mapi id 15.20.6792.026; Mon, 18 Sep 2023 04:14:28 +0000 From: Rahul Rameshbabu To: Jiri Kosina , Benjamin Tissoires Cc: Christophe JAILLET , kernel-janitors@vger.kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Rahul Rameshbabu Subject: [PATCH v2 2/3] HID: nvidia-shield: Fix some missing function calls() in the probe error handling path Date: Sun, 17 Sep 2023 21:13:44 -0700 Message-Id: <20230918041345.59859-3-rrameshbabu@nvidia.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230918041345.59859-1-rrameshbabu@nvidia.com> References: <20230918041345.59859-1-rrameshbabu@nvidia.com> X-ClientProxiedBy: SJ0PR03CA0073.namprd03.prod.outlook.com (2603:10b6:a03:331::18) To BYAPR12MB2743.namprd12.prod.outlook.com (2603:10b6:a03:61::28) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR12MB2743:EE_|SA1PR12MB5658:EE_ X-MS-Office365-Filtering-Correlation-Id: 0fc52610-ffda-402b-6c2c-08dbb7fdc03b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RA6CBe2zyDJThg1+mFse+qAXFzlNboKD5S/UGkJPArJY8odND57pDcpiBhKXl7uHf26iVZu7PQQNNW9AIuQ41vBnb+tgMPEAiMhRvsaiajLPf6g2kJNSLayFY51D3DF2yWxhpLoRoB6hM2aMrRKvIwbIObjhCVxvwrR0fYsg/TBtYzAIUa1XvkHalReDDwHeDVc/KLuQBZlsozDRCUD/wTydS6IIf42tABmVWTUESRxnxYVcmOekxh90N81aOlSeXywj015Lr0ao1Uic/Q9Us4X4wUsajIgH/mbiZlTQJyfIW0cR3BfL7tIVX1UDvLsfi6yfMRRRov8MpUMA/C2Ca/4wf9pFUXWWIUiaHjedwG9SUrsD16qLSg498X7eoNMBphYV7j/thn5P9x7wkZ4sCNRXR2IuIwUMiBksR4msv5TAbPC+ffKKHYB65+zZQ+BMCQu/8Cd760f/tZpEKF0AWkiyY9ooGAb5BDft5yh2s+epY9/uuL5/xhGIvusOquJUT8/692scB3pIyf3tssO9FXc1zwG509lrzfdV4w20h3oQ1Q+K80ZV4bgDXKZrNbvk X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR12MB2743.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(39860400002)(376002)(396003)(366004)(346002)(451199024)(1800799009)(186009)(6486002)(5660300002)(6506007)(86362001)(6512007)(54906003)(316002)(66946007)(41300700001)(38100700002)(66556008)(66476007)(110136005)(6666004)(478600001)(2616005)(8936002)(8676002)(26005)(2906002)(36756003)(107886003)(1076003)(4326008)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: LrOWrlG6qVhqMxEwgYFIw3LbIyZKdU3lMSoETLL10vWCBYLaTjta4bY0BPOsaE8l46K8E0owMekM/ESzV7VmGGGpSidq9IhfEe+D5407NwFCwNI2U0cLV6c+8f7+JBf/Ze7eIpWYk6+Rbsv+CBmluSaxCrJGd6qWl91Kpsxqf4PpjKB/etwPbbuAt3CDVFZc5zsPcPwSUlvDDhOD/uJ7LVSfo+dODHXTFi9LlPAdYYc/GcP3Yhi88VTLa0JZce3XN6mfAvOVstjzon3Pco+b6xj9/FOwHYUJkJS0UFsfIgbqJ0QATtBL8KnOjVZ0Y51190L5exZusDUK+rVM0Ejly/xbPljP8IlNttPRg4Ub8pgl7g6xQ8z0r6OuKA5kAQ3m8yPJZZpxLfg1RgudDozUWagkSqPMPskALSOtGQnv7+rzRia+uiZiYicpFCKTGexMDdA1V4wvG6ObqCR67JOmQOd33D+mk6G+zvy9U7DiRTktRCtweD49xG+qhOXEb/qjrDZKPkyz2Wb7ierAurve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com X-MS-Exchange-CrossTenant-Network-Message-Id: 0fc52610-ffda-402b-6c2c-08dbb7fdc03b X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB2743.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Sep 2023 04:14:28.4003 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 6fqbvQ5MGM3AD/y1ghNjhIaXDaPdWEDYPZ7Fz7jgElRRwYF/47iNVAPEZZpfj+iGxbwkFDb1Bim35ZRYv0QlOQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB5658 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org From: Christophe JAILLET The commit in Fixes updated the error handling path of thunderstrike_create() and the remove function but not the error handling path of shield_probe(), should an error occur after a successful thunderstrike_create() call. Add the missing calls. Fixes: 3ab196f88237 ("HID: nvidia-shield: Add battery support for Thunderstrike") Signed-off-by: Christophe JAILLET Reviewed-by: Rahul Rameshbabu --- Notes: Changes: v1->v2: - Rename err_haptics label to err_ts_create to make the label name more accurate. drivers/hid/hid-nvidia-shield.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/hid/hid-nvidia-shield.c b/drivers/hid/hid-nvidia-shield.c index c144641452d3..a566f9cdc97d 100644 --- a/drivers/hid/hid-nvidia-shield.c +++ b/drivers/hid/hid-nvidia-shield.c @@ -1058,7 +1058,7 @@ static int shield_probe(struct hid_device *hdev, const struct hid_device_id *id) ret = hid_hw_start(hdev, HID_CONNECT_HIDINPUT); if (ret) { hid_err(hdev, "Failed to start HID device\n"); - goto err_haptics; + goto err_ts_create; } ret = hid_hw_open(hdev); @@ -1073,10 +1073,12 @@ static int shield_probe(struct hid_device *hdev, const struct hid_device_id *id) err_stop: hid_hw_stop(hdev); -err_haptics: +err_ts_create: + power_supply_unregister(ts->base.battery_dev.psy); if (ts->haptics_dev) input_unregister_device(ts->haptics_dev); led_classdev_unregister(&ts->led_dev); + ida_free(&thunderstrike_ida, ts->id); return ret; } From patchwork Mon Sep 18 04:13:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rahul Rameshbabu X-Patchwork-Id: 13388794 X-Patchwork-Delegate: jikos@jikos.cz 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 285E3CD13DE for ; Mon, 18 Sep 2023 04:15:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239559AbjIREPH (ORCPT ); Mon, 18 Sep 2023 00:15:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239519AbjIREOl (ORCPT ); Mon, 18 Sep 2023 00:14:41 -0400 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2055.outbound.protection.outlook.com [40.107.212.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A55B1FF; Sun, 17 Sep 2023 21:14:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iHoMhNo0JimCXWrKmF9fd4LIAufu0uhWD0RQd5xR9tS4NCG6a9jajkYtSWUsiUA1JFAUHig9f1/F7JnjCZ7ZR1TD6UtjrrdNULO7yM3fTUKtiLakhnt4dey2N1JZwXVGikFHwbSco8cruN9Cszudi517CVbCqBu6aTM2E8zvpZcJFtjWKJzACCglXUrSJLiOv9ti6PmKh0B5CbpGUpipI+xBVClGwMhJCYopwXgYffr5yE5/5OrRsJ3ct31jJqrwOqEi4nXX6N1S5rB4Umx399+TLZ0AtdMBBAGFoUTpESQOMtTFKYZDxvHZCRkqBDjfwDGWg0hHtrfkG/SI8s5WXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=vktCfwR6O5t2TIifqIPV8Clwm49DhFPFArNxOy8kS88=; b=SW/yC2FUeR+s/Iq89ka9rM12i3ILGli4wa3jri8xMtrQZQsV+9vnDvyo5TZpLi+KjpsYtASEK+2xzhHAbluhcUudwb9Akji4UrBqqrWcJ6YaF/vxwh2I2mFYl0R1SVcUfZ8+Grf43MPSXTUHr+iw03n9a/u2yDyAhhziksHsVg5LNJyxtXRHGBpq7sZ/CkP8PlWhxGPFEmvtvxvigRpRuUc0VxJKtEF+2ksorwJvKn7hCAQANptDvAJjE/uZJYl5C/59dI7HI91aUd3B5yvkuqejZR7j9vHcq0lHSFWks0cQiXB6WG40x6JCDJp1wD978nIFbgyHp0u/sVlHKtCZMg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vktCfwR6O5t2TIifqIPV8Clwm49DhFPFArNxOy8kS88=; b=e7QEhCBp5LlReKVTVUKPH0VJwpBLcdTO/E66T7pR9TI15U6/mvZTcPqB4JqhdRsOLigd0Az/+FY9irsf/aY0fyWVbdTIOowWX7Scz/u/NFAIt1SkQByUNMvUH+J4PC46BSTiKgPo6xXj2M/KuSrmY6JkFtMmMjkRVbt6u8FdcIqFD+Gt391DnmOWQmS+aIgtNfSmXNOirNRkSKcJN//y/gD/RH2KBlne/5J9WmdOKL7kufEufGv4Lv8mjI5goT3oxd9FAeDuc+ZCBLpvskAE3kTNKLuyQ1CznKlxDZzUF95pviPl3ZatiX/iOB7KSEkyXyJLJ8+NxTlyMCKpMsS2hQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from BYAPR12MB2743.namprd12.prod.outlook.com (2603:10b6:a03:61::28) by SA1PR12MB5658.namprd12.prod.outlook.com (2603:10b6:806:235::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.26; Mon, 18 Sep 2023 04:14:30 +0000 Received: from BYAPR12MB2743.namprd12.prod.outlook.com ([fe80::5cc1:1ea3:4ec5:72af]) by BYAPR12MB2743.namprd12.prod.outlook.com ([fe80::5cc1:1ea3:4ec5:72af%5]) with mapi id 15.20.6792.026; Mon, 18 Sep 2023 04:14:30 +0000 From: Rahul Rameshbabu To: Jiri Kosina , Benjamin Tissoires Cc: Christophe JAILLET , kernel-janitors@vger.kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Rahul Rameshbabu Subject: [PATCH v2 3/3] HID: nvidia-shield: Introduce thunderstrike_destroy() Date: Sun, 17 Sep 2023 21:13:45 -0700 Message-Id: <20230918041345.59859-4-rrameshbabu@nvidia.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230918041345.59859-1-rrameshbabu@nvidia.com> References: <20230918041345.59859-1-rrameshbabu@nvidia.com> X-ClientProxiedBy: SJ0PR05CA0200.namprd05.prod.outlook.com (2603:10b6:a03:330::25) To BYAPR12MB2743.namprd12.prod.outlook.com (2603:10b6:a03:61::28) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR12MB2743:EE_|SA1PR12MB5658:EE_ X-MS-Office365-Filtering-Correlation-Id: c9336be4-9e8e-4baa-47d3-08dbb7fdc13f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FtbPFlCbCu735/ucZCmXdVAlZh5oyUe314kjV+qGZcmljcwEagWB/sTRCIJWFn6wiLdHJNWQme5R7x4yT6A++fZTaYKPpjlN5FgYG4zJPi1HWmF/vXne4NvgxHxheNlBvmiGpHk+wJKW6YhyJr0MUMge2g0yLZli2c3c9yrGj3dsE+8YpzHvhwMJYY3oRpxSBJp5GKdFMy9Z5dmgXrcN98M59RMUDKXwrkJiu/BsIIge0RmABa5GsyPGFzoUp/HsVNsssU/a3iUjNF9nr97Zj8tyD1cbHvcLXB+ZO8Zx5oKe5Z2DYfJX7pRUNpY3v8QQl4BQHNdr1QVdQVpgmzH4FMEJGxNxqlo1i9X2MUrhej0EN3bwIUyJ6t1jmCGSKuc/U8nFWTxDZ1j9QNVJ4J35gLRjwLJ/K+ia88zcZ1dRulASE1FQ9MbQYaJm8EL3TFepEUUc+bnEIMZ2mzLLVXnGgUQZZngmMEkk7Kfc/u8o3+92bv6Ipo4c/m+szA93NSuINmu2HKTSSvrep0JcbODy2F7bD4WC+EgBWQbsLkRRkf5wV9J35ol01GxJunrXUn2Q X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR12MB2743.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(39860400002)(376002)(396003)(366004)(346002)(451199024)(1800799009)(186009)(6486002)(5660300002)(6506007)(86362001)(6512007)(54906003)(316002)(66946007)(41300700001)(38100700002)(66556008)(66476007)(110136005)(6666004)(478600001)(2616005)(8936002)(8676002)(26005)(2906002)(36756003)(107886003)(1076003)(4326008)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X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CIYfIyKlsfIeeg5VzbjLLt1bL7ILK1IMKV/58VU4aEeG8aogkKYHOHbJFUvt4M/9vc+bhF7BCSRyoLs00noweSnwf4Xoj5OYOaVxBFoZeZJjvTw2dHLKZPNnoafnnzAKssHHPKo6SWTZLFowteCXLD1c5qawKxivTmKkxEcoYwzVsmm+TlNpHw8OQVFbYeJW1yKEatC5M8e8Yqaq0C88800IphRbdaCDjl3uYRtlAkQT4A+n0hbF9SqaqL7fMbQBBG2ASP2N2wrnuC6/ZVfzFea7UD3E98NiWwpzVykCL6BIdt2pgeo+SaGtyHJ6x9mw74/rjHHlin6D6fp82kFnGveZykxCQkU0o2I8V1Zt6vk6WsD8s22RH3plZJgmCSwwyw+MJRwLNpdR34P7E6Sxuq7dZatp2CYp3yM679WYanS6pdUOsuE8mBd5LB+YXeglDbP9nU1+qt6o4MoNmPWGaetCvEZRYdmOKcN86w93q2dSrdgbLl5pAlfEx53lnz440HEn4MsBhepqNHZ0VDyQmOfvk15/Bai6pm3Dk X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: c9336be4-9e8e-4baa-47d3-08dbb7fdc13f X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB2743.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Sep 2023 04:14:30.0935 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 2AH6E8dbKOLq7ID3Q1ScoMwEGvpKHtakG6NLx9pvDOvQ6OR7e1RFF9OhKO41lsMAdhRPpF7yvtRAfkT9YCBUbA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB5658 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org From: Christophe JAILLET In order to simplify some error handling paths and avoid code duplication, introduce thunderstrike_destroy() which undoes thunderstrike_create(). Signed-off-by: Christophe JAILLET Reviewed-by: Rahul Rameshbabu --- Notes: Changes: v1->v2: - Re-order operations in thunderstrike_destroy to be in LIFO order with regards to the operations in thunderstrike_create. drivers/hid/hid-nvidia-shield.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/drivers/hid/hid-nvidia-shield.c b/drivers/hid/hid-nvidia-shield.c index a566f9cdc97d..817ad6c01129 100644 --- a/drivers/hid/hid-nvidia-shield.c +++ b/drivers/hid/hid-nvidia-shield.c @@ -915,6 +915,20 @@ static struct shield_device *thunderstrike_create(struct hid_device *hdev) return ERR_PTR(ret); } +static void thunderstrike_destroy(struct hid_device *hdev) +{ + struct shield_device *dev = hid_get_drvdata(hdev); + struct thunderstrike *ts; + + ts = container_of(dev, struct thunderstrike, base); + + led_classdev_unregister(&ts->led_dev); + power_supply_unregister(ts->base.battery_dev.psy); + if (ts->haptics_dev) + input_unregister_device(ts->haptics_dev); + ida_free(&thunderstrike_ida, ts->id); +} + static int android_input_mapping(struct hid_device *hdev, struct hid_input *hi, struct hid_field *field, struct hid_usage *usage, unsigned long **bit, @@ -1074,11 +1088,7 @@ static int shield_probe(struct hid_device *hdev, const struct hid_device_id *id) err_stop: hid_hw_stop(hdev); err_ts_create: - power_supply_unregister(ts->base.battery_dev.psy); - if (ts->haptics_dev) - input_unregister_device(ts->haptics_dev); - led_classdev_unregister(&ts->led_dev); - ida_free(&thunderstrike_ida, ts->id); + thunderstrike_destroy(hdev); return ret; } @@ -1090,11 +1100,7 @@ static void shield_remove(struct hid_device *hdev) ts = container_of(dev, struct thunderstrike, base); hid_hw_close(hdev); - power_supply_unregister(dev->battery_dev.psy); - if (ts->haptics_dev) - input_unregister_device(ts->haptics_dev); - led_classdev_unregister(&ts->led_dev); - ida_free(&thunderstrike_ida, ts->id); + thunderstrike_destroy(hdev); del_timer_sync(&ts->psy_stats_timer); cancel_work_sync(&ts->hostcmd_req_work); hid_hw_stop(hdev);