From patchwork Mon Oct 16 10:16:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neha Malcom Francis X-Patchwork-Id: 13422932 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D9705CDB465 for ; Mon, 16 Oct 2023 10:16:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=vuImnAkDsSbFMlrknXodTWyf6mMXVjpoB1KaoRPd80g=; b=xkI/OPR4G1Yqez NukE5JCMlUC57uV04D29yng49MLB4/QWIW6z6fdHt2dGobc3iDlAAUjO5PyVPthmetXtVXLcNTm6M rQEDZv8/gIBC0UWq2ApYTJYaT87hfGbSRLBeD1WBAJmO/oENV2gsHvlwc2BcTd12wne46a7tbpz5U Y5tYFPKnh2s115Au1UNiL8lVnJxs6ZNMBYoc+FlrhCDF92t05yGQSRiieWOXkEJ6DpNqdxJeWZU70 e3wgbMuE04IL/P0hXyz9566HoaqVoyKC9xtWVLb+7k+AjOY0OlDHc1M7fuv+OUGOUUjXE6ulXv4mT Fo+jv18WPB36tB2MwM8g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qsKeB-009944-1Z; Mon, 16 Oct 2023 10:16:27 +0000 Received: from fllv0015.ext.ti.com ([198.47.19.141]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qsKe5-0098yh-0l for linux-arm-kernel@lists.infradead.org; Mon, 16 Oct 2023 10:16:24 +0000 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 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231016_031621_313355_4C5E592A X-CRM114-Status: GOOD ( 11.60 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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; }