Since the tsec driver supports both configurations with and without DM_ETH, and since the eth_ops :: set_promisc() method is only provided for DM_ETH, the implication is that builds with DM_ETH disabled will result in a 'defined but not used' warning.
To silence those, mark the function as __maybe_unused. Fixes: 79ba3435f43d ("net: tsec: add support for promiscuous mode") Reported-by: Ramon Fried <rfried....@gmail.com> Signed-off-by: Vladimir Oltean <vladimir.olt...@nxp.com> --- drivers/net/tsec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c index 4354753cab9c..64bb42b0c006 100644 --- a/drivers/net/tsec.c +++ b/drivers/net/tsec.c @@ -156,7 +156,7 @@ static int tsec_mcast_addr(struct udevice *dev, const u8 *mcast_mac, int join) return 0; } -static int tsec_set_promisc(struct udevice *dev, bool enable) +static int __maybe_unused tsec_set_promisc(struct udevice *dev, bool enable) { struct tsec_private *priv = dev_get_priv(dev); struct tsec __iomem *regs = priv->regs; -- 2.25.1