From patchwork Fri Sep 8 13:33:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 13377473 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6DAED63B0 for ; Fri, 8 Sep 2023 13:34:18 +0000 (UTC) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2040.outbound.protection.outlook.com [40.107.22.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50FA51BF5; Fri, 8 Sep 2023 06:34:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DqhNWsjEeTfxrn1jStt8dYj9eJyIVn97atz38MLNL5FBUSlZRQ5eR7PjJFpo0g3f3X5JrQ4Dpuy79r1rI15iCrYNu7zesnrKl0zV6/mOO2d9RPtbmHYnow0ZhyKJe4JYT2uhgM5cZ/STr1qoNtVCdWX9CQ0FGgcSothbkk0o7K+W+NVhvLqt4ej9CgvQryncL05a1NtbD5i9UBZ3ABd+QeOTzyH1+80xOsFio569EAqV6YxWlRyV7pJxXXP8epULK7KvkY720yWUWE+RGjjVQPU6L3wQyWP/YzAKOMAy/yhe/duzcwc1pCTvkMBTyWiXYh99yDUNaRTUt6rZ6BWtuQ== 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=ySJTRLEGqGbB3AVN1DuxY0Qnndm7K6rlK8U+gwGYmiU=; b=jPQSH4YHiEK75OkYlw9yPZmxg5uzr8WMA4bF5OYSBY9u1weEGw5o5TEsR7k+y4E7c/j6nqvXdmRjzJlhcxC2Zou5mEZZAxcI1RqxyFoW5jNJhkvFIrZl5Tpfn7um3sMjiVFI1N2uEDSmVfKqLBN3r42Xp01PiVsKsTvgQ3yWQUBRtcQgUa/S+IXaGD9pCmJikidd3F0vWrVUZi1Do0yky4dsMzDZhRnVPCcEgZyTJ1R98xJ0NSc3TmqCE4QtgVZTYxHEANcnBl8mcgGATvxAvAnt5cMLZTptifkDssS7TiKOiv7EdixIlEkSL2rdS1ufMV9L5WBfrVOuA5NceYTv8Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ySJTRLEGqGbB3AVN1DuxY0Qnndm7K6rlK8U+gwGYmiU=; b=RbrFflcdmJhOmSikz9mFDYwD9QkQT5X4eub9LMe3UeJc30cyYYOMSM6WWxKe1BsaqVVXljQH2MgKSyG37Z+7DHE6JkSp/rVVWU1/WzDDU7WbcrYVErNNS8UItNvCnZW3rF+2BltWmLUer85h8EoJi8QeRJew7pF7ih+FbPyLGdI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) by PAWPR04MB9718.eurprd04.prod.outlook.com (2603:10a6:102:381::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.34; Fri, 8 Sep 2023 13:34:05 +0000 Received: from AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::568a:57ee:35b5:e454]) by AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::568a:57ee:35b5:e454%3]) with mapi id 15.20.6745.034; Fri, 8 Sep 2023 13:34:05 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: Eric Dumazet , Jakub Kicinski , Paolo Abeni , "David S. Miller" , Xiaoliang Yang , Andrew Lunn , Florian Fainelli , Yanan Yang , linux-kernel@vger.kernel.org Subject: [PATCH net 2/5] net: dsa: sja1105: propagate exact error code from sja1105_dynamic_config_poll_valid() Date: Fri, 8 Sep 2023 16:33:49 +0300 Message-Id: <20230908133352.2007218-3-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230908133352.2007218-1-vladimir.oltean@nxp.com> References: <20230908133352.2007218-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: FR2P281CA0036.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:14::23) To AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6452:EE_|PAWPR04MB9718:EE_ X-MS-Office365-Filtering-Correlation-Id: bfddfd14-ac41-425e-aeb7-08dbb0704558 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lvd+oZA9MprYD3NHC3S6DVKi7sn+eEvrKdN4ytciunQChPFIif1M7jniAfM54TQObK9/oP3twNNqn+bkw5YZgCQuK3a6G4ZV6/mF89xxdTjayficnQr3OEup8C1baHGOYpiNWw9b/OHcNbiTTlnki/O44jJ7a6ouFfkt1gjGdJzD6PgBwK973MpArIJnmH5tDkSMqgDHkX3gs6eZNgEckTQVZc7TSdbBURr9N67wB+EzVoUWJSAyQtLtF3rP47WVTFtrhvU7uqqQVlfypHJBTGrSPV6WcOwdgWSy//C9wp+eZnDNCFL7V+wGGXyui3ZmFZLRoXNfpZ6p7gOxpQtgOJZ0pnW101hJ/47tIp+AOyKAODzggXV26C+G+Xryvh0F/8AgwbUrWezGkuIHRLeUTHx2tJ0R1ADN2CZA8Unt88qLwbPbqPzkwi37BCtZUlYKIhMSgmCo6i0rYQLsTOAF0rgq4oig0MWx/8eIuG+xH2YyOFNxYkovacmp7H6/oPEAGVSCnP5feAppDxw3JYJ20llxGmYbI6+dCmgShxREtEJKlpvw/eAmlIdfzXZ/GIiVpHJ5RoUE9M6IjsiAZgmOAm9xIEqhdZtu1fyhB4lxSro6V+crPeIYnhnCMtv5px1h X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB6452.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(396003)(366004)(346002)(39860400002)(376002)(1800799009)(186009)(451199024)(2906002)(38350700002)(38100700002)(36756003)(6506007)(41300700001)(6512007)(6486002)(52116002)(66556008)(54906003)(2616005)(66946007)(66476007)(6916009)(316002)(1076003)(86362001)(8676002)(8936002)(4326008)(6666004)(478600001)(5660300002)(26005)(83380400001)(44832011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: mm6nMtPIt8qqPTr7ooXrxWUuo1wPGXjLroiPhq4SqB/U2EuOz9F0j3WcNeKQy2Z53iU6WfSrJ412tYGAFpDyEEsrBevcBrAdNJUhXLNQSWKDINPm5sJ6WcOevYXqGj38SAGeCoiKlgJGrzUPLjJzmbUi2IqpPPKfaSHF5HY4avAf1DHVE4NxsRf86B+fsTupnMhjXbFp79suH3Fl5QCu+nEv8em4eZXLTopFVKb+6XtRc3LBT2rmWey8067NPPYutbbrZ028t5zkVEt+yzOGNEk70FL9Gg9FTzd3dj9UyW3KibE+Rn+ycI3apRIV17b3o8pWg6748ABIMao/ng6n3TtzXCQLUD+gJdjozTCBuEWN3b2/uU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Per5f4fOeURRXsf553lnKYCmIaCr7UVgW11BJn5YO8yy7gg1NKZTsZOCTIaSLUQI/CUffIWyn10mF4vvdls7oOaCYzmJMLs/pVunwQP674FS+KHcyWHJ7yxfSA4A8JlZiDyELuDl+hXkZ66hUGAiRvtYwEvc79Yko26fW7VhnIA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: bfddfd14-ac41-425e-aeb7-08dbb0704558 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6452.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2023 13:34:05.0650 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: pNOB4KaqnTlFsXR57DgYFHE7g6x4I/VJeeaKnZxdjEosVziz9xb29/VevFVkDcb/hOFZQ2uldoL3ZNqxZG8zHA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR04MB9718 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org Currently, sja1105_dynamic_config_wait_complete() returns either 0 or -ETIMEDOUT, because it just looks at the read_poll_timeout() return code. There will be future changes which move some more checks to sja1105_dynamic_config_poll_valid(). It is important that we propagate their exact return code (-ENOENT, -EINVAL), because callers of sja1105_dynamic_config_read() depend on them. Signed-off-by: Vladimir Oltean --- drivers/net/dsa/sja1105/sja1105_dynamic_config.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/net/dsa/sja1105/sja1105_dynamic_config.c b/drivers/net/dsa/sja1105/sja1105_dynamic_config.c index 7729d3f8b7f5..93d47dab8d3e 100644 --- a/drivers/net/dsa/sja1105/sja1105_dynamic_config.c +++ b/drivers/net/dsa/sja1105/sja1105_dynamic_config.c @@ -1211,13 +1211,14 @@ sja1105_dynamic_config_wait_complete(struct sja1105_private *priv, struct sja1105_dyn_cmd *cmd, const struct sja1105_dynamic_table_ops *ops) { - int rc; - - return read_poll_timeout(sja1105_dynamic_config_poll_valid, - rc, rc != -EAGAIN, - SJA1105_DYNAMIC_CONFIG_SLEEP_US, - SJA1105_DYNAMIC_CONFIG_TIMEOUT_US, - false, priv, cmd, ops); + int err, rc; + + err = read_poll_timeout(sja1105_dynamic_config_poll_valid, + rc, rc != -EAGAIN, + SJA1105_DYNAMIC_CONFIG_SLEEP_US, + SJA1105_DYNAMIC_CONFIG_TIMEOUT_US, + false, priv, cmd, ops); + return err < 0 ? err : rc; } /* Provides read access to the settings through the dynamic interface