Discussion:
[PATCH] dsa: mv88e6171: Fix tag_protocol check
Guenter Roeck
2014-10-14 18:21:04 UTC
Permalink
tag_protocol is now an enum, so drivers have to check against it.

Cc: Andrew Lunn <***@lunn.ch>
Signed-off-by: Guenter Roeck <***@roeck-us.net>
---
drivers/net/dsa/mv88e6171.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/dsa/mv88e6171.c b/drivers/net/dsa/mv88e6171.c
index 6365e30..1020a7a 100644
--- a/drivers/net/dsa/mv88e6171.c
+++ b/drivers/net/dsa/mv88e6171.c
@@ -206,7 +206,7 @@ static int mv88e6171_setup_port(struct dsa_switch *ds, int p)
*/
val = 0x0433;
if (dsa_is_cpu_port(ds, p)) {
- if (ds->dst->tag_protocol == htons(ETH_P_EDSA))
+ if (ds->dst->tag_protocol == DSA_TAG_PROTO_EDSA)
val |= 0x3300;
else
val |= 0x0100;
--
1.9.1
Florian Fainelli
2014-10-14 18:23:03 UTC
Permalink
Post by Guenter Roeck
tag_protocol is now an enum, so drivers have to check against it.
Good catch, this driver got merged right in the middle of my changes
from __be16 to an enum and this slipped through.
Fixes: 42f272539487e49c9ea830ad97db41eb9937d5dc ("net: DSA: Marvell
mv88e6171 switch driver")
Post by Guenter Roeck
---
drivers/net/dsa/mv88e6171.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/dsa/mv88e6171.c b/drivers/net/dsa/mv88e6171.c
index 6365e30..1020a7a 100644
--- a/drivers/net/dsa/mv88e6171.c
+++ b/drivers/net/dsa/mv88e6171.c
@@ -206,7 +206,7 @@ static int mv88e6171_setup_port(struct dsa_switch *ds, int p)
*/
val = 0x0433;
if (dsa_is_cpu_port(ds, p)) {
- if (ds->dst->tag_protocol == htons(ETH_P_EDSA))
+ if (ds->dst->tag_protocol == DSA_TAG_PROTO_EDSA)
val |= 0x3300;
else
val |= 0x0100;
Andrew Lunn
2014-10-14 19:59:58 UTC
Permalink
Post by Guenter Roeck
tag_protocol is now an enum, so drivers have to check against it.
Acked-by: Andrew Lunn <***@lunn.ch>

Thanks for fixing this.

Andrew
Post by Guenter Roeck
---
drivers/net/dsa/mv88e6171.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/dsa/mv88e6171.c b/drivers/net/dsa/mv88e6171.c
index 6365e30..1020a7a 100644
--- a/drivers/net/dsa/mv88e6171.c
+++ b/drivers/net/dsa/mv88e6171.c
@@ -206,7 +206,7 @@ static int mv88e6171_setup_port(struct dsa_switch *ds, int p)
*/
val = 0x0433;
if (dsa_is_cpu_port(ds, p)) {
- if (ds->dst->tag_protocol == htons(ETH_P_EDSA))
+ if (ds->dst->tag_protocol == DSA_TAG_PROTO_EDSA)
val |= 0x3300;
else
val |= 0x0100;
--
1.9.1
David Miller
2014-10-14 20:23:52 UTC
Permalink
From: Guenter Roeck <***@roeck-us.net>
Date: Tue, 14 Oct 2014 11:21:04 -0700
Post by Guenter Roeck
tag_protocol is now an enum, so drivers have to check against it.
Applied, thanks.

Loading...