Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

dpaa2: avoid linking objects into multiple modules

Each object file contains information about which module it gets linked
into, so linking the same file into multiple modules now causes a warning:

scripts/Makefile.build:254: drivers/net/ethernet/freescale/dpaa2/Makefile: dpaa2-mac.o is added to multiple modules: fsl-dpaa2-eth fsl-dpaa2-switch
scripts/Makefile.build:254: drivers/net/ethernet/freescale/dpaa2/Makefile: dpmac.o is added to multiple modules: fsl-dpaa2-eth fsl-dpaa2-switch

Change the way that dpaa2 is built by moving the two common files into a
separate module with exported symbols instead.

Tested-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://patch.msgid.link/20260402184726.3746487-3-arnd@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Arnd Bergmann and committed by
Jakub Kicinski
ede3136e df75bd55

+21 -4
+5 -4
drivers/net/ethernet/freescale/dpaa2/Makefile
··· 3 3 # Makefile for the Freescale DPAA2 Ethernet controller 4 4 # 5 5 6 - obj-$(CONFIG_FSL_DPAA2_ETH) += fsl-dpaa2-eth.o 6 + obj-$(CONFIG_FSL_DPAA2_ETH) += fsl-dpaa2-eth.o fsl-dpaa2-mac.o 7 7 obj-$(CONFIG_FSL_DPAA2_PTP_CLOCK) += fsl-dpaa2-ptp.o 8 - obj-$(CONFIG_FSL_DPAA2_SWITCH) += fsl-dpaa2-switch.o 8 + obj-$(CONFIG_FSL_DPAA2_SWITCH) += fsl-dpaa2-switch.o fsl-dpaa2-mac.o 9 9 10 - fsl-dpaa2-eth-objs := dpaa2-eth.o dpaa2-ethtool.o dpni.o dpaa2-mac.o dpmac.o dpaa2-eth-devlink.o dpaa2-xsk.o 10 + fsl-dpaa2-eth-objs := dpaa2-eth.o dpaa2-ethtool.o dpni.o dpaa2-eth-devlink.o dpaa2-xsk.o 11 11 fsl-dpaa2-eth-${CONFIG_FSL_DPAA2_ETH_DCB} += dpaa2-eth-dcb.o 12 12 fsl-dpaa2-eth-${CONFIG_DEBUG_FS} += dpaa2-eth-debugfs.o 13 13 fsl-dpaa2-ptp-objs := dpaa2-ptp.o dprtc.o 14 - fsl-dpaa2-switch-objs := dpaa2-switch.o dpaa2-switch-ethtool.o dpsw.o dpaa2-switch-flower.o dpaa2-mac.o dpmac.o 14 + fsl-dpaa2-switch-objs := dpaa2-switch.o dpaa2-switch-ethtool.o dpsw.o dpaa2-switch-flower.o 15 + fsl-dpaa2-mac-objs += dpaa2-mac.o dpmac.o 15 16 16 17 # Needed by the tracing framework 17 18 CFLAGS_dpaa2-eth.o := -I$(src)
+16
drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
··· 544 544 545 545 phylink_start(mac->phylink); 546 546 } 547 + EXPORT_SYMBOL_GPL(dpaa2_mac_start); 547 548 548 549 void dpaa2_mac_stop(struct dpaa2_mac *mac) 549 550 { ··· 555 554 if (mac->serdes_phy) 556 555 phy_power_off(mac->serdes_phy); 557 556 } 557 + EXPORT_SYMBOL_GPL(dpaa2_mac_stop); 558 558 559 559 int dpaa2_mac_connect(struct dpaa2_mac *mac) 560 560 { ··· 648 646 649 647 return err; 650 648 } 649 + EXPORT_SYMBOL_GPL(dpaa2_mac_connect); 651 650 652 651 void dpaa2_mac_disconnect(struct dpaa2_mac *mac) 653 652 { ··· 661 658 of_phy_put(mac->serdes_phy); 662 659 mac->serdes_phy = NULL; 663 660 } 661 + EXPORT_SYMBOL_GPL(dpaa2_mac_disconnect); 664 662 665 663 int dpaa2_mac_open(struct dpaa2_mac *mac) 666 664 { ··· 733 729 dpmac_close(mac->mc_io, 0, dpmac_dev->mc_handle); 734 730 return err; 735 731 } 732 + EXPORT_SYMBOL_GPL(dpaa2_mac_open); 736 733 737 734 void dpaa2_mac_close(struct dpaa2_mac *mac) 738 735 { ··· 758 753 if (mac->fw_node) 759 754 fwnode_handle_put(mac->fw_node); 760 755 } 756 + EXPORT_SYMBOL_GPL(dpaa2_mac_close); 761 757 762 758 static void dpaa2_mac_transfer_stats(const struct dpmac_counter *counters, 763 759 size_t num_counters, void *s, ··· 830 824 831 825 *ranges = dpaa2_mac_rmon_ranges; 832 826 } 827 + EXPORT_SYMBOL_GPL(dpaa2_mac_get_rmon_stats); 833 828 834 829 void dpaa2_mac_get_pause_stats(struct dpaa2_mac *mac, 835 830 struct ethtool_pause_stats *s) ··· 842 835 DPAA2_MAC_NUM_PAUSE_STATS, 843 836 dpaa2_mac_pause_stats, s); 844 837 } 838 + EXPORT_SYMBOL_GPL(dpaa2_mac_get_pause_stats); 845 839 846 840 void dpaa2_mac_get_ctrl_stats(struct dpaa2_mac *mac, 847 841 struct ethtool_eth_ctrl_stats *s) ··· 854 846 DPAA2_MAC_NUM_ETH_CTRL_STATS, 855 847 dpaa2_mac_eth_ctrl_stats, s); 856 848 } 849 + EXPORT_SYMBOL_GPL(dpaa2_mac_get_ctrl_stats); 857 850 858 851 void dpaa2_mac_get_eth_mac_stats(struct dpaa2_mac *mac, 859 852 struct ethtool_eth_mac_stats *s) ··· 866 857 DPAA2_MAC_NUM_ETH_MAC_STATS, 867 858 dpaa2_mac_eth_mac_stats, s); 868 859 } 860 + EXPORT_SYMBOL_GPL(dpaa2_mac_get_eth_mac_stats); 869 861 870 862 int dpaa2_mac_get_sset_count(void) 871 863 { 872 864 return DPAA2_MAC_NUM_ETHTOOL_STATS; 873 865 } 866 + EXPORT_SYMBOL_GPL(dpaa2_mac_get_sset_count); 874 867 875 868 void dpaa2_mac_get_strings(u8 **data) 876 869 { ··· 881 870 for (i = 0; i < DPAA2_MAC_NUM_ETHTOOL_STATS; i++) 882 871 ethtool_puts(data, dpaa2_mac_ethtool_stats[i].name); 883 872 } 873 + EXPORT_SYMBOL_GPL(dpaa2_mac_get_strings); 884 874 885 875 void dpaa2_mac_get_ethtool_stats(struct dpaa2_mac *mac, u64 *data) 886 876 { ··· 933 921 *(data + i) = value; 934 922 } 935 923 } 924 + EXPORT_SYMBOL_GPL(dpaa2_mac_get_ethtool_stats); 925 + 926 + MODULE_LICENSE("GPL"); 927 + MODULE_DESCRIPTION("DPAA2 Ethernet MAC library");