diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-13 20:17:32 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-13 20:17:32 -0400 |
| commit | c4be50eee2bd4d50e0f0ca58776f685c08de69c3 (patch) | |
| tree | 819da448b2916a293e5c600c95d72db83ec77017 /drivers/base | |
| parent | 42e3a58b028e0e51746f596a11abfec01cd1c5c4 (diff) | |
| parent | c9e15f25f514a76d906be01e621f400cdee94558 (diff) | |
Merge tag 'driver-core-4.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
Pull driver core updates from Greg KH:
"Here's the driver-core / kobject / lz4 tree update for 4.1-rc1.
Everything here has been in linux-next for a while with no reported
issues. It's mostly just coding style cleanups, with other minor
changes in here as well, nothing big"
* tag 'driver-core-4.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (32 commits)
debugfs: allow bad parent pointers to be passed in
stable_kernel_rules: Add clause about specification of kernel versions to patch.
kobject: WARN as tip when call kobject_get() to a kobject not initialized
lib/lz4: Pull out constant tables
drivers: platform: parse IRQ flags from resources
driver core: Make probe deferral more quiet
drivers/core/of: Add symlink to device-tree from devices with an OF node
device: Add dev_of_node() accessor
drivers: base: fw: fix ret value when loading fw
firmware: Avoid manual device_create_file() calls
drivers/base: cacheinfo: validate device node for all the caches
drivers/base: use tabs where possible in code indentation
driver core: add missing blank line after declaration
drivers: base: node: Delete space after pointer declaration
drivers: base: memory: Use tabs instead of spaces
firmware_class: Fix whitespace and indentation
drivers: base: dma-mapping: Erase blank space after pointer
drivers: base: class: Add a blank line after declarations
attribute_container: fix missing blank lines after declarations
drivers: base: memory: Fix switch indent
...
Diffstat (limited to 'drivers/base')
| -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) | ||
