From mboxrd@z Thu Jan 1 00:00:00 1970 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 45104C77B7E for ; Thu, 27 Apr 2023 06:46:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243057AbjD0Gqd (ORCPT ); Thu, 27 Apr 2023 02:46:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229601AbjD0Gqb (ORCPT ); Thu, 27 Apr 2023 02:46:31 -0400 Received: from ex01.ufhost.com (ex01.ufhost.com [61.152.239.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB7821A6; Wed, 26 Apr 2023 23:46:29 -0700 (PDT) Received: from EXMBX165.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX165", Issuer "EXMBX165" (not verified)) by ex01.ufhost.com (Postfix) with ESMTP id 7851F24E28D; Thu, 27 Apr 2023 14:46:28 +0800 (CST) Received: from EXMBX162.cuchost.com (172.16.6.72) by EXMBX165.cuchost.com (172.16.6.75) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Thu, 27 Apr 2023 14:46:28 +0800 Received: from [192.168.120.42] (171.223.208.138) by EXMBX162.cuchost.com (172.16.6.72) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Thu, 27 Apr 2023 14:46:27 +0800 Message-ID: <988e7ff1-ef0e-6224-98fb-e3d564806477@starfivetech.com> Date: Thu, 27 Apr 2023 14:46:26 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH v1 2/2] net: phy: motorcomm: Add pad drive strength cfg support Content-Language: en-US To: Andrew Lunn , Frank Sae CC: , , , Peter Geis , "David S . Miller" , Eric Dumazet , "Jakub Kicinski" , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Heiner Kallweit , Russell King , Yanhong Wang References: <20230426063541.15378-1-samin.guo@starfivetech.com> <20230426063541.15378-3-samin.guo@starfivetech.com> <11f0641a-ef6c-eee8-79f3-45654ae006d5@motor-comm.com> <4c935728-ab18-4941-9621-c26e3b3799f7@lunn.ch> From: Guo Samin In-Reply-To: <4c935728-ab18-4941-9621-c26e3b3799f7@lunn.ch> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [171.223.208.138] X-ClientProxiedBy: EXCAS066.cuchost.com (172.16.6.26) To EXMBX162.cuchost.com (172.16.6.72) X-YovoleRuleAgent: yovoleflag Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Re: [PATCH v1 2/2] net: phy: motorcomm: Add pad drive strength cfg support From: Andrew Lunn to: Frank Sae data: 2023/4/26 >>> + u32 val; >>> >>> ret = ytphy_rgmii_clk_delay_config_with_lock(phydev); >>> if (ret < 0) >>> @@ -1518,6 +1524,32 @@ static int yt8531_config_init(struct phy_device *phydev) >>> return ret; >>> } >>> >>> + if (!of_property_read_u32(node, "rx-clk-driver-strength", &val)) { >> >> Please check the val of "val", add the handle of default value. > > You can assign val to 3, or better still some #define, before calling > of_property_read_u32(). If the property is not found, val will retain > that value, and you can then write it to the register. > > But please do add range checks for when val is in DT. We don't want > anybody using 42. -EINVAL should be returned. > > Andrew Thanks, good advice. Best regards, Samin