Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp465485ybf; Fri, 28 Feb 2020 01:22:10 -0800 (PST) X-Google-Smtp-Source: APXvYqyB55tHY6S1aksDN+WfH7bnTWNyqus+/3ego3///xD/+X80CAe5/83LWVfNlkBAY2GD3VW+ X-Received: by 2002:aca:4e02:: with SMTP id c2mr2488475oib.142.1582881730677; Fri, 28 Feb 2020 01:22:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582881730; cv=none; d=google.com; s=arc-20160816; b=JN2KbgXpbOQHjRi3x/ywAlq+qKLMFMY4bTXsyNcAIBOasogAUJvLh4mO/eEpq5H7BO DX5AEZLqNgpzqZvdK1QG2R0qOMvgH9B2e8ldgaCHb2Lzb4KtAptKJnTIIJsbKCtkyppa nllB58ggkfJxz5/8OhZbeTLn8/kD9hBACrO10fec00uAdEOvLR1BwlCimSNZ9pMCogOg mUWbKv7lKlLh4z4xmafW0K//UIVyg/jn/nf1n6Eoe1deRuC5hE8wdeRuJnC/iRL79Yuf X0KoCz4ffeDo/vA0HZFdJyXe6pi92OylT1ZW9Alku9RHd6nGjEb4ED+xWe5YyibQ996c aO0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=JL6b9rx+X4Pds8wVCVz6O0zo0CKqx0qyRL70rNXVaJE=; b=xLScga56XRp3wprOH3+UHEMb6uvk/DZSE0Fcw3i/Blgez07e6iSM1vQvLjv70BjE6O eVEnL4HM+iDpAUAZy5nzzwkgv/AvKV/Q6A5RAX7DuUlv6t3Zd2mynGkOFpVbC+ZhpoFs zuUBdPQaLa4KPuSn5fclG+crYj8Xdu34sT9R7bgORC8JaphM8WYtL2yDCOnlNwK7ivk9 H7xNGtXuJxCY6Hz5+ZKvenMcBIoeOfwlNs59K2mAA/Ohrc20FRxzsjq1emnYAVDnbKe3 TsmuJajTTNveSR0ZnALdRKeeaOwPryFusgpnPVVAcUn2kwIOdeeMLF56rI2jnHqBNU6c pFxQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q3si627462oij.103.2020.02.28.01.21.58; Fri, 28 Feb 2020 01:22:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726738AbgB1JVD (ORCPT + 99 others); Fri, 28 Feb 2020 04:21:03 -0500 Received: from mga17.intel.com ([192.55.52.151]:48110 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726148AbgB1JVD (ORCPT ); Fri, 28 Feb 2020 04:21:03 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Feb 2020 01:21:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,495,1574150400"; d="scan'208";a="232182809" Received: from linux.intel.com ([10.54.29.200]) by orsmga008.jf.intel.com with ESMTP; 28 Feb 2020 01:21:02 -0800 Received: from [10.226.39.43] (unknown [10.226.39.43]) by linux.intel.com (Postfix) with ESMTP id 70C5A5805EA; Fri, 28 Feb 2020 01:20:59 -0800 (PST) Subject: Re: [PATCH v3 3/3] phy: intel: Add driver support for Combophy To: Andy Shevchenko Cc: Andy Shevchenko , Linux Kernel Mailing List , devicetree , Kishon Vijay Abraham I , Rob Herring , cheol.yong.kim@intel.com, chuanhua.lei@linux.intel.com, qi-ming.wu@intel.com, yixin.zhu@intel.com References: <48dbbe705a1f22fb9e088827ca0be149e8fbcd85.1582709320.git.eswara.kota@linux.intel.com> <20200226144147.GQ10400@smile.fi.intel.com> <371e50f1-cab6-56f4-d12d-371d1b1f9c67@linux.intel.com> From: Dilip Kota Message-ID: <8627eb55-e590-4295-a528-9d091fdbb4f1@linux.intel.com> Date: Fri, 28 Feb 2020 17:20:57 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/27/2020 5:43 PM, Andy Shevchenko wrote: > On Thu, Feb 27, 2020 at 9:54 AM Dilip Kota wrote: > ... >>>> +static int intel_cbphy_iphy_dt_parse(struct intel_combo_phy *cbphy, >>> dt -> fwnode >>> Ditto for other similar function names. >> Sure, it looks appropriate for intel_cbphy_iphy_dt_parse() -> >> intel_cbphy_iphy_fwnode_parse(). >> Whereas for intel_cbphy_dt_parse() i will keep it unchanged, because it >> is calling devm_*, devm_platform_*, fwnode_* APIs to traverse dt node. > How do you know that it will be DT node? > I can't say it from the function parameters: Is any of them takes of_node? Got it, All the functions are traversing through device only. I will change intel_cbphy_dt_parse() to intel_cbphy_fwnode_parse(). (PS: My intention is something different. As the function is fetching device tree node entries so kept is as *_dt_parse() ) > >>>> + struct fwnode_handle *fwnode, int idx) > ... > >>>> + struct fwnode_reference_args ref; >>>> + struct device *dev = cbphy->dev; >>>> + struct fwnode_handle *fwnode; >>>> + struct platform_device *pdev; >>>> + int i, ret; >>>> + u32 prop; >>> I guess the following would be better: >> In the v2 patch, for int i = 0 you mentioned to do initialization at the >> user, instead of doing at declaration. >> So i followed the same for "pdev" and "fwnode" which are being used >> after few lines of the code . It looked good in the perspective of code >> readability. > No, it is different. For the loop counter is better to have closer to > the loop, for the more global thingy like platform device it makes it > actually harder to find. > When you do assignments you have to think about the variable meaning > and scope. Scope is different for loop counter versus the mentioned > rest. Understand. I will follow the same and keep a note for future drivers too. Thanks for detail explanation. Regards, Dilip >> .