net: dsa: b53: Fix build with B53_SRAB enabled and not B53_SERDES
PATCH 1/1 net: dsa: b53: Fix build with B53_SRAB enabled and not B53_SERDES
In case B53_SRAB is enabled, but not B53_SERDES, we can get the following linking error:
ERROR: "b53_serdes_init" [drivers/net/dsa/b53/b53_srab.ko] undefined!
We also need to ifdef the body of b53_srab_serdes_map_lane() since it would not be used when B53_SERDES is disabled and that would produce a warning.
--- drivers/net/dsa/b53/b53_serdes.h | 7 +++++++ drivers/net/dsa/b53/b53_srab.c | 2 ++ 2 files changed, 9 insertions(+)
drivers/net/dsa/b53/b53_serdes.h +7 -0
@@ -118,4 +118,11 @@ void b53_serdes_link_set(struct b53_device *dev, int port, unsigned int mode,void b53_serdes_phylink_validate (struct b53_device *dev,int port,unsigned long *supported,struct phylink_link_state *state); +#if IS_ENABLED (CONFIG_B53_SERDES )int b53_serdes_init (struct b53_device *dev,int port); +#else +static inline int b53_serdes_init (struct b53_device *dev,int port) +{ +return -ENODEV ; +} +#endif
drivers/net/dsa/b53/b53_srab.c +2 -0
@@ -390,6 +390,7 @@ static irqreturn_t b53_srab_port_isr(int irq, void *dev_id)return IRQ_WAKE_THREAD ; } +#if IS_ENABLED (CONFIG_B53_SERDES )static u8 b53_srab_serdes_map_lane (struct b53_device *dev,int port) {struct b53_srab_priv *priv = dev->priv;
@@ -407,6 +408,7 @@ static u8 b53_srab_serdes_map_lane(struct b53_device *dev, int port) return B53_INVALID_LANE; } } +#endif static int b53_srab_irq_enable (struct b53_device *dev,int port) {
Signature · 1 line
2.17.1
Quoted 5 lines · Florian Fainelli
In case
B53_SRABis enabled, but notB53_SERDES, we can get the following linking error:ERROR: "
b53_serdes_init" [drivers/net/dsa/b53/b53_srab.ko] undefined!
Quoted 7 lines
We also need to ifdef the body of
b53_srab_serdes_map_lane()since it would not be used whenB53_SERDESis disabled and that would produce a warning.Fixes 0e01491de646 ("net: dsa: b53: Add SerDes support")Reported-by kbuild test robot <[email protected]>Signed-off-by Florian Fainelli <[email protected]>
Andrew
From: Florian Fainelli <[email protected]>
Date: Thu, 6 Sep 2018 11:42:45 -0700
Quoted 5 lines
In case
B53_SRABis enabled, but notB53_SERDES, we can get the following linking error:ERROR: "
b53_serdes_init" [drivers/net/dsa/b53/b53_srab.ko] undefined!
Quoted 7 lines
We also need to ifdef the body of
b53_srab_serdes_map_lane()since it would not be used whenB53_SERDESis disabled and that would produce a warning.Fixes 0e01491de646 ("net: dsa: b53: Add SerDes support")Reported-by kbuild test robot <[email protected]>Signed-off-by Florian Fainelli <[email protected]>
Applied.