* [PATCH net-next] net: dsa: b53: Fix build with B53_SRAB enabled and not B53_SERDES
@ 2018-09-06 18:42 Florian Fainelli
2018-09-06 19:55 ` Andrew Lunn
2018-09-08 6:12 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Florian Fainelli @ 2018-09-06 18:42 UTC (permalink / raw)
To: netdev
Cc: Florian Fainelli, Andrew Lunn, Vivien Didelot, David S. Miller,
open list
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.
Fixes: 0e01491de646 ("net: dsa: b53: Add SerDes support")
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/dsa/b53/b53_serdes.h | 7 +++++++
drivers/net/dsa/b53/b53_srab.c | 2 ++
2 files changed, 9 insertions(+)
diff --git a/drivers/net/dsa/b53/b53_serdes.h b/drivers/net/dsa/b53/b53_serdes.h
index e0674aa0167f..eed7c9357091 100644
--- a/drivers/net/dsa/b53/b53_serdes.h
+++ b/drivers/net/dsa/b53/b53_serdes.h
@@ -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
diff --git a/drivers/net/dsa/b53/b53_srab.c b/drivers/net/dsa/b53/b53_srab.c
index 149788697fd6..b0ed81876bae 100644
--- a/drivers/net/dsa/b53/b53_srab.c
+++ b/drivers/net/dsa/b53/b53_srab.c
@@ -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)
{
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net: dsa: b53: Fix build with B53_SRAB enabled and not B53_SERDES
2018-09-06 18:42 [PATCH net-next] net: dsa: b53: Fix build with B53_SRAB enabled and not B53_SERDES Florian Fainelli
@ 2018-09-06 19:55 ` Andrew Lunn
2018-09-08 6:12 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2018-09-06 19:55 UTC (permalink / raw)
To: Florian Fainelli; +Cc: netdev, Vivien Didelot, David S. Miller, open list
On Thu, Sep 06, 2018 at 11:42:45AM -0700, Florian Fainelli wrote:
> 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.
>
> Fixes: 0e01491de646 ("net: dsa: b53: Add SerDes support")
> Reported-by: kbuild test robot <lkp@intel.com>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net: dsa: b53: Fix build with B53_SRAB enabled and not B53_SERDES
2018-09-06 18:42 [PATCH net-next] net: dsa: b53: Fix build with B53_SRAB enabled and not B53_SERDES Florian Fainelli
2018-09-06 19:55 ` Andrew Lunn
@ 2018-09-08 6:12 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2018-09-08 6:12 UTC (permalink / raw)
To: f.fainelli; +Cc: netdev, andrew, vivien.didelot, linux-kernel
From: Florian Fainelli <f.fainelli@gmail.com>
Date: Thu, 6 Sep 2018 11:42:45 -0700
> 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.
>
> Fixes: 0e01491de646 ("net: dsa: b53: Add SerDes support")
> Reported-by: kbuild test robot <lkp@intel.com>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-09-08 6:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-06 18:42 [PATCH net-next] net: dsa: b53: Fix build with B53_SRAB enabled and not B53_SERDES Florian Fainelli
2018-09-06 19:55 ` Andrew Lunn
2018-09-08 6:12 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).