Re: [PATCH v3 5/6] stmmac: pci: Use dmi_system_id table for retrieving PHY addresses

From: Andy Shevchenko
Date: Wed May 31 2017 - 14:09:51 EST


On Tue, May 30, 2017 at 10:33 AM, Jan Kiszka <jan.kiszka@xxxxxxxxxxx> wrote:
> Avoids reimplementation of DMI matching in stmmac_pci_find_phy_addr.

> struct stmmac_pci_dmi_data {
> - const char *name;
> - const char *asset_tag;
> - unsigned int func;
> + int func;
> int phy_addr;
> };

Can we use the following instead:

struct stmmac_pci_dmi_data {
unsigned int *func;
int *phy_addr;
size_t nfuncs;
};

or something like

struct stmmac_pci_func_data {
unsigned int func;
int phy_addr;
};

struct stmmac_pci_dmi_data {
struct stmmac_pci_func_data *func;
size_t nfuncs;
};

(Latter would be better since it allows to use ARRAY_SIZE() and less
error prone for possible asymmetrical amount of values in the former)

?

--
With Best Regards,
Andy Shevchenko