Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1350596

Re: [PATCH v10 6/6] add TC G210 pci driver

From Arnd Bergmann <arnd@arndb.de>
Newsgroups linux.kernel
Subject Re: [PATCH v10 6/6] add TC G210 pci driver
Date 2016-03-04 22:20 +0100
Message-ID <r95iF-4rf-9@gated-at.bofh.it> (permalink)
References <r91I5-1ID-7@gated-at.bofh.it> <r91I6-1ID-33@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 <jpinto@synopsys.com>

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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v10 0/6] add support for DWC UFS Controller Joao Pinto <Joao.Pinto@synopsys.com> - 2016-03-04 18:30 +0100
  [PATCH v10 5/6] add TC G210 platform driver Joao Pinto <Joao.Pinto@synopsys.com> - 2016-03-04 18:30 +0100
    Re: [PATCH v10 5/6] add TC G210 platform driver Arnd Bergmann <arnd@arndb.de> - 2016-03-04 22:20 +0100
      Re: [PATCH v10 5/6] add TC G210 platform driver Joao Pinto <Joao.Pinto@synopsys.com> - 2016-03-07 11:10 +0100
  [PATCH v10 4/6] added support for Synopsys G210 Test Chip Joao Pinto <Joao.Pinto@synopsys.com> - 2016-03-04 18:30 +0100
    Re: [PATCH v10 4/6] added support for Synopsys G210 Test Chip Arnd Bergmann <arnd@arndb.de> - 2016-03-04 22:20 +0100
  [PATCH v10 1/6] fixed typo in ufshcd-pltfrm Joao Pinto <Joao.Pinto@synopsys.com> - 2016-03-04 18:30 +0100
    Re: [PATCH v10 1/6] fixed typo in ufshcd-pltfrm Arnd Bergmann <arnd@arndb.de> - 2016-03-04 22:30 +0100
  [PATCH v10 6/6] add TC G210 pci driver Joao Pinto <Joao.Pinto@synopsys.com> - 2016-03-04 18:30 +0100
    Re: [PATCH v10 6/6] add TC G210 pci driver Arnd Bergmann <arnd@arndb.de> - 2016-03-04 22:20 +0100
      Re: [PATCH v10 6/6] add TC G210 pci driver Joao Pinto <Joao.Pinto@synopsys.com> - 2016-03-07 12:10 +0100
  [PATCH v11 5/6] add TC G210 platform driver Joao Pinto <Joao.Pinto@synopsys.com> - 2016-03-07 13:20 +0100
    Re: [PATCH v11 5/6] add TC G210 platform driver Rob Herring <robh@kernel.org> - 2016-03-17 16:00 +0100
  [PATCH v11 6/6] add-TC-G210-pci-driver Joao Pinto <Joao.Pinto@synopsys.com> - 2016-03-07 13:20 +0100

csiph-web