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

From: Andy Shevchenko
Date: Sat May 27 2017 - 09:29:01 EST


On Fri, May 26, 2017 at 7:07 PM, 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 leave unsigned type here...

> -static struct stmmac_pci_dmi_data quark_pci_dmi_data[] = {
> +static const struct stmmac_pci_dmi_data galileo_stmmac_dmi_data[] = {

> + {-1, -1},
> +};

> +static const struct stmmac_pci_dmi_data iot2040_stmmac_dmi_data[] = {

> + {-1, -1},
> +};

...and avoid this not so standard terminators?

> + .matches = {
> + DMI_EXACT_MATCH(DMI_BOARD_NAME, "GalileoGen2"),
> + },

> + .driver_data = (void *)galileo_stmmac_dmi_data,

Can't be slightly better

.driver_data = &galileo_stmmac_dmi_data,

?

--
With Best Regards,
Andy Shevchenko