Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2397462rdg; Mon, 16 Oct 2023 03:17:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHDSf7KyBIbPBhxAsYv0yXgT3tA9a2TBd8CUzzKXHfBESH1Fp5OaLd75Xy/MXRnS881VEJ3 X-Received: by 2002:a17:902:9898:b0:1c9:b196:d294 with SMTP id s24-20020a170902989800b001c9b196d294mr15983150plp.20.1697451450491; Mon, 16 Oct 2023 03:17:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697451450; cv=none; d=google.com; s=arc-20160816; b=z+RZBFtU6othYo2XuOKr05Eo4SlT+ycR46yQ1JDjoIyS5cOy6xwkHYKKl/FGlSP1tE th9/3EWZnT/SxLhWy5njX9Ueg8Kw2Gu/tC3ldd6yAovWKccpWQzP9Ys+o07JWaDRlCsc siFedXg9/Sp/vTGJmN8KVthuBuGNGO38F/ywtrsglE8RkAGa+pL4mkBAIdsxIXh7sQN5 TcGuLvootc3W1cnKIFmNNT1KKBUotDUexK7inF3NrtnkREDEeiPLqXtdXmaGIZfPIvz5 JFWF0fvrvteeBZEiEmL1QfvtVyWXsqUXcRXlLAITAaHvdKkL4sBK1Ajn5Kyz3iZvdV3H JwWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=88rE/gvk3TLI1pA0SASlq4XLga9h1ZmVfZYQHMJX+90=; fh=zXIzpqU6fkcvkKYOWPETYAc8kHdGN5li0oSb9j2GXFE=; b=k64U3LZumcKt4gD5hVr0cvRc6F1UQBrJPW6n7eK3mg3ctcAt8HZFVyCDK+ttmmoHRE NHwwBuaU+R4GjiKAEIB4llYEbPrIlBN4+xrKVACKVnqaTYLzFgk+GJUYJ/9TNokFZTFw DjESmip8LLoNFpwUcnPwNNZWwECLw5lb+B9otZyvQQvwiTYh0nnkfBYyRdy39+5g1rsw oSc7RfPPbt2oSfZq62w3wRMzNER9TxUSGXlc0nySLF72nq42orqqYAyNAPlXusKDg1Fj qbDINdr84hmPjfbrtpxOWVPrIsJ6wlCm0s6rgiUGpQJBPuNyDSLYY/O/DYQkcVAp9XRv G2qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=hS412G+E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id y7-20020a17090322c700b001ca344f46efsi366206plg.330.2023.10.16.03.17.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 03:17:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=hS412G+E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 79E9B8051908; Mon, 16 Oct 2023 03:17:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233363AbjJPKRJ (ORCPT + 99 others); Mon, 16 Oct 2023 06:17:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233082AbjJPKQp (ORCPT ); Mon, 16 Oct 2023 06:16:45 -0400 Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3806E8 for ; Mon, 16 Oct 2023 03:16:24 -0700 (PDT) Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 39GAGHs2099117; Mon, 16 Oct 2023 05:16:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1697451377; bh=88rE/gvk3TLI1pA0SASlq4XLga9h1ZmVfZYQHMJX+90=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=hS412G+E7j7iNqklPP1RXxtBSwNA0j2NRQK8Wi4Wj1Wl/J/Rc7MTG82wEwXMTkTVF lk+0qxro8gnN5nEctayAAvlD+sPAKX1LFIDSzJnl+Je9wj7xPAOcncQpYMfgiNZJRC SpAy1I9VNh+JaloxVQY+J29zF2PttU/eiv5pSphY= Received: from DFLE100.ent.ti.com (dfle100.ent.ti.com [10.64.6.21]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 39GAGHjR029751 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 16 Oct 2023 05:16:17 -0500 Received: from DFLE107.ent.ti.com (10.64.6.28) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Mon, 16 Oct 2023 05:16:17 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE107.ent.ti.com (10.64.6.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Mon, 16 Oct 2023 05:16:17 -0500 Received: from a0497641-HP-Z2-Tower-G9-Workstation-Desktop-PC.dhcp.ti.com (ileaxei01-snat.itg.ti.com [10.180.69.5]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 39GAG90h033447; Mon, 16 Oct 2023 05:16:15 -0500 From: Neha Malcom Francis To: , , CC: , , , Subject: [PATCH v3 2/3] soc: ti: k3-socinfo: Avoid overriding ret Date: Mon, 16 Oct 2023 15:46:07 +0530 Message-ID: <20231016101608.993921-3-n-francis@ti.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231016101608.993921-1-n-francis@ti.com> References: <20231016101608.993921-1-n-francis@ti.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 16 Oct 2023 03:17:25 -0700 (PDT) Avoid overriding the return value and make sure the right error code is reflected. Here, if the partno is none of the identified partnos present in k3_soc_ids[], return -ENODEV. Signed-off-by: Neha Malcom Francis --- Changes since v2: - new patch drivers/soc/ti/k3-socinfo.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/soc/ti/k3-socinfo.c b/drivers/soc/ti/k3-socinfo.c index d45f5cb955a6..7fc3548e084c 100644 --- a/drivers/soc/ti/k3-socinfo.c +++ b/drivers/soc/ti/k3-socinfo.c @@ -60,7 +60,7 @@ k3_chipinfo_partno_to_names(unsigned int partno, return 0; } - return -EINVAL; + return -ENODEV; } static int k3_chipinfo_probe(struct platform_device *pdev) @@ -111,8 +111,7 @@ static int k3_chipinfo_probe(struct platform_device *pdev) ret = k3_chipinfo_partno_to_names(partno_id, soc_dev_attr); if (ret) { - dev_err(dev, "Unknown SoC JTAGID[0x%08X]\n", jtag_id); - ret = -ENODEV; + dev_err(dev, "Unknown SoC JTAGID[0x%08X]: %d\n", jtag_id, ret); goto err_free_rev; } -- 2.34.1