summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>2005-02-11 18:33:40 +0100
committerGreg KH <gregkh@suse.de>2005-04-26 23:36:12 -0700
commit03a9875bc3ed3c0da226c31e6fe2590a862f6bfe (patch)
tree7dea613e394f2fec54130a46e86cca434550a7ba
parent82b1698314f004b9d69a14c5054e5f7699aa33ad (diff)
[PATCH] namedev: move some matches out of the parent loop
-rw-r--r--namedev.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/namedev.c b/namedev.c
index bbc5b40069..c8e24db548 100644
--- a/namedev.c
+++ b/namedev.c
@@ -582,29 +582,29 @@ static int match_place(struct config_device *dev, struct sysfs_class_device *cla
static int match_rule(struct udevice *udev, struct config_device *dev,
struct sysfs_class_device *class_dev, struct sysfs_device *sysfs_device)
{
- while (1) {
- /* check for matching kernel name */
- if (dev->kernel[0] != '\0') {
- dbg("check for " FIELD_KERNEL " dev->kernel='%s' class_dev->name='%s'",
- dev->kernel, class_dev->name);
- if (strcmp_pattern(dev->kernel, class_dev->name) != 0) {
- dbg(FIELD_KERNEL " is not matching");
- goto exit;
- }
- dbg(FIELD_KERNEL " matches");
+ /* check for matching kernel name */
+ if (dev->kernel[0] != '\0') {
+ dbg("check for " FIELD_KERNEL " dev->kernel='%s' class_dev->name='%s'",
+ dev->kernel, class_dev->name);
+ if (strcmp_pattern(dev->kernel, class_dev->name) != 0) {
+ dbg(FIELD_KERNEL " is not matching");
+ goto exit;
}
+ dbg(FIELD_KERNEL " matches");
+ }
- /* check for matching subsystem */
- if (dev->subsystem[0] != '\0') {
- dbg("check for " FIELD_SUBSYSTEM " dev->subsystem='%s' class_dev->name='%s'",
- dev->subsystem, class_dev->name);
- if (strcmp_pattern(dev->subsystem, udev->subsystem) != 0) {
- dbg(FIELD_SUBSYSTEM " is not matching");
- goto exit;
- }
- dbg(FIELD_SUBSYSTEM " matches");
+ /* check for matching subsystem */
+ if (dev->subsystem[0] != '\0') {
+ dbg("check for " FIELD_SUBSYSTEM " dev->subsystem='%s' class_dev->name='%s'",
+ dev->subsystem, class_dev->name);
+ if (strcmp_pattern(dev->subsystem, udev->subsystem) != 0) {
+ dbg(FIELD_SUBSYSTEM " is not matching");
+ goto exit;
}
+ dbg(FIELD_SUBSYSTEM " matches");
+ }
+ while (1) {
/* check for matching driver */
if (dev->driver[0] != '\0') {
dbg("check for " FIELD_DRIVER " dev->driver='%s' sysfs_device->driver_name='%s'",