• MD Danish Anwar's avatar
    net: ti: icssg-prueth: Split out common object into module · a8ea8d53
    MD Danish Anwar authored
    icssg_prueth.c and icssg_prueth_sr1.c drivers use multiple common .c
    files. These common objects are getting added to multiple modules. As a
    result when both drivers are enabled in .config, below warning is seen.
    
    drivers/net/ethernet/ti/Makefile: icssg/icssg_common.o is added to multiple modules: icssg-prueth icssg-prueth-sr1
    drivers/net/ethernet/ti/Makefile: icssg/icssg_classifier.o is added to multiple modules: icssg-prueth icssg-prueth-sr1
    drivers/net/ethernet/ti/Makefile: icssg/icssg_config.o is added to multiple modules: icssg-prueth icssg-prueth-sr1
    drivers/net/ethernet/ti/Makefile: icssg/icssg_mii_cfg.o is added to multiple modules: icssg-prueth icssg-prueth-sr1
    drivers/net/ethernet/ti/Makefile: icssg/icssg_stats.o is added to multiple modules: icssg-prueth icssg-prueth-sr1
    drivers/net/ethernet/ti/Makefile: icssg/icssg_ethtool.o is added to multiple modules: icssg-prueth icssg-prueth-sr1
    
    Fix this by building a new module (icssg.o) for all the common objects.
    Both the driver can then depend on this common module.
    
    Some APIs being exported have emac_ as the prefix which may result into
    confusion with other existing APIs with emac_ prefix, to avoid
    confusion, rename the APIs being exported with emac_ to icssg_ prefix.
    
    This also fixes below error seen when both drivers are built.
    ERROR: modpost: "icssg_queue_pop"
    [drivers/net/ethernet/ti/icssg-prueth-sr1.ko] undefined!
    ERROR: modpost: "icssg_queue_push"
    [drivers/net/ethernet/ti/icssg-prueth-sr1.ko] undefined!
    Reported-and-tested-by: default avatarThorsten Leemhuis <linux@leemhuis.info>
    Closes: https://lore.kernel.org/oe-kbuild-all/202405182038.ncf1mL7Z-lkp@intel.com/
    Fixes: 487f7323 ("net: ti: icssg-prueth: Add helper functions to configure FDB")
    Reviewed-by: default avatarRoger Quadros <rogerq@kernel.org>
    Signed-off-by: default avatarMD Danish Anwar <danishanwar@ti.com>
    Reviewed-by: default avatarSai Krishna <saikrishnag@marvell.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    a8ea8d53
icssg_switchdev.c 12.1 KB