From: Phil Oester Date: Mon, 14 Mar 2011 06:22:06 +0000 (+0000) Subject: bonding: Improve syslog message at device creation time X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5f86cad1e8224af9e3b9b43dd84b146a9ff0df87;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git bonding: Improve syslog message at device creation time When the bonding module is loaded, it creates bond0 by default. Then, when attempting to create bond0, the following messages are printed to syslog: kernel: bonding: bond0 is being created... kernel: bonding: Bond creation failed. Which seems to indicate a problem, when in reality there is no problem. Since the actual error code is passed down from bond_create, make use of it to print a bit less ominous message: kernel: bonding: bond0 is being created... kernel: bond0 already exists. Signed-off-by: Phil Oester Signed-off-by: Andy Gospodarek Signed-off-by: David S. Miller --- diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c index 72bb0f6cc9bf..e718144c5cfa 100644 --- a/drivers/net/bonding/bond_sysfs.c +++ b/drivers/net/bonding/bond_sysfs.c @@ -118,7 +118,10 @@ static ssize_t bonding_store_bonds(struct class *cls, pr_info("%s is being created...\n", ifname); rv = bond_create(net, ifname); if (rv) { - pr_info("Bond creation failed.\n"); + if (rv == -EEXIST) + pr_info("%s already exists.\n", ifname); + else + pr_info("%s creation failed.\n", ifname); res = rv; } } else if (command[0] == '-') {