Message ID | b078687371ec7e740e3a630aedd3e76ecfdc1078.1712917541.git.siyanteng@loongson.cn (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | stmmac: Add Loongson platform support | expand |
On Fri, 12 Apr 2024 19:28:08 +0800 Yanteng Si wrote: > Just use PCI_DEVICE_DATA() macro for device identification, > No changes to function functionality. > > Signed-off-by: Feiyang Chen <chenfeiyang@loongson.cn> > Signed-off-by: Yinggang Gu <guyinggang@loongson.cn> > Signed-off-by: Yanteng Si <siyanteng@loongson.cn> > --- > drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c > index 9e40c28d453a..995c9bd144e0 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c > @@ -213,7 +213,7 @@ static SIMPLE_DEV_PM_OPS(loongson_dwmac_pm_ops, loongson_dwmac_suspend, > loongson_dwmac_resume); > > static const struct pci_device_id loongson_dwmac_id_table[] = { > - { PCI_VDEVICE(LOONGSON, 0x7a03) }, > + { PCI_DEVICE_DATA(LOONGSON, GMAC, &loongson_gmac_pci_info) }, > {} > }; > MODULE_DEVICE_TABLE(pci, loongson_dwmac_id_table); In file included from ../drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c:6: ../include/linux/pci.h:1061:51: error: ‘PCI_DEVICE_ID_LOONGSON_GMAC’ undeclared here (not in a function); did you mean ‘PCI_DEVICE_ID_LOONGSON_HDA’? 1061 | .vendor = PCI_VENDOR_ID_##vend, .device = PCI_DEVICE_ID_##vend##_##dev, \ | ^~~~~~~~~~~~~~ ../drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c:216:11: note: in expansion of macro ‘PCI_DEVICE_DATA’ 216 | { PCI_DEVICE_DATA(LOONGSON, GMAC, &loongson_gmac_pci_info) }, | ^~~~~~~~~~~~~~~ ../drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c:216:44: error: ‘loongson_gmac_pci_info’ undeclared here (not in a function) 216 | { PCI_DEVICE_DATA(LOONGSON, GMAC, &loongson_gmac_pci_info) }, | ^~~~~~~~~~~~~~~~~~~~~~ ../include/linux/pci.h:1063:41: note: in definition of macro ‘PCI_DEVICE_DATA’ 1063 | .driver_data = (kernel_ulong_t)(data) | ^~~~
>> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c >> index 9e40c28d453a..995c9bd144e0 100644 >> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c >> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c >> @@ -213,7 +213,7 @@ static SIMPLE_DEV_PM_OPS(loongson_dwmac_pm_ops, loongson_dwmac_suspend, >> loongson_dwmac_resume); >> >> static const struct pci_device_id loongson_dwmac_id_table[] = { >> - { PCI_VDEVICE(LOONGSON, 0x7a03) }, >> + { PCI_DEVICE_DATA(LOONGSON, GMAC, &loongson_gmac_pci_info) }, >> {} >> }; >> MODULE_DEVICE_TABLE(pci, loongson_dwmac_id_table); > In file included from ../drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c:6: > ../include/linux/pci.h:1061:51: error: ‘PCI_DEVICE_ID_LOONGSON_GMAC’ undeclared here (not in a function); did you mean ‘PCI_DEVICE_ID_LOONGSON_HDA’? > 1061 | .vendor = PCI_VENDOR_ID_##vend, .device = PCI_DEVICE_ID_##vend##_##dev, \ > | ^~~~~~~~~~~~~~ > ../drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c:216:11: note: in expansion of macro ‘PCI_DEVICE_DATA’ > 216 | { PCI_DEVICE_DATA(LOONGSON, GMAC, &loongson_gmac_pci_info) }, > | ^~~~~~~~~~~~~~~ > ../drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c:216:44: error: ‘loongson_gmac_pci_info’ undeclared here (not in a function) > 216 | { PCI_DEVICE_DATA(LOONGSON, GMAC, &loongson_gmac_pci_info) }, > | ^~~~~~~~~~~~~~~~~~~~~~ > ../include/linux/pci.h:1063:41: note: in definition of macro ‘PCI_DEVICE_DATA’ > 1063 | .driver_data = (kernel_ulong_t)(data) > | ^~~~ Will be fixed in v12. Thanks, Yanteng
On Mon, Apr 15, 2024 at 10:21:39AM +0800, Yanteng Si wrote: > > > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c > > > index 9e40c28d453a..995c9bd144e0 100644 > > > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c > > > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c > > > @@ -213,7 +213,7 @@ static SIMPLE_DEV_PM_OPS(loongson_dwmac_pm_ops, loongson_dwmac_suspend, > > > loongson_dwmac_resume); > > > static const struct pci_device_id loongson_dwmac_id_table[] = { > > > - { PCI_VDEVICE(LOONGSON, 0x7a03) }, > > > + { PCI_DEVICE_DATA(LOONGSON, GMAC, &loongson_gmac_pci_info) }, > > > {} > > > }; > > > MODULE_DEVICE_TABLE(pci, loongson_dwmac_id_table); > > In file included from ../drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c:6: > > ../include/linux/pci.h:1061:51: error: ‘PCI_DEVICE_ID_LOONGSON_GMAC’ undeclared here (not in a function); did you mean ‘PCI_DEVICE_ID_LOONGSON_HDA’? > > 1061 | .vendor = PCI_VENDOR_ID_##vend, .device = PCI_DEVICE_ID_##vend##_##dev, \ > > | ^~~~~~~~~~~~~~ > > ../drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c:216:11: note: in expansion of macro ‘PCI_DEVICE_DATA’ > > 216 | { PCI_DEVICE_DATA(LOONGSON, GMAC, &loongson_gmac_pci_info) }, > > | ^~~~~~~~~~~~~~~ > > ../drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c:216:44: error: ‘loongson_gmac_pci_info’ undeclared here (not in a function) > > 216 | { PCI_DEVICE_DATA(LOONGSON, GMAC, &loongson_gmac_pci_info) }, > > | ^~~~~~~~~~~~~~~~~~~~~~ > > ../include/linux/pci.h:1063:41: note: in definition of macro ‘PCI_DEVICE_DATA’ > > 1063 | .driver_data = (kernel_ulong_t)(data) > > | ^~~~ > > Will be fixed in v12. Just move the PCI_DEVICE_ID_LOONGSON_GMAC macro definition from Patch 5/6 to this one. -Serge(y) > > > Thanks, > > Yanteng >
On Thu, Apr 18, 2024 at 02:14:17PM +0300, Serge Semin wrote: > On Mon, Apr 15, 2024 at 10:21:39AM +0800, Yanteng Si wrote: > > > > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c > > > > index 9e40c28d453a..995c9bd144e0 100644 > > > > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c > > > > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c > > > > @@ -213,7 +213,7 @@ static SIMPLE_DEV_PM_OPS(loongson_dwmac_pm_ops, loongson_dwmac_suspend, > > > > loongson_dwmac_resume); > > > > static const struct pci_device_id loongson_dwmac_id_table[] = { > > > > - { PCI_VDEVICE(LOONGSON, 0x7a03) }, > > > > + { PCI_DEVICE_DATA(LOONGSON, GMAC, &loongson_gmac_pci_info) }, > > > > {} > > > > }; > > > > MODULE_DEVICE_TABLE(pci, loongson_dwmac_id_table); > > > In file included from ../drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c:6: > > > ../include/linux/pci.h:1061:51: error: ‘PCI_DEVICE_ID_LOONGSON_GMAC’ undeclared here (not in a function); did you mean ‘PCI_DEVICE_ID_LOONGSON_HDA’? > > > 1061 | .vendor = PCI_VENDOR_ID_##vend, .device = PCI_DEVICE_ID_##vend##_##dev, \ > > > | ^~~~~~~~~~~~~~ > > > ../drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c:216:11: note: in expansion of macro ‘PCI_DEVICE_DATA’ > > > 216 | { PCI_DEVICE_DATA(LOONGSON, GMAC, &loongson_gmac_pci_info) }, > > > | ^~~~~~~~~~~~~~~ > > > ../drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c:216:44: error: ‘loongson_gmac_pci_info’ undeclared here (not in a function) > > > 216 | { PCI_DEVICE_DATA(LOONGSON, GMAC, &loongson_gmac_pci_info) }, > > > | ^~~~~~~~~~~~~~~~~~~~~~ > > > ../include/linux/pci.h:1063:41: note: in definition of macro ‘PCI_DEVICE_DATA’ > > > 1063 | .driver_data = (kernel_ulong_t)(data) > > > | ^~~~ > > > > > Will be fixed in v12. > > Just move the PCI_DEVICE_ID_LOONGSON_GMAC macro definition from Patch > 5/6 to this one. ... and of course pass NULL as the data-pointer to PCI_DEVICE_DATA(). -Serge(y) > > -Serge(y) > > > > > > > Thanks, > > > > Yanteng > >
在 2024/4/18 20:31, Serge Semin 写道: > On Thu, Apr 18, 2024 at 02:14:17PM +0300, Serge Semin wrote: >> On Mon, Apr 15, 2024 at 10:21:39AM +0800, Yanteng Si wrote: >>>>> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c >>>>> index 9e40c28d453a..995c9bd144e0 100644 >>>>> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c >>>>> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c >>>>> @@ -213,7 +213,7 @@ static SIMPLE_DEV_PM_OPS(loongson_dwmac_pm_ops, loongson_dwmac_suspend, >>>>> loongson_dwmac_resume); >>>>> static const struct pci_device_id loongson_dwmac_id_table[] = { >>>>> - { PCI_VDEVICE(LOONGSON, 0x7a03) }, >>>>> + { PCI_DEVICE_DATA(LOONGSON, GMAC, &loongson_gmac_pci_info) }, >>>>> {} >>>>> }; >>>>> MODULE_DEVICE_TABLE(pci, loongson_dwmac_id_table); >>>> In file included from ../drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c:6: >>>> ../include/linux/pci.h:1061:51: error: ‘PCI_DEVICE_ID_LOONGSON_GMAC’ undeclared here (not in a function); did you mean ‘PCI_DEVICE_ID_LOONGSON_HDA’? >>>> 1061 | .vendor = PCI_VENDOR_ID_##vend, .device = PCI_DEVICE_ID_##vend##_##dev, \ >>>> | ^~~~~~~~~~~~~~ >>>> ../drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c:216:11: note: in expansion of macro ‘PCI_DEVICE_DATA’ >>>> 216 | { PCI_DEVICE_DATA(LOONGSON, GMAC, &loongson_gmac_pci_info) }, >>>> | ^~~~~~~~~~~~~~~ >>>> ../drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c:216:44: error: ‘loongson_gmac_pci_info’ undeclared here (not in a function) >>>> 216 | { PCI_DEVICE_DATA(LOONGSON, GMAC, &loongson_gmac_pci_info) }, >>>> | ^~~~~~~~~~~~~~~~~~~~~~ >>>> ../include/linux/pci.h:1063:41: note: in definition of macro ‘PCI_DEVICE_DATA’ >>>> 1063 | .driver_data = (kernel_ulong_t)(data) >>>> | ^~~~ >>> Will be fixed in v12. >> Just move the PCI_DEVICE_ID_LOONGSON_GMAC macro definition from Patch >> 5/6 to this one. OK. > ... and of course pass NULL as the data-pointer to PCI_DEVICE_DATA(). OK. Thank you! Thanks, Yanteng
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c index 9e40c28d453a..995c9bd144e0 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c @@ -213,7 +213,7 @@ static SIMPLE_DEV_PM_OPS(loongson_dwmac_pm_ops, loongson_dwmac_suspend, loongson_dwmac_resume); static const struct pci_device_id loongson_dwmac_id_table[] = { - { PCI_VDEVICE(LOONGSON, 0x7a03) }, + { PCI_DEVICE_DATA(LOONGSON, GMAC, &loongson_gmac_pci_info) }, {} }; MODULE_DEVICE_TABLE(pci, loongson_dwmac_id_table);