Commit 2231c43b authored by Vivien Didelot's avatar Vivien Didelot Committed by David S. Miller

net: dsa: rename dsa_master_get_slave

The dsa_master_get_slave is slightly confusing since the idiomatic "get"
term often suggests reference counting, in symmetry to "put".

Rename it to dsa_master_find_slave to make the look up operation clear.
Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d0006b00
...@@ -113,7 +113,7 @@ int dsa_legacy_fdb_del(struct ndmsg *ndm, struct nlattr *tb[], ...@@ -113,7 +113,7 @@ int dsa_legacy_fdb_del(struct ndmsg *ndm, struct nlattr *tb[],
int dsa_master_ethtool_setup(struct net_device *dev); int dsa_master_ethtool_setup(struct net_device *dev);
void dsa_master_ethtool_restore(struct net_device *dev); void dsa_master_ethtool_restore(struct net_device *dev);
static inline struct net_device *dsa_master_get_slave(struct net_device *dev, static inline struct net_device *dsa_master_find_slave(struct net_device *dev,
int device, int port) int device, int port)
{ {
struct dsa_port *cpu_dp = dev->dsa_ptr; struct dsa_port *cpu_dp = dev->dsa_ptr;
......
...@@ -119,7 +119,7 @@ static struct sk_buff *brcm_tag_rcv(struct sk_buff *skb, struct net_device *dev, ...@@ -119,7 +119,7 @@ static struct sk_buff *brcm_tag_rcv(struct sk_buff *skb, struct net_device *dev,
/* Locate which port this is coming from */ /* Locate which port this is coming from */
source_port = brcm_tag[3] & BRCM_EG_PID_MASK; source_port = brcm_tag[3] & BRCM_EG_PID_MASK;
skb->dev = dsa_master_get_slave(dev, 0, source_port); skb->dev = dsa_master_find_slave(dev, 0, source_port);
if (!skb->dev) if (!skb->dev)
return NULL; return NULL;
......
...@@ -91,7 +91,7 @@ static struct sk_buff *dsa_rcv(struct sk_buff *skb, struct net_device *dev, ...@@ -91,7 +91,7 @@ static struct sk_buff *dsa_rcv(struct sk_buff *skb, struct net_device *dev,
source_device = dsa_header[0] & 0x1f; source_device = dsa_header[0] & 0x1f;
source_port = (dsa_header[1] >> 3) & 0x1f; source_port = (dsa_header[1] >> 3) & 0x1f;
skb->dev = dsa_master_get_slave(dev, source_device, source_port); skb->dev = dsa_master_find_slave(dev, source_device, source_port);
if (!skb->dev) if (!skb->dev)
return NULL; return NULL;
......
...@@ -104,7 +104,7 @@ static struct sk_buff *edsa_rcv(struct sk_buff *skb, struct net_device *dev, ...@@ -104,7 +104,7 @@ static struct sk_buff *edsa_rcv(struct sk_buff *skb, struct net_device *dev,
source_device = edsa_header[0] & 0x1f; source_device = edsa_header[0] & 0x1f;
source_port = (edsa_header[1] >> 3) & 0x1f; source_port = (edsa_header[1] >> 3) & 0x1f;
skb->dev = dsa_master_get_slave(dev, source_device, source_port); skb->dev = dsa_master_find_slave(dev, source_device, source_port);
if (!skb->dev) if (!skb->dev)
return NULL; return NULL;
......
...@@ -87,7 +87,7 @@ static struct sk_buff *ksz_rcv(struct sk_buff *skb, struct net_device *dev, ...@@ -87,7 +87,7 @@ static struct sk_buff *ksz_rcv(struct sk_buff *skb, struct net_device *dev,
source_port = tag[0] & 7; source_port = tag[0] & 7;
skb->dev = dsa_master_get_slave(dev, 0, source_port); skb->dev = dsa_master_find_slave(dev, 0, source_port);
if (!skb->dev) if (!skb->dev)
return NULL; return NULL;
......
...@@ -94,7 +94,7 @@ static struct sk_buff *lan9303_rcv(struct sk_buff *skb, struct net_device *dev, ...@@ -94,7 +94,7 @@ static struct sk_buff *lan9303_rcv(struct sk_buff *skb, struct net_device *dev,
source_port = ntohs(lan9303_tag[1]) & 0x3; source_port = ntohs(lan9303_tag[1]) & 0x3;
skb->dev = dsa_master_get_slave(dev, 0, source_port); skb->dev = dsa_master_find_slave(dev, 0, source_port);
if (!skb->dev) { if (!skb->dev) {
dev_warn_ratelimited(&dev->dev, "Dropping packet due to invalid source port\n"); dev_warn_ratelimited(&dev->dev, "Dropping packet due to invalid source port\n");
return NULL; return NULL;
......
...@@ -69,7 +69,7 @@ static struct sk_buff *mtk_tag_rcv(struct sk_buff *skb, struct net_device *dev, ...@@ -69,7 +69,7 @@ static struct sk_buff *mtk_tag_rcv(struct sk_buff *skb, struct net_device *dev,
/* Get source port information */ /* Get source port information */
port = (hdr & MTK_HDR_RECV_SOURCE_PORT_MASK); port = (hdr & MTK_HDR_RECV_SOURCE_PORT_MASK);
skb->dev = dsa_master_get_slave(dev, 0, port); skb->dev = dsa_master_find_slave(dev, 0, port);
if (!skb->dev) if (!skb->dev)
return NULL; return NULL;
......
...@@ -91,7 +91,7 @@ static struct sk_buff *qca_tag_rcv(struct sk_buff *skb, struct net_device *dev, ...@@ -91,7 +91,7 @@ static struct sk_buff *qca_tag_rcv(struct sk_buff *skb, struct net_device *dev,
/* Get source port information */ /* Get source port information */
port = (hdr & QCA_HDR_RECV_SOURCE_PORT_MASK); port = (hdr & QCA_HDR_RECV_SOURCE_PORT_MASK);
skb->dev = dsa_master_get_slave(dev, 0, port); skb->dev = dsa_master_find_slave(dev, 0, port);
if (!skb->dev) if (!skb->dev)
return NULL; return NULL;
......
...@@ -71,7 +71,7 @@ static struct sk_buff *trailer_rcv(struct sk_buff *skb, struct net_device *dev, ...@@ -71,7 +71,7 @@ static struct sk_buff *trailer_rcv(struct sk_buff *skb, struct net_device *dev,
source_port = trailer[1] & 7; source_port = trailer[1] & 7;
skb->dev = dsa_master_get_slave(dev, 0, source_port); skb->dev = dsa_master_find_slave(dev, 0, source_port);
if (!skb->dev) if (!skb->dev)
return NULL; return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment