diff options
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/base/attribute_container.c | 2 | ||||
| -rw-r--r-- | drivers/base/bus.c | 4 | ||||
| -rw-r--r-- | drivers/base/cacheinfo.c | 13 | ||||
| -rw-r--r-- | drivers/base/class.c | 2 | ||||
| -rw-r--r-- | drivers/base/core.c | 19 | ||||
| -rw-r--r-- | drivers/base/dd.c | 16 | ||||
| -rw-r--r-- | drivers/base/dma-mapping.c | 2 | ||||
| -rw-r--r-- | drivers/base/driver.c | 1 | ||||
| -rw-r--r-- | drivers/base/firmware_class.c | 49 | ||||
| -rw-r--r-- | drivers/base/map.c | 3 | ||||
| -rw-r--r-- | drivers/base/memory.c | 58 | ||||
| -rw-r--r-- | drivers/base/node.c | 28 | ||||
| -rw-r--r-- | drivers/base/platform.c | 9 | ||||
| -rw-r--r-- | drivers/base/property.c | 2 | ||||
| -rw-r--r-- | drivers/base/soc.c | 10 |
15 files changed, 129 insertions, 89 deletions
diff --git a/drivers/base/attribute_container.c b/drivers/base/attribute_container.c index 3ead3af4be61..2ba4cac080c5 100644 --- a/drivers/base/attribute_container.c +++ b/drivers/base/attribute_container.c | |||
| @@ -94,6 +94,7 @@ int | |||
| 94 | attribute_container_unregister(struct attribute_container *cont) | 94 | attribute_container_unregister(struct attribute_container *cont) |
| 95 | { | 95 | { |
| 96 | int retval = -EBUSY; | 96 | int retval = -EBUSY; |
| 97 | |||
| 97 | mutex_lock(&attribute_container_mutex); | 98 | mutex_lock(&attribute_container_mutex); |
| 98 | spin_lock(&cont->containers.k_lock); | 99 | spin_lock(&cont->containers.k_lock); |
| 99 | if (!list_empty(&cont->containers.k_list)) | 100 | if (!list_empty(&cont->containers.k_list)) |
| @@ -349,6 +350,7 @@ int | |||
| 349 | attribute_container_add_class_device(struct device *classdev) | 350 | attribute_container_add_class_device(struct device *classdev) |
| 350 | { | 351 | { |
| 351 | int error = device_add(classdev); | 352 | int error = device_add(classdev); |
| 353 | |||
| 352 | if (error) | 354 | if (error) |
| 353 | return error; | 355 | return error; |
| 354 | return attribute_container_add_attrs(classdev); | 356 | return attribute_container_add_attrs(classdev); |
diff --git a/drivers/base/bus.c b/drivers/base/bus.c index 876bae5ade33..79bc203f51ef 100644 --- a/drivers/base/bus.c +++ b/drivers/base/bus.c | |||
| @@ -515,11 +515,11 @@ int bus_add_device(struct device *dev) | |||
| 515 | goto out_put; | 515 | goto out_put; |
| 516 | error = device_add_groups(dev, bus->dev_groups); | 516 | error = device_add_groups(dev, bus->dev_groups); |
| 517 | if (error) | 517 | if (error) |
| 518 | goto out_groups; | 518 | goto out_id; |
| 519 | error = sysfs_create_link(&bus->p->devices_kset->kobj, | 519 | error = sysfs_create_link(&bus->p->devices_kset->kobj, |
| 520 | &dev->kobj, dev_name(dev)); | 520 | &dev->kobj, dev_name(dev)); |
| 521 | if (error) | 521 | if (error) |
| 522 | goto out_id; | 522 | goto out_groups; |
| 523 | error = sysfs_create_link(&dev->kobj, | 523 | error = sysfs_create_link(&dev->kobj, |
| 524 | &dev->bus->p->subsys.kobj, "subsystem"); | 524 | &dev->bus->p->subsys.kobj, "subsystem"); |
| 525 | if (error) | 525 | if (error) |
diff --git a/drivers/base/cacheinfo.c b/drivers/base/cacheinfo.c index 6e64563361f0..9c2ba1c97c42 100644 --- a/drivers/base/cacheinfo.c +++ b/drivers/base/cacheinfo.c | |||
| @@ -62,15 +62,21 @@ static int cache_setup_of_node(unsigned int cpu) | |||
| 62 | return -ENOENT; | 62 | return -ENOENT; |
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | while (np && index < cache_leaves(cpu)) { | 65 | while (index < cache_leaves(cpu)) { |
| 66 | this_leaf = this_cpu_ci->info_list + index; | 66 | this_leaf = this_cpu_ci->info_list + index; |
| 67 | if (this_leaf->level != 1) | 67 | if (this_leaf->level != 1) |
| 68 | np = of_find_next_cache_node(np); | 68 | np = of_find_next_cache_node(np); |
| 69 | else | 69 | else |
| 70 | np = of_node_get(np);/* cpu node itself */ | 70 | np = of_node_get(np);/* cpu node itself */ |
| 71 | if (!np) | ||
| 72 | break; | ||
| 71 | this_leaf->of_node = np; | 73 | this_leaf->of_node = np; |
| 72 | index++; | 74 | index++; |
| 73 | } | 75 | } |
| 76 | |||
| 77 | if (index != cache_leaves(cpu)) /* not all OF nodes populated */ | ||
| 78 | return -ENOENT; | ||
| 79 | |||
| 74 | return 0; | 80 | return 0; |
| 75 | } | 81 | } |
| 76 | 82 | ||
| @@ -189,8 +195,11 @@ static int detect_cache_attributes(unsigned int cpu) | |||
| 189 | * will be set up here only if they are not populated already | 195 | * will be set up here only if they are not populated already |
| 190 | */ | 196 | */ |
| 191 | ret = cache_shared_cpu_map_setup(cpu); | 197 | ret = cache_shared_cpu_map_setup(cpu); |
| 192 | if (ret) | 198 | if (ret) { |
| 199 | pr_warn("Unable to detect cache hierarcy from DT for CPU %d\n", | ||
| 200 | cpu); | ||
| 193 | goto free_ci; | 201 | goto free_ci; |
| 202 | } | ||
| 194 | return 0; | 203 | return 0; |
| 195 | 204 | ||
| 196 | free_ci: | 205 | free_ci: |
diff --git a/drivers/base/class.c b/drivers/base/class.c index f96f70419a78..6e810881e48b 100644 --- a/drivers/base/class.c +++ b/drivers/base/class.c | |||
| @@ -90,6 +90,7 @@ int class_create_file_ns(struct class *cls, const struct class_attribute *attr, | |||
| 90 | const void *ns) | 90 | const void *ns) |
| 91 | { | 91 | { |
| 92 | int error; | 92 | int error; |
| 93 | |||
| 93 | if (cls) | 94 | if (cls) |
| 94 | error = sysfs_create_file_ns(&cls->p->subsys.kobj, | 95 | error = sysfs_create_file_ns(&cls->p->subsys.kobj, |
| 95 | &attr->attr, ns); | 96 | &attr->attr, ns); |
| @@ -488,6 +489,7 @@ ssize_t show_class_attr_string(struct class *class, | |||
| 488 | struct class_attribute *attr, char *buf) | 489 | struct class_attribute *attr, char *buf) |
| 489 | { | 490 | { |
| 490 | struct class_attribute_string *cs; | 491 | struct class_attribute_string *cs; |
| 492 | |||
| 491 | cs = container_of(attr, struct class_attribute_string, attr); | 493 | cs = container_of(attr, struct class_attribute_string, attr); |
| 492 | return snprintf(buf, PAGE_SIZE, "%s\n", cs->str); | 494 | return snprintf(buf, PAGE_SIZE, "%s\n", cs->str); |
| 493 | } | 495 | } |
diff --git a/drivers/base/core.c b/drivers/base/core.c index 07304a3b9ee2..cadf165651d8 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c | |||
| @@ -805,8 +805,16 @@ static void cleanup_device_parent(struct device *dev) | |||
| 805 | 805 | ||
| 806 | static int device_add_class_symlinks(struct device *dev) | 806 | static int device_add_class_symlinks(struct device *dev) |
| 807 | { | 807 | { |
| 808 | struct device_node *of_node = dev_of_node(dev); | ||
| 808 | int error; | 809 | int error; |
| 809 | 810 | ||
| 811 | if (of_node) { | ||
| 812 | error = sysfs_create_link(&dev->kobj, &of_node->kobj,"of_node"); | ||
| 813 | if (error) | ||
| 814 | dev_warn(dev, "Error %d creating of_node link\n",error); | ||
| 815 | /* An error here doesn't warrant bringing down the device */ | ||
| 816 | } | ||
| 817 | |||
| 810 | if (!dev->class) | 818 | if (!dev->class) |
| 811 | return 0; | 819 | return 0; |
| 812 | 820 | ||
| @@ -814,7 +822,7 @@ static int device_add_class_symlinks(struct device *dev) | |||
| 814 | &dev->class->p->subsys.kobj, | 822 | &dev->class->p->subsys.kobj, |
| 815 | "subsystem"); | 823 | "subsystem"); |
| 816 | if (error) | 824 | if (error) |
| 817 | goto out; | 825 | goto out_devnode; |
| 818 | 826 | ||
| 819 | if (dev->parent && device_is_not_partition(dev)) { | 827 | if (dev->parent && device_is_not_partition(dev)) { |
| 820 | error = sysfs_create_link(&dev->kobj, &dev->parent->kobj, | 828 | error = sysfs_create_link(&dev->kobj, &dev->parent->kobj, |
| @@ -842,12 +850,16 @@ out_device: | |||
| 842 | 850 | ||
| 843 | out_subsys: | 851 | out_subsys: |
| 844 | sysfs_remove_link(&dev->kobj, "subsystem"); | 852 | sysfs_remove_link(&dev->kobj, "subsystem"); |
| 845 | out: | 853 | out_devnode: |
| 854 | sysfs_remove_link(&dev->kobj, "of_node"); | ||
| 846 | return error; | 855 | return error; |
| 847 | } | 856 | } |
| 848 | 857 | ||
| 849 | static void device_remove_class_symlinks(struct device *dev) | 858 | static void device_remove_class_symlinks(struct device *dev) |
| 850 | { | 859 | { |
| 860 | if (dev_of_node(dev)) | ||
| 861 | sysfs_remove_link(&dev->kobj, "of_node"); | ||
| 862 | |||
| 851 | if (!dev->class) | 863 | if (!dev->class) |
| 852 | return; | 864 | return; |
| 853 | 865 | ||
| @@ -1095,8 +1107,7 @@ done: | |||
| 1095 | kobject_del(&dev->kobj); | 1107 | kobject_del(&dev->kobj); |
| 1096 | Error: | 1108 | Error: |
| 1097 | cleanup_device_parent(dev); | 1109 | cleanup_device_parent(dev); |
| 1098 | if (parent) | 1110 | put_device(parent); |
| 1099 | put_device(parent); | ||
| 1100 | name_error: | 1111 | name_error: |
| 1101 | kfree(dev->p); | 1112 | kfree(dev->p); |
