diff options
author | Jianhua Xie <Jianhua.Xie@freescale.com> | 2015-01-08 10:13:40 (GMT) |
---|---|---|
committer | Jianhua Xie <Jianhua.Xie@freescale.com> | 2015-03-09 06:55:03 (GMT) |
commit | ec114d891ec3878221b14855310c5ca4f0722c77 (patch) | |
tree | 081799ead423a708f1eabe889281fd4793e31149 /drivers | |
parent | 1b6424b381d400c7d22e628189a8e30095fe7b4a (diff) | |
download | linux-fsl-qoriq-ec114d891ec3878221b14855310c5ca4f0722c77.tar.xz |
bonding: Refactor is_dpa_eth_port()
Change-Id: Ie5718f4acc69fe8b9990885820727422ee7ae8b7
Reviewed-by: Jiafei Pan <Jiafei.Pan@freescale.com>
Reviewed-on: http://git.am.freescale.net:8181/28611
Signed-off-by: Jianhua Xie <jianhua.xie@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/bonding/hw_distribution.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/net/bonding/hw_distribution.c b/drivers/net/bonding/hw_distribution.c index 66e9f48..ba2ec8b 100644 --- a/drivers/net/bonding/hw_distribution.c +++ b/drivers/net/bonding/hw_distribution.c @@ -336,13 +336,15 @@ ssize_t bonding_store_oh_enable(struct device *d, */ static bool is_dpa_eth_port(struct net_device *netdev) { + int ret; struct device *dev = (struct device *) &(netdev->dev); - if ((strlen(dev_driver_string(dev->parent)) >= 7) && - strncmp(dev_driver_string(dev->parent), "fsl_dpa", 7) == 0) - return true; - else - return false; + if (strlen(dev_driver_string(dev->parent)) >= 7) { + ret = strncmp(dev_driver_string(dev->parent), "fsl_dpa", 7); + return ret ? false : true; + } + + return false; } bool are_all_slaves_linkup(struct bonding *bond) |