diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2019-02-24 21:39:02 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-02-25 01:31:41 -0500 |
commit | 72636db5ba7bb0520bf39ea56dc87c90580ec6fd (patch) | |
tree | 70d20b2cb399c7c40712855e98404f505de7a2c3 | |
parent | 75104db0cb353ec0b74644d960640ac0f84ab839 (diff) |
switchdev: Complete removal of switchdev_port_attr_get()
We have no more in tree users of switchdev_port_attr_get() after
d0e698d57a94 ("Merge branch 'net-Get-rid-of-switchdev_port_attr_get'")
so completely remove the function signature and body.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/net/switchdev.h | 4 | ||||
-rw-r--r-- | net/switchdev/switchdev.c | 42 |
2 files changed, 0 insertions, 46 deletions
diff --git a/include/net/switchdev.h b/include/net/switchdev.h index 45310ddf2d7e..be4b13e66668 100644 --- a/include/net/switchdev.h +++ b/include/net/switchdev.h | |||
@@ -115,13 +115,9 @@ typedef int switchdev_obj_dump_cb_t(struct switchdev_obj *obj); | |||
115 | /** | 115 | /** |
116 | * struct switchdev_ops - switchdev operations | 116 | * struct switchdev_ops - switchdev operations |
117 | * | 117 | * |
118 | * @switchdev_port_attr_get: Get a port attribute (see switchdev_attr). | ||
119 | * | ||
120 | * @switchdev_port_attr_set: Set a port attribute (see switchdev_attr). | 118 | * @switchdev_port_attr_set: Set a port attribute (see switchdev_attr). |
121 | */ | 119 | */ |
122 | struct switchdev_ops { | 120 | struct switchdev_ops { |
123 | int (*switchdev_port_attr_get)(struct net_device *dev, | ||
124 | struct switchdev_attr *attr); | ||
125 | int (*switchdev_port_attr_set)(struct net_device *dev, | 121 | int (*switchdev_port_attr_set)(struct net_device *dev, |
126 | const struct switchdev_attr *attr, | 122 | const struct switchdev_attr *attr, |
127 | struct switchdev_trans *trans); | 123 | struct switchdev_trans *trans); |
diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c index 7e1357db33d7..362413c9b389 100644 --- a/net/switchdev/switchdev.c +++ b/net/switchdev/switchdev.c | |||
@@ -174,48 +174,6 @@ static int switchdev_deferred_enqueue(struct net_device *dev, | |||
174 | return 0; | 174 | return 0; |
175 | } | 175 | } |
176 | 176 | ||
177 | /** | ||
178 | * switchdev_port_attr_get - Get port attribute | ||
179 | * | ||
180 | * @dev: port device | ||
181 | * @attr: attribute to get | ||
182 | */ | ||
183 | int switchdev_port_attr_get(struct net_device *dev, struct switchdev_attr *attr) | ||
184 | { | ||
185 | const struct switchdev_ops *ops = dev->switchdev_ops; | ||
186 | struct net_device *lower_dev; | ||
187 | struct list_head *iter; | ||
188 | struct switchdev_attr first = { | ||
189 | .id = SWITCHDEV_ATTR_ID_UNDEFINED | ||
190 | }; | ||
191 | int err = -EOPNOTSUPP; | ||
192 | |||
193 | if (ops && ops->switchdev_port_attr_get) | ||
194 | return ops->switchdev_port_attr_get(dev, attr); | ||
195 | |||
196 | if (attr->flags & SWITCHDEV_F_NO_RECURSE) | ||
197 | return err; | ||
198 | |||
199 | /* Switch device port(s) may be stacked under | ||
200 | * bond/team/vlan dev, so recurse down to get attr on | ||
201 | * each port. Return -ENODATA if attr values don't | ||
202 | * compare across ports. | ||
203 | */ | ||
204 | |||
205 | netdev_for_each_lower_dev(dev, lower_dev, iter) { | ||
206 | err = switchdev_port_attr_get(lower_dev, attr); | ||
207 | if (err) | ||
208 | break; | ||
209 | if (first.id == SWITCHDEV_ATTR_ID_UNDEFINED) | ||
210 | first = *attr; | ||
211 | else if (memcmp(&first, attr, sizeof(*attr))) | ||
212 | return -ENODATA; | ||
213 | } | ||
214 | |||
215 | return err; | ||
216 | } | ||
217 | EXPORT_SYMBOL_GPL(switchdev_port_attr_get); | ||
218 | |||
219 | static int __switchdev_port_attr_set(struct net_device *dev, | 177 | static int __switchdev_port_attr_set(struct net_device *dev, |
220 | const struct switchdev_attr *attr, | 178 | const struct switchdev_attr *attr, |
221 | struct switchdev_trans *trans) | 179 | struct switchdev_trans *trans) |