Commit c39e2a1d authored by Andrew Lunn's avatar Andrew Lunn Committed by David S. Miller

dsa: Rename dsa_resolve_tag_protocol() to _get ready for locking

dsa_resolve_tag_protocol() is used to find the tagging driver needed
by a switch driver. When the tagging drivers become modules, it will
be necassary to take a reference on the module to prevent it being
unloaded. So rename this function to _get() to indicate it has some
locking properties.
Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 409065b0
...@@ -123,7 +123,7 @@ const char *dsa_tag_protocol_to_str(const struct dsa_device_ops *ops) ...@@ -123,7 +123,7 @@ const char *dsa_tag_protocol_to_str(const struct dsa_device_ops *ops)
return ops->name; return ops->name;
}; };
const struct dsa_device_ops *dsa_resolve_tag_protocol(int tag_protocol) const struct dsa_device_ops *dsa_tag_driver_get(int tag_protocol)
{ {
const struct dsa_device_ops *ops; const struct dsa_device_ops *ops;
......
...@@ -577,7 +577,7 @@ static int dsa_port_parse_cpu(struct dsa_port *dp, struct net_device *master) ...@@ -577,7 +577,7 @@ static int dsa_port_parse_cpu(struct dsa_port *dp, struct net_device *master)
enum dsa_tag_protocol tag_protocol; enum dsa_tag_protocol tag_protocol;
tag_protocol = ds->ops->get_tag_protocol(ds, dp->index); tag_protocol = ds->ops->get_tag_protocol(ds, dp->index);
tag_ops = dsa_resolve_tag_protocol(tag_protocol); tag_ops = dsa_tag_driver_get(tag_protocol);
if (IS_ERR(tag_ops)) { if (IS_ERR(tag_ops)) {
dev_warn(ds->dev, "No tagger for this switch\n"); dev_warn(ds->dev, "No tagger for this switch\n");
return PTR_ERR(tag_ops); return PTR_ERR(tag_ops);
......
...@@ -84,7 +84,8 @@ struct dsa_slave_priv { ...@@ -84,7 +84,8 @@ struct dsa_slave_priv {
}; };
/* dsa.c */ /* dsa.c */
const struct dsa_device_ops *dsa_resolve_tag_protocol(int tag_protocol); const struct dsa_device_ops *dsa_tag_driver_get(int tag_protocol);
bool dsa_schedule_work(struct work_struct *work); bool dsa_schedule_work(struct work_struct *work);
const char *dsa_tag_protocol_to_str(const struct dsa_device_ops *ops); const char *dsa_tag_protocol_to_str(const struct dsa_device_ops *ops);
......
...@@ -152,7 +152,7 @@ static int dsa_switch_setup_one(struct dsa_switch *ds, ...@@ -152,7 +152,7 @@ static int dsa_switch_setup_one(struct dsa_switch *ds,
enum dsa_tag_protocol tag_protocol; enum dsa_tag_protocol tag_protocol;
tag_protocol = ops->get_tag_protocol(ds, dst->cpu_dp->index); tag_protocol = ops->get_tag_protocol(ds, dst->cpu_dp->index);
tag_ops = dsa_resolve_tag_protocol(tag_protocol); tag_ops = dsa_tag_driver_get(tag_protocol);
if (IS_ERR(tag_ops)) if (IS_ERR(tag_ops))
return PTR_ERR(tag_ops); return PTR_ERR(tag_ops);
......
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