summaryrefslogtreecommitdiff
path: root/src/udev
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2013-01-17 03:30:07 +0100
committerKay Sievers <kay@vrfy.org>2013-01-17 03:30:07 +0100
commitf4ddacbd4de0f159ec598f8ad690466a84787ec5 (patch)
tree2bb4e9f065997dc3a315f92016e7a8e3da442830 /src/udev
parent7f8732835295fce29479b1afc9e8ee801852db09 (diff)
udev: net_id - suppress bcma core == 0
Diffstat (limited to 'src/udev')
-rw-r--r--src/udev/udev-builtin-net_id.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/udev/udev-builtin-net_id.c b/src/udev/udev-builtin-net_id.c
index 312a54a6c1..20d96e041d 100644
--- a/src/udev/udev-builtin-net_id.c
+++ b/src/udev/udev-builtin-net_id.c
@@ -327,10 +327,13 @@ static int names_bcma(struct udev_device *dev, struct netnames *names) {
if (!bcmadev)
return -ENOENT;
- /* bus num, core num */
+ /* bus num:core num */
if (sscanf(udev_device_get_sysname(bcmadev), "bcma%*d:%d", &core) != 1)
return -EINVAL;
- snprintf(names->bcma_core, sizeof(names->bcma_core), "b%d", core);
+ /* suppress the common core == 0 */
+ if (core > 0)
+ snprintf(names->bcma_core, sizeof(names->bcma_core), "b%d", core);
+
names->type = NET_BCMA;
return 0;
}