Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759967AbcCDVSI (ORCPT ); Fri, 4 Mar 2016 16:18:08 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:62909 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757489AbcCDVSE (ORCPT ); Fri, 4 Mar 2016 16:18:04 -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 6/6] add TC G210 pci driver Date: Fri, 04 Mar 2016 22:17:34 +0100 Message-ID: <1920822.ETZj8qFg72@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <3602f942ffc8673942f4944f77a8a9d2c805c847.1457111366.git.jpinto@synopsys.com> References: <3602f942ffc8673942f4944f77a8a9d2c805c847.1457111366.git.jpinto@synopsys.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:rLvdZzfEI+TrHWV6tHx9ex6NNNaeFg6b9KUxRt4TfodRhWeyNtu Q1bhFFXaaMoRhAkDdw4T6MKNFL2GRGdF8Tiffqau6H7tZlBiiDpgPTfyHiNHyodGBxz/e+h UItm05whJmI0xGxihWAr+7Qq5PQQx/j7WZof5Rn6dbsyplyvIJQ/BtmB5sUCorcE/ExR8/q E/5+VHX0rMVyzPZL4P/vA== X-UI-Out-Filterresults: notjunk:1;V01:K0:2ecvo9MEmxI=:zOp/T2tkOhvfLDhxwWh1CO FCioXMlpDMtOH+CqzO2ffnc/a+1JTJJY1MaxK/nTHGHh1DUCywQwcKKnXZA3ts+UddXSBMYMu VK7BVPiwDeHx5AMiwO/+XQcAzglFUdmbDYgdfzRALrZQOtqdLgrIKFDMaiPJQ/lcwvx/5djJQ g1NYPP5pugz8w/BhM0GGLgLYRucAJ6LsehIxJSvt9h6cXXuA4NLJmdiuTKZns4BdSSijOZWoF mXEuHGAT4H/+GpfvUw5vKn6nTyUsdEfTxWceZrrPvgNNZGXO1PDhmoIulSga7Tpt/lg61d2Zw HEBsRFyRFZliZJRuZoQX02oXPU0uw4kKAps5LkSjvFkj9ZEcP+IWGP6kPspYAK32pZu4uT+Ej 6Vs07mWyilKAhVa1rPb04GBGDbKulqydgEQ2XX3S97l6elswxbQZzGUUnaynUF2iCDQ1ygT7h gPSY5uPMRWSXAZ28G4dWPFCUIyRPEbptIvD4Jm3OFWwuJPBRzBHE6JYQM0eGfzGJ0rDe1c2ok fBGY5r96zGd9sJqmCxn7StGyBU2MLcH3v+sTIhQmRwk4Grmabh8ekWd8DVE66+39vKKeTMeyc EvZItZ7Ny/AsAJ8uJx4njlTT2P+JIMO+nDRp3V/U9kmuwPO7C3djaM+pguHLnYzYM8jb6e3xP DL84l9chVfWTS354IJB09ydEqfY9lPr8SP94OfWnmVYZhnOffiDCwJI+ysIqUMUphF3E8Ernq BriA8JDd5XDY21gk Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1459 Lines: 45 On Friday 04 March 2016 17:22:19 Joao Pinto wrote: > This patch adds a glue pci driver for the Synopsys G210 Test Chip. > > Signed-off-by: Joao Pinto Mostly ok, just a few suggestions: > + > +/* Test Chip type expected values */ > +#define TC_G210_20BIT 20 > +#define TC_G210_40BIT 40 > +#define TC_G210_DEFAULTBIT 40 > + > +static int tc_type = TC_G210_DEFAULTBIT; > +module_param(tc_type, int, 0); > +MODULE_PARM_DESC(tc_type, "Test Chip Type (20 = 20-bit, 40 = 40-bit)"); > What is the effect of setting the wrong one here? I was thinking it would be best to have the default be 'invalid' and then return an error from the probe() function when you neither value is set. > + > + /* Check Test Chip type and set the specific setup routine */ > + if (tc_type == TC_G210_20BIT) { > + tc_dwc_g210_pci_hba_vops.custom_phy_initialization = > + tc_dwc_g210_config_20_bit; > + } else if (tc_type == TC_G210_40BIT) { > + tc_dwc_g210_pci_hba_vops.custom_phy_initialization = > + tc_dwc_g210_config_40_bit; > + } As for the platform driver, I would define two separate structures here, and then mark the operations as 'const'. > +static const struct pci_device_id tc_dwc_g210_pci_tbl[] = { > + { PCI_VENDOR_ID_SYNOPSYS, 0xB101, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, > + { PCI_VENDOR_ID_SYNOPSYS, 0xB102, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, > + { } /* terminate list */ > +}; Is there any difference between these two IDs? Arnd