Re: [PATCH v2 2/6] stmmac: pci: Use stmmac_pci_info for all devices

From: Andy Shevchenko
Date: Sat May 27 2017 - 09:14:20 EST


On Fri, May 26, 2017 at 7:07 PM, Jan Kiszka <jan.kiszka@xxxxxxxxxxx> wrote:
> Make stmmac_default_data compatible with stmmac_pci_info.setup and use
> an info structure for all devices. This allows to make the probing more
> regular.


> +#define STMMAC_DEVICE(vendor_id, dev_id, info) { \
> + PCI_DEVICE(vendor_id, dev_id), \

Perhaps

#define STMMAC_DEVICE(_vid, _did, info) { \
PCI_DEVICE(PCI_VENDOR_ID_##_vid, _did), \

Or converting defines first to PCI_DEVICE_ID_*
and

#define STMMAC_DEVICE(_vid, _did, info) { \
PCI_DEVICE(PCI_VENDOR_ID_##_vid, PCI_DEVICE_ID_##_did),
\

which I like even better.

> + .driver_data = (kernel_ulong_t)&info \
> + }
> +
> static const struct pci_device_id stmmac_id_table[] = {
> - {PCI_DEVICE(STMMAC_VENDOR_ID, STMMAC_DEVICE_ID)},
> - {PCI_DEVICE(PCI_VENDOR_ID_STMICRO, PCI_DEVICE_ID_STMICRO_MAC)},
> - {PCI_VDEVICE(INTEL, STMMAC_QUARK_ID), (kernel_ulong_t)&quark_pci_info},
> + STMMAC_DEVICE(STMMAC_VENDOR_ID, STMMAC_DEVICE_ID, stmmac_pci_info),
> + STMMAC_DEVICE(PCI_VENDOR_ID_STMICRO, PCI_DEVICE_ID_STMICRO_MAC,
> + stmmac_pci_info),
> + STMMAC_DEVICE(PCI_VENDOR_ID_INTEL, STMMAC_QUARK_ID, quark_pci_info),

--
With Best Regards,
Andy Shevchenko