From patchwork Tue Sep 27 10:27:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Basavaraj Natikar X-Patchwork-Id: 610715 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 D5DB9C6FA86 for ; Tue, 27 Sep 2022 10:28:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231349AbiI0K2A (ORCPT ); Tue, 27 Sep 2022 06:28:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231784AbiI0K1y (ORCPT ); Tue, 27 Sep 2022 06:27:54 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2081.outbound.protection.outlook.com [40.107.244.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A052FE66F for ; Tue, 27 Sep 2022 03:27:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LmWwq69/Bmw+3ONXHLQw/qbDZGvoTm9afI3U9dV0/I+qLW+FfERbhGMqiG4L11DAxMnq4PofjeqVaFvDX2i6VF8SGJrPKKpvfgjfOAqgIgM5npcQr4qUnULgETrUgL48n03pXz5u5EXXlWl+toMAUVUzbUlTPoUW4cFCUb03PVbbvQ7pPkM2wku1baoAf2YKxqMTeMqkdxykil2aHJ6+zwWsiY+S9ttvhCMEmgwyySMVefr3RkZLjO+OGNMrCItcePuv2rA3+l2EL2OlDWAhP8zXU6/j6fIJnV3jTwHSXlgBsWr0nAG5ml3SCcJu93p2DDpfCYd780Q5RZoaKjX7gg== 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=3l6+V4CJA8ppmTKM/jK7ggKMTx0eKz5vNteWRxpuVUc=; b=PvFrsr5Ldgjk50kLgDog4ew0HF706HZcGKS5H3lPTc4LiKA/JjJ0qeUfcgJtC0VmvwGbbSRcqyUBjrDy3bUZIGisrGleGS1o8EOarAdXQ5p+MY0GhtKDlhVwL54KoCMCzyCQlmHa9E+FULmEc0q94qVQ9ZeWo6rr4O5ycqHYns+Ujv+duhQICWNqaFhES1sGRL5mQPqPuF97QuqNY3ugaInJCdkT8Rgpl1LA3jaYPMuA0rHbutN0EqW9kfzbMytdQNVSxMr7D1EYpz2zuk50VVVUChvU/KHAX7TX5f4wDfmoMdJA9XSUkmvqRI/UfxhrRM5N/M6HgzXM5D6tI7QnAw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3l6+V4CJA8ppmTKM/jK7ggKMTx0eKz5vNteWRxpuVUc=; b=tywGOpEU/BYk0thlLabXdMwCvgktXHvdk+447zvucR8JCcy/rsaN+cABtWJW50BGdQkyH3kru7dtixXRQQBr7yqZ649AKyNr5Njri8HITXoNLTQQZW/hAyyOMo3iFjEMOBJzSyy18YNQGNRc3xpSMYI9Ae9qtjDVo5hw6wKbnSw= Received: from DM5PR07CA0102.namprd07.prod.outlook.com (2603:10b6:4:ae::31) by MN2PR12MB4568.namprd12.prod.outlook.com (2603:10b6:208:260::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.22; Tue, 27 Sep 2022 10:27:44 +0000 Received: from DM6NAM11FT063.eop-nam11.prod.protection.outlook.com (2603:10b6:4:ae:cafe::63) by DM5PR07CA0102.outlook.office365.com (2603:10b6:4:ae::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.26 via Frontend Transport; Tue, 27 Sep 2022 10:27:44 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT063.mail.protection.outlook.com (10.13.172.219) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5654.14 via Frontend Transport; Tue, 27 Sep 2022 10:27:44 +0000 Received: from jatayu.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Tue, 27 Sep 2022 05:27:42 -0500 From: Basavaraj Natikar To: , , CC: Basavaraj Natikar Subject: [PATCH v2 1/2] HID: amd_sfh: Change dev_err to dev_dbg for additional debug info Date: Tue, 27 Sep 2022 15:57:25 +0530 Message-ID: <20220927102726.1599178-2-Basavaraj.Natikar@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220927102726.1599178-1-Basavaraj.Natikar@amd.com> References: <20220927102726.1599178-1-Basavaraj.Natikar@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT063:EE_|MN2PR12MB4568:EE_ X-MS-Office365-Filtering-Correlation-Id: 201aff4b-584e-4c85-4754-08daa072ea85 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eRC8zd5gCZEzMlCjraz6wCIkLRmwi84zlRH4UNXjZaQhB7hQfrYmz4eL5eoaLWvfT8i90OFCsWBVBuUVISQZ6sCLnQwSyeVccyydCYz8vWbQCqWQVyuMKjQVuwh32JsWRgF1TRcfi3sfgkXf7ykjHpcUn0kNL71AeiHd7XnfxaacJD2tUjN72n8R7WIrG7uuuKeTJEJmhzYJjwlVhdFIZgVkqub+LzOFG9DAmmQ8+IgiwufsvMc75k35q9S5FOHSmn8Z3+4Tpf830LhTnt6o5k2TqgHvZ+mZSfH09Pt9Qdem4E0JKk2QeCm8hfp8mFWPOdO1N1etQGz0VBEx3UdvPYpcDulogbT4UQ+Vs2TGyHme5v6XbYoLUX2A0NKTG0O+3wASZFov6X/5KvpLEPSJqkBSx76bwo7V6ZD9tuW8UDWV68qCDcDng3LjBRfpv+rZ9NLoTYTo54zbUpsFiL0s6y3lNVKXWryHpugcq9RIiRnkyj76teCVMfy0NjGrjvEYg/6T0Jgbdqusa7tgDlQ+tGP8RZRmwWTCkDpKwOM6iDf1rtphSZXX1waIPx6JULknEuVdulO5XlOzf+7Bw1eZ9purb7Ih2OdZVQqZXLKlsnDMBP/b2/RJuLB6DkTx9PloFNx9V6LeEJl5fEX4XsONiDpaF3oBoScmDAH3EYaErA9WoDJtlikWG70Hs8e0TGBwmP8IP/P3B8ZS94FHrwH07GjaplZIiMDOy/jcy2VO+CbaFw1PYmqDui5bDmPuTC09QxYdRu4TGZ/H8W93EKL74ZBUeBjmx/PcPyU7N0OejhpwU6R9ebAEGe7JzfG3KuT8 X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(396003)(39860400002)(376002)(346002)(136003)(451199015)(36840700001)(40470700004)(46966006)(70206006)(7696005)(81166007)(8676002)(41300700001)(336012)(186003)(1076003)(356005)(2616005)(36756003)(2906002)(16526019)(70586007)(83380400001)(426003)(82310400005)(40460700003)(8936002)(5660300002)(47076005)(82740400003)(26005)(36860700001)(40480700001)(6666004)(4326008)(478600001)(86362001)(110136005)(316002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2022 10:27:44.6728 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 201aff4b-584e-4c85-4754-08daa072ea85 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT063.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4568 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Users should only be notified at most one time on systems doesn't have any sensors connected or non-supported systems. Check the return code and don't display error messages in those conditions. Signed-off-by: Basavaraj Natikar --- drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c b/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c index 70436f9fad2f..d840efb4a2e2 100644 --- a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c +++ b/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c @@ -286,13 +286,13 @@ int amd_sfh1_1_init(struct amd_mp2_dev *mp2) phy_base <<= 21; if (!devm_request_mem_region(dev, phy_base, 128 * 1024, "amd_sfh")) { - dev_err(dev, "can't reserve mmio registers\n"); + dev_dbg(dev, "can't reserve mmio registers\n"); return -ENOMEM; } mp2->vsbase = devm_ioremap(dev, phy_base, 128 * 1024); if (!mp2->vsbase) { - dev_err(dev, "failed to remap vsbase\n"); + dev_dbg(dev, "failed to remap vsbase\n"); return -ENOMEM; } @@ -301,7 +301,7 @@ int amd_sfh1_1_init(struct amd_mp2_dev *mp2) memcpy_fromio(&binfo, mp2->vsbase, sizeof(struct sfh_base_info)); if (binfo.sbase.fw_info.fw_ver == 0 || binfo.sbase.s_list.sl.sensors == 0) { - dev_err(dev, "failed to get sensors\n"); + dev_dbg(dev, "failed to get sensors\n"); return -EOPNOTSUPP; } dev_dbg(dev, "firmware version 0x%x\n", binfo.sbase.fw_info.fw_ver); From patchwork Tue Sep 27 10:27:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Basavaraj Natikar X-Patchwork-Id: 609893 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 10D6BC6FA90 for ; Tue, 27 Sep 2022 10:28:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231681AbiI0K2H (ORCPT ); Tue, 27 Sep 2022 06:28:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231799AbiI0K1z (ORCPT ); Tue, 27 Sep 2022 06:27:55 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2070.outbound.protection.outlook.com [40.107.94.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DF57FCA56 for ; Tue, 27 Sep 2022 03:27:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lGe0lwHAmhy3EZAS5Jjhmb49R3nNo4hmjcqs+4YeqZaW60mCjQz0jI1BUqRbRXxuwGW5idTJMAlzwMxAkc/WMb2F2RZ7x9LnS9Z3DkqoELmifYCSw32acKN+ZijWBwSjNTVTvh58snNiRQjuRyb1VWS0DHW6xdIdbhJ9KQ7P2zUDLfxRl8JqyDsdzXjdei0ZTzYmuD45niqvE81WN33ElpMI+DU7Ei6ZMjd4Jys8dQvopA3QSiKUevfYlBf0U+r6E2gjvoIoryDuXQIvG8IEtBh2Xe5PkOi0epF8GR9JLxE4zZFobKadXeuo2Cek+gO2R57i8OLEsYASm8GFEo/lDw== 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=2P10Xx+oDz6dPccuJAh/o1xYJ6i+1KSnPwDX7r61vUA=; b=RxlTKOGP+OngsSFI1JbbOgnxXZqIj+O4aJgP9oHYE7op9yHlMoam1IvVD3pXuKSouF92uM/JXpjHaI92hkxT6R0dN+maR873K2mLkYOa29o44vRlxQvxVvqZukCZVc7gGvSXajmIP5iG4irQSs84IlnOcN9Ucbhp0IftO+zNBCaxfXT/q3GT9dMz13cZlQA4G2QLzcOzS04ylUKE1sgF8dRPj8Rrad4AqSRCvyXH8DjqSfVmHRcUaVudqvauBOEZhc0VgcWHG+2r8AGWzSHtQHSqUU/LoyUzjY5RvpFU85xvvCbJbXoCMrEyEIUpeBczWs6MFgOHoMYJRJg4Ce0JJg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2P10Xx+oDz6dPccuJAh/o1xYJ6i+1KSnPwDX7r61vUA=; b=zaIZUda1Lvz2G0XMUigZRQH10dzLxjcsNkH6J7FNvyy7Bdp2yPBAciURCwoVUzSUwI/xC0UbgMDqALXDBJEciKn2VzS5luS83+63VqcLlirdgDn6J98Z29+SECQV9V+beevGLxkEi72WsItKI5/e7l6BKOBFfnkzwmSuF3bY18Q= Received: from DS7PR06CA0008.namprd06.prod.outlook.com (2603:10b6:8:2a::15) by CY8PR12MB7587.namprd12.prod.outlook.com (2603:10b6:930:9a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.25; Tue, 27 Sep 2022 10:27:46 +0000 Received: from DM6NAM11FT006.eop-nam11.prod.protection.outlook.com (2603:10b6:8:2a:cafe::3e) by DS7PR06CA0008.outlook.office365.com (2603:10b6:8:2a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.25 via Frontend Transport; Tue, 27 Sep 2022 10:27:46 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT006.mail.protection.outlook.com (10.13.173.104) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5654.14 via Frontend Transport; Tue, 27 Sep 2022 10:27:46 +0000 Received: from jatayu.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Tue, 27 Sep 2022 05:27:44 -0500 From: Basavaraj Natikar To: , , CC: Basavaraj Natikar Subject: [PATCH v2 2/2] HID: amd_sfh: Handle condition of "no sensors" for SFH1.1 Date: Tue, 27 Sep 2022 15:57:26 +0530 Message-ID: <20220927102726.1599178-3-Basavaraj.Natikar@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220927102726.1599178-1-Basavaraj.Natikar@amd.com> References: <20220927102726.1599178-1-Basavaraj.Natikar@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT006:EE_|CY8PR12MB7587:EE_ X-MS-Office365-Filtering-Correlation-Id: b228da9e-27d5-4e9b-a802-08daa072eb8e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hm0dj6e3HWNfOsg+JwrHmMXtJUGVsn9grmkpHRnRLNdmb9w9xARPcVO1WccQfZ4RR8M9MYPGFH3NBOnBAA4EDYbAoif6iUJi0Oo7oaU3lp2dBny1I4bFN70nHOeQSwKQF/vtWonYpHpA4MZaL7baHCwvXujlJ89qsVmjfXBsNoxuoMD6/nih6/aSKwCX5C1pj8Ygr8HF82kkhh1ctavyfVYlAIBCbl9RwagkO8d2bCY0jmf2rqDCci8WrAGlwQrY+etLWlveiEK+WcZPvtENgOlkosTyPVwAEJl5FYxIHSh7NBoUMbO3AWcqP/vPwqe3AVBDI304/0Mg4i/Husa8IIvDRkBkyt9Eu/VnyOs/csUrowU6CJDxUUOU6PJoY05SMXd2NiZbWNiCiLYc+epdVSJRiz9SmrNXYV1LJqk521Dr+kDtU38doR9Y8Cl7M/fQRNGKsB+IsOeRrl6qRHOw5B3Qa7yFPtl3zpiDlcleNWoo4m+Ip9WkhqapyC0DMx1DX4c//bbhhLtDAWYHz1XMOooBbyiFk+m8fd7EgdwPp2eT9DZ8GiHmkVFxNfS4sHO4EnSgL3eBTTFBAIjdZr87aTMwPl6DmrqxKEeS1EtLr3arTfdxqmu1efrvY5yTFWe65IFqAAZXxfz+lQjI88+mXlbMAR9PbzX4oMW9y3oi/ZGoHJfd/+hSHUNmrRhOPdIbMEh2Q8kOUyhGxUhm6d/0lZ2k9Wf6zTJzBTnQpW0D5Xz3vSSobl9GypY0Em3zrS6SS/KPIm9a2uXLtTmEm6NJ0Yr+Zsb0BSIOdyBoErVb5fJ2Cth24vlhsg7WkA038W+4 X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(376002)(39860400002)(346002)(396003)(136003)(451199015)(40470700004)(46966006)(36840700001)(36860700001)(82310400005)(478600001)(186003)(16526019)(40480700001)(82740400003)(336012)(2616005)(36756003)(426003)(1076003)(8676002)(41300700001)(356005)(40460700003)(70206006)(4326008)(81166007)(70586007)(6666004)(2906002)(47076005)(8936002)(26005)(316002)(110136005)(7696005)(5660300002)(86362001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2022 10:27:46.3963 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b228da9e-27d5-4e9b-a802-08daa072eb8e X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT006.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7587 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Based on num_hid_devices, each sensor device registers to HID. If "no sensors" then amd_sfh work initialization and scheduling doesn’t make sense and return ENODEV to stop driver probe. Hence add a check for num_hid_devices to handle special case in the situation of "no sensors" for SFH1.1. Fixes: 93ce5e0231d7 ("HID: amd_sfh: Implement SFH1.1 functionality") Signed-off-by: Basavaraj Natikar --- drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c b/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c index d840efb4a2e2..4da2f9f62aba 100644 --- a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c +++ b/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c @@ -110,6 +110,8 @@ static int amd_sfh1_1_hid_client_init(struct amd_mp2_dev *privdata) amd_sfh1_1_set_desc_ops(mp2_ops); cl_data->num_hid_devices = amd_sfh_get_sensor_num(privdata, &cl_data->sensor_idx[0]); + if (cl_data->num_hid_devices == 0) + return -ENODEV; INIT_DELAYED_WORK(&cl_data->work, amd_sfh_work); INIT_DELAYED_WORK(&cl_data->work_buffer, amd_sfh_work_buffer);