Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp812666ybf; Wed, 26 Feb 2020 23:53:45 -0800 (PST) X-Google-Smtp-Source: APXvYqy/rnivbHkTK0eWNBv/1WGWHDkXUTHb3NOcGlOvcY/cRjEvEYpxtSFIUXdFAoiYkdejSXYI X-Received: by 2002:a9d:7a81:: with SMTP id l1mr2242712otn.26.1582790025489; Wed, 26 Feb 2020 23:53:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582790025; cv=none; d=google.com; s=arc-20160816; b=YnS5iMPobVmJsoPVY/HJXCUg77ls6ib7sVPYn2/1wVLO+2lg5xjcguAp/K8eG5pHOM TB4E1mpqWk8+TlcUsfxH2DX0KXUjDvi44Z8vCb2OYEVfYtAHipueOL1s7V13agQpMbO8 X++Jw+JXkjFwdCXQtakB1IDWWzoBR3gBvMA+0YN7CMjr9w1vYnamrSeLGNfZu5e32T9N Z6WO9er+3u5SPYq7A/euW8uN5OKcZnVAi5fC/I5U8zObnnAfk/syCWPgFNzRNWoXVpcQ wrs0NmYpEsQRIJV+EQvkNkCBBBJRlfq6MuNINqhdBeC35D36m3wRLBN4LCxPHwQlcV5v LIKw== 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=nZ9IW1DZajvl496WibOegYB0yGwH/OAyjpEtdUaX7T4=; b=BBhBXdfcDSku6FinyWVw9M0oZeWNVxujo2vafkReKR6/Fv1rKuMLeDYJf1q+AnZZXD TvcxuH3rV2myA4xlkurxub7p286Wm89pXH2VT2i8Xlv+BwAFRvhfZvsjZrG6hDMW2FwA EWG51bPIrLdowQR7P5Zh9Uj0s8ETygn8RmMW2r9qQOg+ILhJawcptX/Q3zbbhZ/ARo/6 n4mAE6kjAz/EaIFk19JESjL/EtYQeCGZTcA5gXE3hSwft/lAOtfn38LTWW5SJZMBU9P7 i7irIKHKwIvIyqnuuI57qV3dYdmR7FngGSULBxdCsDfLgvfcZrEmyvCS6I8ZOqL0bXMS dEzg== 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 h7si1046479otm.165.2020.02.26.23.53.34; Wed, 26 Feb 2020 23:53:45 -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 S1728443AbgB0HwS (ORCPT + 99 others); Thu, 27 Feb 2020 02:52:18 -0500 Received: from mga06.intel.com ([134.134.136.31]:44578 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728389AbgB0HwR (ORCPT ); Thu, 27 Feb 2020 02:52:17 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Feb 2020 23:52:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,491,1574150400"; d="scan'208";a="241965935" Received: from linux.intel.com ([10.54.29.200]) by orsmga006.jf.intel.com with ESMTP; 26 Feb 2020 23:52:17 -0800 Received: from [10.226.39.43] (unknown [10.226.39.43]) by linux.intel.com (Postfix) with ESMTP id B8CFA580544; Wed, 26 Feb 2020 23:52:14 -0800 (PST) Subject: Re: [PATCH v3 3/3] phy: intel: Add driver support for Combophy To: Andy Shevchenko Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, kishon@ti.com, robh@kernel.org, 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> From: Dilip Kota Message-ID: <371e50f1-cab6-56f4-d12d-371d1b1f9c67@linux.intel.com> Date: Thu, 27 Feb 2020 15:52:13 +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: <20200226144147.GQ10400@smile.fi.intel.com> 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 Thanks Andy for reviewing and giving the inputs. I will update them as per your comments, but for couple of cases of i have a different opinion. Please check and give your inputs. On 2/26/2020 10:41 PM, Andy Shevchenko wrote: > On Wed, Feb 26, 2020 at 06:09:53PM +0800, Dilip Kota wrote: >> Combophy subsystem provides PHYs for various >> controllers like PCIe, SATA and EMAC. > Thanks for an update, my comments below. > > ... > >> +config PHY_INTEL_COMBO >> + bool "Intel Combo PHY driver" >> + depends on OF && HAS_IOMEM && (X86 || COMPILE_TEST) > I guess it would be better to have like this: > > depends on X86 || COMPILE_TEST > depends on OF && HAS_IOMEM > > But do you still have a dependency to OF? Yes, OF is not required. I will remove it. > >> + select MFD_SYSCON >> + select GENERIC_PHY >> + select REGMAP > ... > >> + * Copyright (C) 2019 Intel Corporation. > 2019-2020 My bad. I will update it. > > ... > ... >> +}; >> + >> +enum { >> + PHY_0, >> + PHY_1, >> + PHY_MAX_NUM, > But here we don't need it since it's a terminator line. > Ditto for the rest of enumerators with a terminator / max entry. Sure i will remove them. To be meaningful, i will remove the max entry for the enums representing the value of register bitfields. ... > ... > >> +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. > >> + struct fwnode_handle *fwnode, int idx) >> +{ >> + dev = get_dev_from_fwnode(fwnode); > I don't see where you drop reference count to the struct device object. I will add it. Thanks for pointing it. ... > ... > >> + 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. > > struct device *dev = cbphy->dev; > struct platform_device *pdev = to_platform_device(dev); > struct fwnode_handle *fwnode = dev_fwnode(dev); > struct fwnode_reference_args ref; > int i, ret; > u32 prop; > >> + pdev = to_platform_device(dev); > See above. > >> + fwnode = dev_fwnode(dev); > See above. > > Regards, Dilip