projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
89ab88b
)
devlink: Prevent port_type_set() callback when it's not needed
author
Elad Raz
<
[email protected]
>
Sun, 23 Oct 2016 15:43:05 +0000
(17:43 +0200)
committer
David S. Miller
<
[email protected]
>
Wed, 26 Oct 2016 21:30:32 +0000
(17:30 -0400)
When a port_type_set() is been called and the new port type set is the same
as the old one, just return success.
Signed-off-by: Elad Raz <
[email protected]
>
Signed-off-by: Jiri Pirko <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
net/core/devlink.c
patch
|
blob
|
history
diff --git
a/net/core/devlink.c
b/net/core/devlink.c
index 1b5063088f1a7193f7789506e95cc6dbc8ab73f0..d2fd736de6a29f8cbf77da29ba5162245f919ce5 100644
(file)
--- a/
net/core/devlink.c
+++ b/
net/core/devlink.c
@@
-608,6
+608,8
@@
static int devlink_port_type_set(struct devlink *devlink,
if (devlink->ops && devlink->ops->port_type_set) {
if (port_type == DEVLINK_PORT_TYPE_NOTSET)
return -EINVAL;
+ if (port_type == devlink_port->type)
+ return 0;
err = devlink->ops->port_type_set(devlink_port, port_type);
if (err)
return err;