mirror of
https://github.com/systemd/systemd
synced 2024-07-21 10:17:21 +00:00
udev: net_id - suppress bcma core == 0
This commit is contained in:
parent
7f87328352
commit
f4ddacbd4d
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue