]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - kernel/resource.c
Merge tag 'pinctrl-v3.17-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw...
[karo-tx-linux.git] / kernel / resource.c
index da14b8d092961bf5680bf06004f980ad1ec43859..60c5a3856ab7a5266fabd7eef844b9d1a636d0a8 100644 (file)
@@ -351,15 +351,12 @@ static int find_next_iomem_res(struct resource *res, char *name,
        end = res->end;
        BUG_ON(start >= end);
 
-       read_lock(&resource_lock);
-
-       if (first_level_children_only) {
-               p = iomem_resource.child;
+       if (first_level_children_only)
                sibling_only = true;
-       } else
-               p = &iomem_resource;
 
-       while ((p = next_resource(p, sibling_only))) {
+       read_lock(&resource_lock);
+
+       for (p = iomem_resource.child; p; p = next_resource(p, sibling_only)) {
                if (p->flags != res->flags)
                        continue;
                if (name && strcmp(p->name, name))