Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759987AbcCDVNU (ORCPT ); Fri, 4 Mar 2016 16:13:20 -0500 Received: from mout.kundenserver.de ([212.227.126.135]:58288 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758765AbcCDVNS (ORCPT ); Fri, 4 Mar 2016 16:13:18 -0500 From: Arnd Bergmann To: Joao Pinto Cc: vinholikatti@gmail.com, julian.calaby@gmail.com, akinobu.mita@gmail.com, hch@infradead.org, mark.rutland@arm.com, gbroner@codeaurora.org, subhashj@codeaurora.org, CARLOS.PALMINHA@synopsys.com, ijc+devicetree@hellion.org.uk, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH v10 5/6] add TC G210 platform driver Date: Fri, 04 Mar 2016 22:12:45 +0100 Message-ID: <2253265.cRVI7LPIKe@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:/aTtZR3GY41JOAiCsuYY20Kms7fnXuKTmv5PxsvIEcgTaxpy2pb A715bLk3aYaE6s5VUqMoc7XGFEfkcb3wzO4pEs1D3sSjHky+8OAdzABfTX0Fmi0lOxyf4Ct m3Cko3wCPd4qDMphWQBZADBfi9MJsdsBtD74MlJ82dKJdAur2BJB6L33wWR+lmP5c3YVKie 1HBxp840daIvJHlGu/7Ag== X-UI-Out-Filterresults: notjunk:1;V01:K0:Dj+uds4iKeM=:YDHLZbgifOvH6urxl9YIPB VScucYx+uRuR62HTq2fFxNesyEv3PkXkJNoGFAdOm5Exs28XZ/DY9KgH2gWYaH73wCwDvHT62 0/d+ZidkSWIJqVauA7GwCSLJSj9fX0NQjHVGJPPjAyCstXiWSWnx0+Mt/+3CCVOXZ4y6hnDZp +1E1LTZ05h/6VbRwya1tKfbsMyDwRwI639vVIzC0uuvvBGBSHpyuesMWa0KVx94HSpHT1bIrd t2aN/7kDvNkmwW9wO8hZ4kg6Xrxd44PkeixtywosfsJRU1KvrikQeJsU9/Gi7A+Yt1xb1Qnmg UvCNqO+oKtC0pWaxirRbYBBnZIR5tl4fwY1x5+WOusnwsRnk7TCFvPfgXW3RXVRGUXLeerK07 hkLtQE7aHuupkWpk8KGPcHJzyxBjuOZeicGfDbfMxtrs3lriBQdKZgIk965j1s/14ILuIvFHo Jl1kbFApZtqw7SnbVmPrMkQgkjqrTBpuD+N/OemLfHptIq+jj+xSuxuhMiL1xQ3PRqaSdZazA hIB5iB88LfXM9ve4qc9Vtk97VatXCrbTMdQryQGpyhJ8PUWBoclL9yJUfMGgKG1bbOvGVOwgL nrhxrk/6WWjp/xKKANp+T8ozG/PV6AW/CuZBGJUXwFXdoM68hpYCnFxFyVucjbT6dG98won8S 6cTT88yk1eJzxrPffEBtMPQfdD7TREbRQRWf3c77YgtE+2M6L8Zvl+/eJ1WS9tAu7hn2Uacdw 9ql/lHm7j9XnDMc4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1371 Lines: 40 On Friday 04 March 2016 17:22:18 Joao Pinto wrote: > This patch adds a glue platform driver for the Synopsys G210 Test Chip. > > Signed-off-by: Joao Pinto Looks basically ok, but I think it can be simplified a little: > +/** > + * struct ufs_hba_dwc_vops - UFS DWC specific variant operations > + */ > +static struct ufs_hba_variant_ops tc_dwc_g210_pltfm_hba_vops = { > + .name = "tc-dwc-g210-pltfm", > + .link_startup_notify = ufshcd_dwc_link_startup_notify, > +}; > + > +/** > + * tc_dwc_g210_pltfm_probe() > + * @pdev: pointer to platform device structure > + * > + */ > +static int tc_dwc_g210_pltfm_probe(struct platform_device *pdev) > +{ > + int err; > + struct device *dev = &pdev->dev; > + struct device_node *np = dev->of_node; > + > + /* Check Test Chip type and set the specific setup routine */ > + if (of_device_is_compatible(np, "snps, g210-tc-6.00-20bit")) { > + tc_dwc_g210_pltfm_hba_vops.custom_phy_initialization = > + tc_dwc_g210_config_20_bit; > + } else if (of_device_is_compatible(np, "snps, g210-tc-6.00-40bit")) { > + tc_dwc_g210_pltfm_hba_vops.custom_phy_initialization = > + tc_dwc_g210_config_40_bit; > + } Instead of manually checking the compatible string, define two copies of the ufs_hba_variant_ops, and put a pointer to them into the .data field of tc_dwc_g210_pltfm_match. Arnd