Thread (55 messages) 55 messages, 8 authors, 2025-05-29

Re: [PATCH v2 23/26] misc: lan966x_pci: Introduce board specific data

From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date: 2025-05-19 15:44:28
Also in: imx, linux-acpi, linux-clk, linux-devicetree, linux-i2c, linux-pci, linux-spi, lkml

On Mon, May 19, 2025 at 05:00:04PM +0200, Herve Codina wrote:
On Thu, 8 May 2025 22:21:41 +0300
Andy Shevchenko [off-list ref] wrote:
quoted
On Wed, May 07, 2025 at 09:13:05AM +0200, Herve Codina wrote:
...
quoted
quoted
 static struct pci_device_id lan966x_pci_ids[] = {
-	{ PCI_DEVICE(PCI_VENDOR_ID_EFAR, 0x9660) },
+	{ PCI_VDEVICE(EFAR, 0x9660), (kernel_ulong_t)&evb_lan9662_nic_info },  
PCI_DEVICE_DATA() ?
PCI_DEVICE_DATA() need the device ID defined using a #define in the form
PCI_DEVICE_ID_##vend##_##dev

PCI_VDEVICE() allows the device ID value passed as an integer in the same
way as for PCI_DEVICE().

Also, according to its kdoc, it allows the next field to follow as the
device private data.

IMHO, I think PCI_VDEVICE() use is correct here and I will keep it.
It's correct, no doubts, but using PCI_DEVICE_DATA() makes sense when you need
to supply driver_data. In particular it will take care of needed castings and
also as you noticed asks users to apply the regular pattern for PCI ID
definitions.

Moreover, the 0x9660 is used in two drivers and it's a good candidate to be in
pci_ids.h. (Note drivers/pci/quirks.c:6286)

-- 
With Best Regards,
Andy Shevchenko


Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help