summaryrefslogtreecommitdiff
path: root/namedev.c
diff options
context:
space:
mode:
Diffstat (limited to 'namedev.c')
-rw-r--r--namedev.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/namedev.c b/namedev.c
index b9d8a3db2c..f2aea34719 100644
--- a/namedev.c
+++ b/namedev.c
@@ -836,12 +836,22 @@ int namedev_name_device(struct sysfs_class_device *class_dev, struct udevice *ud
}
}
+ /* no rule was found for the net device */
+ if (udev->type == 'n') {
+ dbg("no name for net device '%s' configured", udev->kernel_name);
+ return -1;
+ }
+
/* no rule was found so we use the kernel name */
strfieldcpy(udev->name, udev->kernel_name);
goto done;
found:
apply_format(udev, udev->name, sizeof(udev->name), class_dev, sysfs_device);
+
+ if (udev->type == 'n')
+ return 0;
+
udev->partitions = dev->partitions;
strfieldcpy(udev->config_file, dev->config_file);
udev->config_line = dev->config_line;