Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'driver-core-5.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core

Pull driver core changes from Greg KH:
"Here is the small set of driver core and debugfs updates for 5.14-rc1.

Included in here are:

- debugfs api cleanups (touched some drivers)

- devres updates

- tiny driver core updates and tweaks

Nothing major in here at all, and all have been in linux-next for a
while with no reported issues"

* tag 'driver-core-5.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (27 commits)
docs: ABI: testing: sysfs-firmware-memmap: add some memmap types.
devres: Enable trace events
devres: No need to call remove_nodes() when there none present
devres: Use list_for_each_safe_from() in remove_nodes()
devres: Make locking straight forward in release_nodes()
kernfs: move revalidate to be near lookup
drivers/base: Constify static attribute_group structs
firmware_loader: remove unneeded 'comma' macro
devcoredump: remove contact information
driver core: Drop helper devm_platform_ioremap_resource_wc()
component: Rename 'dev' to 'parent'
component: Drop 'dev' argument to component_match_realloc()
device property: Don't check for NULL twice in the loops
driver core: auxiliary bus: Fix typo in the docs
drivers/base/node.c: make CACHE_ATTR define static DEVICE_ATTR_RO
debugfs: remove return value of debugfs_create_ulong()
debugfs: remove return value of debugfs_create_bool()
scsi: snic: debugfs: remove local storage of debugfs files
b43: don't save dentries for debugfs
b43legacy: don't save dentries for debugfs
...

+314 -371
+4
Documentation/ABI/testing/sysfs-firmware-memmap
··· 56 56 - System RAM 57 57 - ACPI Tables 58 58 - ACPI Non-volatile Storage 59 + - Unusable memory 60 + - Persistent Memory (legacy) 61 + - Persistent Memory 62 + - Soft Reserved 59 63 - reserved 60 64 61 65 Following shell snippet can be used to display that memory
+1 -1
Documentation/driver-api/auxiliary_bus.rst
··· 11 11 (e.g. Sound Open Firmware), multiple devices might implement a common 12 12 intersection of functionality (e.g. NICs + RDMA), or a driver may want to 13 13 export an interface for another subsystem to drive (e.g. SIOV Physical Function 14 - export Virtual Function management). A split of the functinoality into child- 14 + export Virtual Function management). A split of the functionality into child- 15 15 devices representing sub-domains of functionality makes it possible to 16 16 compartmentalize, layer, and distribute domain-specific concerns via a Linux 17 17 device-driver model.
-1
Documentation/driver-api/driver-model/devres.rst
··· 314 314 devm_ioremap_resource() : checks resource, requests memory region, ioremaps 315 315 devm_ioremap_resource_wc() 316 316 devm_platform_ioremap_resource() : calls devm_ioremap_resource() for platform device 317 - devm_platform_ioremap_resource_wc() 318 317 devm_platform_ioremap_resource_byname() 319 318 devm_platform_get_and_ioremap_resource() 320 319 devm_iounmap()
+2 -2
Documentation/filesystems/debugfs.rst
··· 120 120 121 121 Boolean values can be placed in debugfs with:: 122 122 123 - struct dentry *debugfs_create_bool(const char *name, umode_t mode, 124 - struct dentry *parent, bool *value); 123 + void debugfs_create_bool(const char *name, umode_t mode, 124 + struct dentry *parent, bool *value); 125 125 126 126 A read on the resulting file will yield either Y (for non-zero values) or 127 127 N, followed by a newline. If written to, it will accept either upper- or
+3
drivers/base/Makefile
··· 30 30 31 31 ccflags-$(CONFIG_DEBUG_DRIVER) := -DDEBUG 32 32 33 + # define_trace.h needs to know how to find our header 34 + CFLAGS_trace.o := -I$(src) 35 + obj-$(CONFIG_TRACING) += trace.o
+3 -3
drivers/base/attribute_container.c
··· 284 284 * matching classdev or fail all of them. 285 285 * 286 286 * @dev: The generic device to run the trigger for 287 - * @fn the function to execute for each classdev. 288 - * @undo A function to undo the work previously done in case of error 287 + * @fn: the function to execute for each classdev. 288 + * @undo: A function to undo the work previously done in case of error 289 289 * 290 290 * This function is a safe version of 291 291 * attribute_container_device_trigger. It stops on the first error and ··· 343 343 * attribute_container_device_trigger - execute a trigger for each matching classdev 344 344 * 345 345 * @dev: The generic device to run the trigger for 346 - * @fn the function to execute for each classdev. 346 + * @fn: the function to execute for each classdev. 347 347 * 348 348 * This function is for executing a trigger when you need to know both 349 349 * the container and the classdev. If you only care about the
+45 -51
drivers/base/component.c
··· 63 63 bool bound; 64 64 65 65 const struct component_master_ops *ops; 66 - struct device *dev; 66 + struct device *parent; 67 67 struct component_match *match; 68 68 }; 69 69 ··· 95 95 seq_printf(s, "%-40s %20s\n", "master name", "status"); 96 96 seq_puts(s, "-------------------------------------------------------------\n"); 97 97 seq_printf(s, "%-40s %20s\n\n", 98 - dev_name(m->dev), m->bound ? "bound" : "not bound"); 98 + dev_name(m->parent), m->bound ? "bound" : "not bound"); 99 99 100 100 seq_printf(s, "%-40s %20s\n", "device name", "status"); 101 101 seq_puts(s, "-------------------------------------------------------------\n"); ··· 124 124 125 125 static void component_master_debugfs_add(struct master *m) 126 126 { 127 - debugfs_create_file(dev_name(m->dev), 0444, component_debugfs_dir, m, 127 + debugfs_create_file(dev_name(m->parent), 0444, component_debugfs_dir, m, 128 128 &component_devices_fops); 129 129 } 130 130 131 131 static void component_master_debugfs_del(struct master *m) 132 132 { 133 - debugfs_remove(debugfs_lookup(dev_name(m->dev), component_debugfs_dir)); 133 + debugfs_remove(debugfs_lookup(dev_name(m->parent), component_debugfs_dir)); 134 134 } 135 135 136 136 #else ··· 143 143 144 144 #endif 145 145 146 - static struct master *__master_find(struct device *dev, 146 + static struct master *__master_find(struct device *parent, 147 147 const struct component_master_ops *ops) 148 148 { 149 149 struct master *m; 150 150 151 151 list_for_each_entry(m, &masters, node) 152 - if (m->dev == dev && (!ops || m->ops == ops)) 152 + if (m->parent == parent && (!ops || m->ops == ops)) 153 153 return m; 154 154 155 155 return NULL; ··· 189 189 struct component_match_array *mc = &match->compare[i]; 190 190 struct component *c; 191 191 192 - dev_dbg(master->dev, "Looking for component %zu\n", i); 192 + dev_dbg(master->parent, "Looking for component %zu\n", i); 193 193 194 194 if (match->compare[i].component) 195 195 continue; ··· 200 200 break; 201 201 } 202 202 203 - dev_dbg(master->dev, "found component %s, duplicate %u\n", dev_name(c->dev), !!c->master); 203 + dev_dbg(master->parent, "found component %s, duplicate %u\n", dev_name(c->dev), !!c->master); 204 204 205 205 /* Attach this component to the master */ 206 206 match->compare[i].duplicate = !!c->master; ··· 233 233 { 234 234 int ret; 235 235 236 - dev_dbg(master->dev, "trying to bring up master\n"); 236 + dev_dbg(master->parent, "trying to bring up master\n"); 237 237 238 238 if (find_components(master)) { 239 - dev_dbg(master->dev, "master has incomplete components\n"); 239 + dev_dbg(master->parent, "master has incomplete components\n"); 240 240 return 0; 241 241 } 242 242 243 243 if (component && component->master != master) { 244 - dev_dbg(master->dev, "master is not for this component (%s)\n", 244 + dev_dbg(master->parent, "master is not for this component (%s)\n", 245 245 dev_name(component->dev)); 246 246 return 0; 247 247 } 248 248 249 - if (!devres_open_group(master->dev, NULL, GFP_KERNEL)) 249 + if (!devres_open_group(master->parent, NULL, GFP_KERNEL)) 250 250 return -ENOMEM; 251 251 252 252 /* Found all components */ 253 - ret = master->ops->bind(master->dev); 253 + ret = master->ops->bind(master->parent); 254 254 if (ret < 0) { 255 - devres_release_group(master->dev, NULL); 255 + devres_release_group(master->parent, NULL); 256 256 if (ret != -EPROBE_DEFER) 257 - dev_info(master->dev, "master bind failed: %d\n", ret); 257 + dev_info(master->parent, "master bind failed: %d\n", ret); 258 258 return ret; 259 259 } 260 260 ··· 281 281 static void take_down_master(struct master *master) 282 282 { 283 283 if (master->bound) { 284 - master->ops->unbind(master->dev); 285 - devres_release_group(master->dev, NULL); 284 + master->ops->unbind(master->parent); 285 + devres_release_group(master->parent, NULL); 286 286 master->bound = false; 287 287 } 288 288 } 289 289 290 - static void component_match_release(struct device *master, 291 - struct component_match *match) 290 + static void devm_component_match_release(struct device *parent, void *res) 292 291 { 292 + struct component_match *match = res; 293 293 unsigned int i; 294 294 295 295 for (i = 0; i < match->num; i++) { 296 296 struct component_match_array *mc = &match->compare[i]; 297 297 298 298 if (mc->release) 299 - mc->release(master, mc->data); 299 + mc->release(parent, mc->data); 300 300 } 301 301 302 302 kfree(match->compare); 303 303 } 304 304 305 - static void devm_component_match_release(struct device *dev, void *res) 306 - { 307 - component_match_release(dev, res); 308 - } 309 - 310 - static int component_match_realloc(struct device *dev, 311 - struct component_match *match, size_t num) 305 + static int component_match_realloc(struct component_match *match, size_t num) 312 306 { 313 307 struct component_match_array *new; 314 308 ··· 353 359 size_t new_size = match->alloc + 16; 354 360 int ret; 355 361 356 - ret = component_match_realloc(master, match, new_size); 362 + ret = component_match_realloc(match, new_size); 357 363 if (ret) { 358 364 *matchptr = ERR_PTR(ret); 359 365 return; ··· 445 451 446 452 /** 447 453 * component_master_add_with_match - register an aggregate driver 448 - * @dev: device with the aggregate driver 454 + * @parent: parent device of the aggregate driver 449 455 * @ops: callbacks for the aggregate driver 450 456 * @match: component match list for the aggregate driver 451 457 * ··· 455 461 * &component_master_ops.bind from @ops. Must be unregistered by calling 456 462 * component_master_del(). 457 463 */ 458 - int component_master_add_with_match(struct device *dev, 464 + int component_master_add_with_match(struct device *parent, 459 465 const struct component_master_ops *ops, 460 466 struct component_match *match) 461 467 { ··· 463 469 int ret; 464 470 465 471 /* Reallocate the match array for its true size */ 466 - ret = component_match_realloc(dev, match, match->num); 472 + ret = component_match_realloc(match, match->num); 467 473 if (ret) 468 474 return ret; 469 475 ··· 471 477 if (!master) 472 478 return -ENOMEM; 473 479 474 - master->dev = dev; 480 + master->parent = parent; 475 481 master->ops = ops; 476 482 master->match = match; 477 483 ··· 493 499 494 500 /** 495 501 * component_master_del - unregister an aggregate driver 496 - * @dev: device with the aggregate driver 502 + * @parent: parent device of the aggregate driver 497 503 * @ops: callbacks for the aggregate driver 498 504 * 499 505 * Unregisters an aggregate driver registered with 500 506 * component_master_add_with_match(). If necessary the aggregate driver is first 501 507 * disassembled by calling &component_master_ops.unbind from @ops. 502 508 */ 503 - void component_master_del(struct device *dev, 509 + void component_master_del(struct device *parent, 504 510 const struct component_master_ops *ops) 505 511 { 506 512 struct master *master; 507 513 508 514 mutex_lock(&component_mutex); 509 - master = __master_find(dev, ops); 515 + master = __master_find(parent, ops); 510 516 if (master) { 511 517 take_down_master(master); 512 518 free_master(master); ··· 521 527 WARN_ON(!component->bound); 522 528 523 529 if (component->ops && component->ops->unbind) 524 - component->ops->unbind(component->dev, master->dev, data); 530 + component->ops->unbind(component->dev, master->parent, data); 525 531 component->bound = false; 526 532 527 533 /* Release all resources claimed in the binding of this component */ ··· 530 536 531 537 /** 532 538 * component_unbind_all - unbind all components of an aggregate driver 533 - * @master_dev: device with the aggregate driver 539 + * @parent: parent device of the aggregate driver 534 540 * @data: opaque pointer, passed to all components 535 541 * 536 - * Unbinds all components of the aggregate @dev by passing @data to their 542 + * Unbinds all components of the aggregate device by passing @data to their 537 543 * &component_ops.unbind functions. Should be called from 538 544 * &component_master_ops.unbind. 539 545 */ 540 - void component_unbind_all(struct device *master_dev, void *data) 546 + void component_unbind_all(struct device *parent, void *data) 541 547 { 542 548 struct master *master; 543 549 struct component *c; ··· 545 551 546 552 WARN_ON(!mutex_is_locked(&component_mutex)); 547 553 548 - master = __master_find(master_dev, NULL); 554 + master = __master_find(parent, NULL); 549 555 if (!master) 550 556 return; 551 557 ··· 568 574 * This allows us to roll-back a failed component without 569 575 * affecting anything else. 570 576 */ 571 - if (!devres_open_group(master->dev, NULL, GFP_KERNEL)) 577 + if (!devres_open_group(master->parent, NULL, GFP_KERNEL)) 572 578 return -ENOMEM; 573 579 574 580 /* ··· 577 583 * at the appropriate moment. 578 584 */ 579 585 if (!devres_open_group(component->dev, component, GFP_KERNEL)) { 580 - devres_release_group(master->dev, NULL); 586 + devres_release_group(master->parent, NULL); 581 587 return -ENOMEM; 582 588 } 583 589 584 - dev_dbg(master->dev, "binding %s (ops %ps)\n", 590 + dev_dbg(master->parent, "binding %s (ops %ps)\n", 585 591 dev_name(component->dev), component->ops); 586 592 587 - ret = component->ops->bind(component->dev, master->dev, data); 593 + ret = component->ops->bind(component->dev, master->parent, data); 588 594 if (!ret) { 589 595 component->bound = true; 590 596 ··· 595 601 * can clean those resources up independently. 596 602 */ 597 603 devres_close_group(component->dev, NULL); 598 - devres_remove_group(master->dev, NULL); 604 + devres_remove_group(master->parent, NULL); 599 605 600 - dev_info(master->dev, "bound %s (ops %ps)\n", 606 + dev_info(master->parent, "bound %s (ops %ps)\n", 601 607 dev_name(component->dev), component->ops); 602 608 } else { 603 609 devres_release_group(component->dev, NULL); 604 - devres_release_group(master->dev, NULL); 610 + devres_release_group(master->parent, NULL); 605 611 606 612 if (ret != -EPROBE_DEFER) 607 - dev_err(master->dev, "failed to bind %s (ops %ps): %d\n", 613 + dev_err(master->parent, "failed to bind %s (ops %ps): %d\n", 608 614 dev_name(component->dev), component->ops, ret); 609 615 } 610 616 ··· 613 619 614 620 /** 615 621 * component_bind_all - bind all components of an aggregate driver 616 - * @master_dev: device with the aggregate driver 622 + * @parent: parent device of the aggregate driver 617 623 * @data: opaque pointer, passed to all components 618 624 * 619 625 * Binds all components of the aggregate @dev by passing @data to their 620 626 * &component_ops.bind functions. Should be called from 621 627 * &component_master_ops.bind. 622 628 */ 623 - int component_bind_all(struct device *master_dev, void *data) 629 + int component_bind_all(struct device *parent, void *data) 624 630 { 625 631 struct master *master; 626 632 struct component *c; ··· 629 635 630 636 WARN_ON(!mutex_is_locked(&component_mutex)); 631 637 632 - master = __master_find(master_dev, NULL); 638 + master = __master_find(parent, NULL); 633 639 if (!master) 634 640 return -EINVAL; 635 641
+1 -1
drivers/base/core.c
··· 3442 3442 * to run while we are tearing out the bus/class/sysfs from 3443 3443 * underneath the device. 3444 3444 */ 3445 - lockdep_assert_held(&dev->mutex); 3445 + device_lock_assert(dev); 3446 3446 3447 3447 if (dev->p->dead) 3448 3448 return false;
+2 -2
drivers/base/cpu.c
··· 175 175 NULL 176 176 }; 177 177 178 - static struct attribute_group crash_note_cpu_attr_group = { 178 + static const struct attribute_group crash_note_cpu_attr_group = { 179 179 .attrs = crash_note_cpu_attrs, 180 180 }; 181 181 #endif ··· 475 475 NULL 476 476 }; 477 477 478 - static struct attribute_group cpu_root_attr_group = { 478 + static const struct attribute_group cpu_root_attr_group = { 479 479 .attrs = cpu_root_attrs, 480 480 }; 481 481
-4
drivers/base/devcoredump.c
··· 3 3 * Copyright(c) 2014 Intel Mobile Communications GmbH 4 4 * Copyright(c) 2015 Intel Deutschland GmbH 5 5 * 6 - * Contact Information: 7 - * Intel Linux Wireless <ilw@linux.intel.com> 8 - * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 9 - * 10 6 * Author: Johannes Berg <johannes@sipsolutions.net> 11 7 */ 12 8 #include <linux/module.h>
+58 -69
drivers/base/devres.c
··· 14 14 #include <asm/sections.h> 15 15 16 16 #include "base.h" 17 + #include "trace.h" 17 18 18 19 struct devres_node { 19 20 struct list_head entry; 20 21 dr_release_t release; 21 - #ifdef CONFIG_DEBUG_DEVRES 22 22 const char *name; 23 23 size_t size; 24 - #endif 25 24 }; 26 25 27 26 struct devres { ··· 42 43 /* -- 8 pointers */ 43 44 }; 44 45 45 - #ifdef CONFIG_DEBUG_DEVRES 46 - static int log_devres = 0; 47 - module_param_named(log, log_devres, int, S_IRUGO | S_IWUSR); 48 - 49 46 static void set_node_dbginfo(struct devres_node *node, const char *name, 50 47 size_t size) 51 48 { ··· 49 54 node->size = size; 50 55 } 51 56 52 - static void devres_log(struct device *dev, struct devres_node *node, 57 + #ifdef CONFIG_DEBUG_DEVRES 58 + static int log_devres = 0; 59 + module_param_named(log, log_devres, int, S_IRUGO | S_IWUSR); 60 + 61 + static void devres_dbg(struct device *dev, struct devres_node *node, 53 62 const char *op) 54 63 { 55 64 if (unlikely(log_devres)) ··· 61 62 op, node, node->name, node->size); 62 63 } 63 64 #else /* CONFIG_DEBUG_DEVRES */ 64 - #define set_node_dbginfo(node, n, s) do {} while (0) 65 - #define devres_log(dev, node, op) do {} while (0) 65 + #define devres_dbg(dev, node, op) do {} while (0) 66 66 #endif /* CONFIG_DEBUG_DEVRES */ 67 + 68 + static void devres_log(struct device *dev, struct devres_node *node, 69 + const char *op) 70 + { 71 + trace_devres_log(dev, op, node, node->name, node->size); 72 + devres_dbg(dev, node, op); 73 + } 67 74 68 75 /* 69 76 * Release functions for devres group. These callbacks are used only ··· 139 134 list_replace(&old->entry, &new->entry); 140 135 } 141 136 142 - #ifdef CONFIG_DEBUG_DEVRES 143 - void * __devres_alloc_node(dr_release_t release, size_t size, gfp_t gfp, int nid, 144 - const char *name) 137 + /** 138 + * __devres_alloc_node - Allocate device resource data 139 + * @release: Release function devres will be associated with 140 + * @size: Allocation size 141 + * @gfp: Allocation flags 142 + * @nid: NUMA node 143 + * @name: Name of the resource 144 + * 145 + * Allocate devres of @size bytes. The allocated area is zeroed, then 146 + * associated with @release. The returned pointer can be passed to 147 + * other devres_*() functions. 148 + * 149 + * RETURNS: 150 + * Pointer to allocated devres on success, NULL on failure. 151 + */ 152 + void *__devres_alloc_node(dr_release_t release, size_t size, gfp_t gfp, int nid, 153 + const char *name) 145 154 { 146 155 struct devres *dr; 147 156 ··· 166 147 return dr->data; 167 148 } 168 149 EXPORT_SYMBOL_GPL(__devres_alloc_node); 169 - #else 170 - /** 171 - * devres_alloc_node - Allocate device resource data 172 - * @release: Release function devres will be associated with 173 - * @size: Allocation size 174 - * @gfp: Allocation flags 175 - * @nid: NUMA node 176 - * 177 - * Allocate devres of @size bytes. The allocated area is zeroed, then 178 - * associated with @release. The returned pointer can be passed to 179 - * other devres_*() functions. 180 - * 181 - * RETURNS: 182 - * Pointer to allocated devres on success, NULL on failure. 183 - */ 184 - void * devres_alloc_node(dr_release_t release, size_t size, gfp_t gfp, int nid) 185 - { 186 - struct devres *dr; 187 - 188 - dr = alloc_dr(release, size, gfp | __GFP_ZERO, nid); 189 - if (unlikely(!dr)) 190 - return NULL; 191 - return dr->data; 192 - } 193 - EXPORT_SYMBOL_GPL(devres_alloc_node); 194 - #endif 195 150 196 151 /** 197 152 * devres_for_each_res - Resource iterator ··· 431 438 struct list_head *first, struct list_head *end, 432 439 struct list_head *todo) 433 440 { 441 + struct devres_node *node, *n; 434 442 int cnt = 0, nr_groups = 0; 435 - struct list_head *cur; 436 443 437 444 /* First pass - move normal devres entries to @todo and clear 438 445 * devres_group colors. 439 446 */ 440 - cur = first; 441 - while (cur != end) { 442 - struct devres_node *node; 447 + node = list_entry(first, struct devres_node, entry); 448 + list_for_each_entry_safe_from(node, n, end, entry) { 443 449 struct devres_group *grp; 444 - 445 - node = list_entry(cur, struct devres_node, entry); 446 - cur = cur->next; 447 450 448 451 grp = node_to_group(node); 449 452 if (grp) { ··· 460 471 461 472 /* Second pass - Scan groups and color them. A group gets 462 473 * color value of two iff the group is wholly contained in 463 - * [cur, end). That is, for a closed group, both opening and 464 - * closing markers should be in the range, while just the 474 + * [current node, end). That is, for a closed group, both opening 475 + * and closing markers should be in the range, while just the 465 476 * opening marker is enough for an open group. 466 477 */ 467 - cur = first; 468 - while (cur != end) { 469 - struct devres_node *node; 478 + node = list_entry(first, struct devres_node, entry); 479 + list_for_each_entry_safe_from(node, n, end, entry) { 470 480 struct devres_group *grp; 471 - 472 - node = list_entry(cur, struct devres_node, entry); 473 - cur = cur->next; 474 481 475 482 grp = node_to_group(node); 476 483 BUG_ON(!grp || list_empty(&grp->node[0].entry)); ··· 477 492 478 493 BUG_ON(grp->color <= 0 || grp->color > 2); 479 494 if (grp->color == 2) { 480 - /* No need to update cur or end. The removed 495 + /* No need to update current node or end. The removed 481 496 * nodes are always before both. 482 497 */ 483 498 list_move_tail(&grp->node[0].entry, todo); ··· 488 503 return cnt; 489 504 } 490 505 491 - static int release_nodes(struct device *dev, struct list_head *first, 492 - struct list_head *end, unsigned long flags) 493 - __releases(&dev->devres_lock) 506 + static void release_nodes(struct device *dev, struct list_head *todo) 494 507 { 495 - LIST_HEAD(todo); 496 - int cnt; 497 508 struct devres *dr, *tmp; 498 - 499 - cnt = remove_nodes(dev, first, end, &todo); 500 - 501 - spin_unlock_irqrestore(&dev->devres_lock, flags); 502 509 503 510 /* Release. Note that both devres and devres_group are 504 511 * handled as devres in the following loop. This is safe. 505 512 */ 506 - list_for_each_entry_safe_reverse(dr, tmp, &todo, node.entry) { 513 + list_for_each_entry_safe_reverse(dr, tmp, todo, node.entry) { 507 514 devres_log(dev, &dr->node, "REL"); 508 515 dr->node.release(dev, dr->data); 509 516 kfree(dr); 510 517 } 511 - 512 - return cnt; 513 518 } 514 519 515 520 /** ··· 512 537 int devres_release_all(struct device *dev) 513 538 { 514 539 unsigned long flags; 540 + LIST_HEAD(todo); 541 + int cnt; 515 542 516 543 /* Looks like an uninitialized device structure */ 517 544 if (WARN_ON(dev->devres_head.next == NULL)) 518 545 return -ENODEV; 546 + 547 + /* Nothing to release if list is empty */ 548 + if (list_empty(&dev->devres_head)) 549 + return 0; 550 + 519 551 spin_lock_irqsave(&dev->devres_lock, flags); 520 - return release_nodes(dev, dev->devres_head.next, &dev->devres_head, 521 - flags); 552 + cnt = remove_nodes(dev, dev->devres_head.next, &dev->devres_head, &todo); 553 + spin_unlock_irqrestore(&dev->devres_lock, flags); 554 + 555 + release_nodes(dev, &todo); 556 + return cnt; 522 557 } 523 558 524 559 /** ··· 664 679 { 665 680 struct devres_group *grp; 666 681 unsigned long flags; 682 + LIST_HEAD(todo); 667 683 int cnt = 0; 668 684 669 685 spin_lock_irqsave(&dev->devres_lock, flags); ··· 677 691 if (!list_empty(&grp->node[1].entry)) 678 692 end = grp->node[1].entry.next; 679 693 680 - cnt = release_nodes(dev, first, end, flags); 694 + cnt = remove_nodes(dev, first, end, &todo); 695 + spin_unlock_irqrestore(&dev->devres_lock, flags); 696 + 697 + release_nodes(dev, &todo); 681 698 } else { 682 699 WARN_ON(1); 683 700 spin_unlock_irqrestore(&dev->devres_lock, flags);
-1
drivers/base/firmware_loader/builtin/Makefile
··· 8 8 obj-y := $(addsuffix .gen.o, $(subst $(quote),,$(CONFIG_EXTRA_FIRMWARE))) 9 9 10 10 FWNAME = $(patsubst $(obj)/%.gen.S,%,$@) 11 - comma := , 12 11 FWSTR = $(subst $(comma),_,$(subst /,_,$(subst .,_,$(subst -,_,$(FWNAME))))) 13 12 ASM_WORD = $(if $(CONFIG_64BIT),.quad,.long) 14 13 ASM_ALIGN = $(if $(CONFIG_64BIT),3,2)
+2 -2
drivers/base/memory.c
··· 596 596 NULL 597 597 }; 598 598 599 - static struct attribute_group memory_memblk_attr_group = { 599 + static const struct attribute_group memory_memblk_attr_group = { 600 600 .attrs = memory_memblk_attrs, 601 601 }; 602 602 ··· 772 772 NULL 773 773 }; 774 774 775 - static struct attribute_group memory_root_attr_group = { 775 + static const struct attribute_group memory_root_attr_group = { 776 776 .attrs = memory_root_attrs, 777 777 }; 778 778
+2 -2
drivers/base/node.c
··· 233 233 return sysfs_emit(buf, fmt "\n", \ 234 234 to_cache_info(dev)->cache_attrs.name); \ 235 235 } \ 236 - DEVICE_ATTR_RO(name); 236 + static DEVICE_ATTR_RO(name); 237 237 238 238 CACHE_ATTR(size, "%llu") 239 239 CACHE_ATTR(line_size, "%u") ··· 1038 1038 NULL 1039 1039 }; 1040 1040 1041 - static struct attribute_group memory_root_attr_group = { 1041 + static const struct attribute_group memory_root_attr_group = { 1042 1042 .attrs = node_state_attrs, 1043 1043 }; 1044 1044
+1 -21
drivers/base/platform.c
··· 125 125 EXPORT_SYMBOL_GPL(devm_platform_ioremap_resource); 126 126 127 127 /** 128 - * devm_platform_ioremap_resource_wc - write-combined variant of 129 - * devm_platform_ioremap_resource() 130 - * 131 - * @pdev: platform device to use both for memory resource lookup as well as 132 - * resource management 133 - * @index: resource index 134 - * 135 - * Return: a pointer to the remapped memory or an ERR_PTR() encoded error code 136 - * on failure. 137 - */ 138 - void __iomem *devm_platform_ioremap_resource_wc(struct platform_device *pdev, 139 - unsigned int index) 140 - { 141 - struct resource *res; 142 - 143 - res = platform_get_resource(pdev, IORESOURCE_MEM, index); 144 - return devm_ioremap_resource_wc(&pdev->dev, res); 145 - } 146 - 147 - /** 148 128 * devm_platform_ioremap_resource_byname - call devm_ioremap_resource for 149 129 * a platform device, retrieve the 150 130 * resource by name ··· 1335 1355 return a->mode; 1336 1356 } 1337 1357 1338 - static struct attribute_group platform_dev_group = { 1358 + static const struct attribute_group platform_dev_group = { 1339 1359 .attrs = platform_dev_attrs, 1340 1360 .is_visible = platform_dev_attrs_visible, 1341 1361 };
+8 -8
drivers/base/property.c
··· 627 627 */ 628 628 struct device *fwnode_get_next_parent_dev(struct fwnode_handle *fwnode) 629 629 { 630 - struct device *dev = NULL; 630 + struct device *dev; 631 631 632 632 fwnode_handle_get(fwnode); 633 633 do { 634 634 fwnode = fwnode_get_next_parent(fwnode); 635 - if (fwnode) 636 - dev = get_dev_from_fwnode(fwnode); 637 - } while (fwnode && !dev); 635 + if (!fwnode) 636 + return NULL; 637 + dev = get_dev_from_fwnode(fwnode); 638 + } while (!dev); 638 639 fwnode_handle_put(fwnode); 639 640 return dev; 640 641 } ··· 743 742 744 743 do { 745 744 next_child = fwnode_get_next_child_node(fwnode, next_child); 746 - 747 - if (!next_child || fwnode_device_is_available(next_child)) 748 - break; 749 - } while (next_child); 745 + if (!next_child) 746 + return NULL; 747 + } while (!fwnode_device_is_available(next_child)); 750 748 751 749 return next_child; 752 750 }
+10
drivers/base/trace.c
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + /* 3 + * Device core Trace Support 4 + * Copyright (C) 2021, Intel Corporation 5 + * 6 + * Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com> 7 + */ 8 + 9 + #define CREATE_TRACE_POINTS 10 + #include "trace.h"
+56
drivers/base/trace.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + /* 3 + * Device core Trace Support 4 + * Copyright (C) 2021, Intel Corporation 5 + * 6 + * Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com> 7 + */ 8 + 9 + #undef TRACE_SYSTEM 10 + #define TRACE_SYSTEM dev 11 + 12 + #if !defined(__DEV_TRACE_H) || defined(TRACE_HEADER_MULTI_READ) 13 + #define __DEV_TRACE_H 14 + 15 + #include <linux/device.h> 16 + #include <linux/tracepoint.h> 17 + #include <linux/types.h> 18 + 19 + DECLARE_EVENT_CLASS(devres, 20 + TP_PROTO(struct device *dev, const char *op, void *node, const char *name, size_t size), 21 + TP_ARGS(dev, op, node, name, size), 22 + TP_STRUCT__entry( 23 + __string(devname, dev_name(dev)) 24 + __field(struct device *, dev) 25 + __field(const char *, op) 26 + __field(void *, node) 27 + __field(const char *, name) 28 + __field(size_t, size) 29 + ), 30 + TP_fast_assign( 31 + __assign_str(devname, dev_name(dev)); 32 + __entry->op = op; 33 + __entry->node = node; 34 + __entry->name = name; 35 + __entry->size = size; 36 + ), 37 + TP_printk("%s %3s %p %s (%zu bytes)", __get_str(devname), 38 + __entry->op, __entry->node, __entry->name, __entry->size) 39 + ); 40 + 41 + DEFINE_EVENT(devres, devres_log, 42 + TP_PROTO(struct device *dev, const char *op, void *node, const char *name, size_t size), 43 + TP_ARGS(dev, op, node, name, size) 44 + ); 45 + 46 + #endif /* __DEV_TRACE_H */ 47 + 48 + /* this part has to be here */ 49 + 50 + #undef TRACE_INCLUDE_PATH 51 + #define TRACE_INCLUDE_PATH . 52 + 53 + #undef TRACE_INCLUDE_FILE 54 + #define TRACE_INCLUDE_FILE trace 55 + 56 + #include <trace/define_trace.h>
+1 -1
drivers/dma/imx-sdma.c
··· 1883 1883 int ret; 1884 1884 1885 1885 ret = request_firmware_nowait(THIS_MODULE, 1886 - FW_ACTION_HOTPLUG, fw_name, sdma->dev, 1886 + FW_ACTION_UEVENT, fw_name, sdma->dev, 1887 1887 GFP_KERNEL, sdma, sdma_load_firmware); 1888 1888 1889 1889 return ret;
+5 -6
drivers/gpu/drm/i915/gvt/kvmgt.c
··· 88 88 struct hlist_node hnode; 89 89 }; 90 90 91 + #define KVMGT_DEBUGFS_FILENAME "kvmgt_nr_cache_entries" 91 92 struct kvmgt_guest_info { 92 93 struct kvm *kvm; 93 94 struct intel_vgpu *vgpu; ··· 96 95 #define NR_BKT (1 << 18) 97 96 struct hlist_head ptable[NR_BKT]; 98 97 #undef NR_BKT 99 - struct dentry *debugfs_cache_entries; 100 98 }; 101 99 102 100 struct gvt_dma { ··· 1947 1947 info->track_node.track_flush_slot = kvmgt_page_track_flush_slot; 1948 1948 kvm_page_track_register_notifier(kvm, &info->track_node); 1949 1949 1950 - info->debugfs_cache_entries = debugfs_create_ulong( 1951 - "kvmgt_nr_cache_entries", 1952 - 0444, vgpu->debugfs, 1953 - &vdev->nr_cache_entries); 1950 + debugfs_create_ulong(KVMGT_DEBUGFS_FILENAME, 0444, vgpu->debugfs, 1951 + &vdev->nr_cache_entries); 1954 1952 return 0; 1955 1953 } 1956 1954 1957 1955 static bool kvmgt_guest_exit(struct kvmgt_guest_info *info) 1958 1956 { 1959 - debugfs_remove(info->debugfs_cache_entries); 1957 + debugfs_remove(debugfs_lookup(KVMGT_DEBUGFS_FILENAME, 1958 + info->vgpu->debugfs)); 1960 1959 1961 1960 kvm_page_track_unregister_notifier(info->kvm, &info->track_node); 1962 1961 kvm_put_kvm(info->kvm);
+1 -1
drivers/media/platform/exynos4-is/fimc-is.c
··· 436 436 static int fimc_is_request_firmware(struct fimc_is *is, const char *fw_name) 437 437 { 438 438 return request_firmware_nowait(THIS_MODULE, 439 - FW_ACTION_HOTPLUG, fw_name, &is->pdev->dev, 439 + FW_ACTION_UEVENT, fw_name, &is->pdev->dev, 440 440 GFP_KERNEL, is, fimc_is_load_firmware); 441 441 } 442 442
+1 -1
drivers/mfd/iqs62x.c
··· 998 998 999 999 device_property_read_string(&client->dev, "firmware-name", &fw_name); 1000 1000 1001 - ret = request_firmware_nowait(THIS_MODULE, FW_ACTION_HOTPLUG, 1001 + ret = request_firmware_nowait(THIS_MODULE, FW_ACTION_UEVENT, 1002 1002 fw_name ? : iqs62x->dev_desc->fw_name, 1003 1003 &client->dev, GFP_KERNEL, iqs62x, 1004 1004 iqs62x_firmware_load);
+1 -1
drivers/misc/lattice-ecp3-config.c
··· 198 198 spi_set_drvdata(spi, data); 199 199 200 200 init_completion(&data->fw_loaded); 201 - err = request_firmware_nowait(THIS_MODULE, FW_ACTION_HOTPLUG, 201 + err = request_firmware_nowait(THIS_MODULE, FW_ACTION_UEVENT, 202 202 FIRMWARE_NAME, &spi->dev, 203 203 GFP_KERNEL, spi, firmware_load); 204 204 if (err) {
+4 -2
drivers/misc/sram.c
··· 341 341 { 342 342 struct sram_dev *sram; 343 343 int ret; 344 + struct resource *res; 344 345 int (*init_func)(void); 345 346 346 347 sram = devm_kzalloc(&pdev->dev, sizeof(*sram), GFP_KERNEL); ··· 350 349 351 350 sram->dev = &pdev->dev; 352 351 352 + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 353 353 if (of_property_read_bool(pdev->dev.of_node, "no-memory-wc")) 354 - sram->virt_base = devm_platform_ioremap_resource(pdev, 0); 354 + sram->virt_base = devm_ioremap_resource(&pdev->dev, res); 355 355 else 356 - sram->virt_base = devm_platform_ioremap_resource_wc(pdev, 0); 356 + sram->virt_base = devm_ioremap_resource_wc(&pdev->dev, res); 357 357 if (IS_ERR(sram->virt_base)) { 358 358 dev_err(&pdev->dev, "could not map SRAM registers\n"); 359 359 return PTR_ERR(sram->virt_base);
+5 -29
drivers/net/wireless/broadcom/b43/debugfs.c
··· 643 643 return enabled; 644 644 } 645 645 646 - static void b43_remove_dynamic_debug(struct b43_wldev *dev) 647 - { 648 - struct b43_dfsentry *e = dev->dfsentry; 649 - int i; 650 - 651 - for (i = 0; i < __B43_NR_DYNDBG; i++) 652 - debugfs_remove(e->dyn_debug_dentries[i]); 653 - } 654 - 655 646 static void b43_add_dynamic_debug(struct b43_wldev *dev) 656 647 { 657 648 struct b43_dfsentry *e = dev->dfsentry; 658 649 659 650 #define add_dyn_dbg(name, id, initstate) do { \ 660 651 e->dyn_debug[id] = (initstate); \ 661 - e->dyn_debug_dentries[id] = \ 662 - debugfs_create_bool(name, 0600, e->subdir, \ 663 - &(e->dyn_debug[id])); \ 652 + debugfs_create_bool(name, 0600, e->subdir, \ 653 + &(e->dyn_debug[id])); \ 664 654 } while (0) 665 655 666 656 add_dyn_dbg("debug_xmitpower", B43_DBG_XMITPOWER, false); ··· 703 713 704 714 #define ADD_FILE(name, mode) \ 705 715 do { \ 706 - e->file_##name.dentry = \ 707 - debugfs_create_file(__stringify(name), \ 708 - mode, e->subdir, dev, \ 709 - &fops_##name.fops); \ 716 + debugfs_create_file(__stringify(name), \ 717 + mode, e->subdir, dev, \ 718 + &fops_##name.fops); \ 710 719 } while (0) 711 720 712 721 ··· 735 746 e = dev->dfsentry; 736 747 if (!e) 737 748 return; 738 - b43_remove_dynamic_debug(dev); 739 - 740 - debugfs_remove(e->file_shm16read.dentry); 741 - debugfs_remove(e->file_shm16write.dentry); 742 - debugfs_remove(e->file_shm32read.dentry); 743 - debugfs_remove(e->file_shm32write.dentry); 744 - debugfs_remove(e->file_mmio16read.dentry); 745 - debugfs_remove(e->file_mmio16write.dentry); 746 - debugfs_remove(e->file_mmio32read.dentry); 747 - debugfs_remove(e->file_mmio32write.dentry); 748 - debugfs_remove(e->file_txstat.dentry); 749 - debugfs_remove(e->file_restart.dentry); 750 - debugfs_remove(e->file_loctls.dentry); 751 749 752 750 debugfs_remove(e->subdir); 753 751 kfree(e->txstatlog.log);
-3
drivers/net/wireless/broadcom/b43/debugfs.h
··· 32 32 }; 33 33 34 34 struct b43_dfs_file { 35 - struct dentry *dentry; 36 35 char *buffer; 37 36 size_t data_len; 38 37 }; ··· 69 70 70 71 /* Enabled/Disabled list for the dynamic debugging features. */ 71 72 bool dyn_debug[__B43_NR_DYNDBG]; 72 - /* Dentries for the dynamic debugging entries. */ 73 - struct dentry *dyn_debug_dentries[__B43_NR_DYNDBG]; 74 73 }; 75 74 76 75 bool b43_debug(struct b43_wldev *dev, enum b43_dyndbg feature);
+5 -24
drivers/net/wireless/broadcom/b43legacy/debugfs.c
··· 336 336 return !!(dev->dfsentry && dev->dfsentry->dyn_debug[feature]); 337 337 } 338 338 339 - static void b43legacy_remove_dynamic_debug(struct b43legacy_wldev *dev) 340 - { 341 - struct b43legacy_dfsentry *e = dev->dfsentry; 342 - int i; 343 - 344 - for (i = 0; i < __B43legacy_NR_DYNDBG; i++) 345 - debugfs_remove(e->dyn_debug_dentries[i]); 346 - } 347 - 348 339 static void b43legacy_add_dynamic_debug(struct b43legacy_wldev *dev) 349 340 { 350 341 struct b43legacy_dfsentry *e = dev->dfsentry; 351 342 352 343 #define add_dyn_dbg(name, id, initstate) do { \ 353 344 e->dyn_debug[id] = (initstate); \ 354 - e->dyn_debug_dentries[id] = \ 355 - debugfs_create_bool(name, 0600, e->subdir, \ 356 - &(e->dyn_debug[id])); \ 345 + debugfs_create_bool(name, 0600, e->subdir, \ 346 + &(e->dyn_debug[id])); \ 357 347 } while (0) 358 348 359 349 add_dyn_dbg("debug_xmitpower", B43legacy_DBG_XMITPOWER, false); ··· 386 396 387 397 #define ADD_FILE(name, mode) \ 388 398 do { \ 389 - e->file_##name.dentry = \ 390 - debugfs_create_file(__stringify(name), \ 391 - mode, e->subdir, dev, \ 392 - &fops_##name.fops); \ 393 - e->file_##name.dentry = NULL; \ 399 + debugfs_create_file(__stringify(name), mode, \ 400 + e->subdir, dev, \ 401 + &fops_##name.fops); \ 394 402 } while (0) 395 403 396 404 ··· 412 424 e = dev->dfsentry; 413 425 if (!e) 414 426 return; 415 - b43legacy_remove_dynamic_debug(dev); 416 - 417 - debugfs_remove(e->file_tsf.dentry); 418 - debugfs_remove(e->file_ucode_regs.dentry); 419 - debugfs_remove(e->file_shm.dentry); 420 - debugfs_remove(e->file_txstat.dentry); 421 - debugfs_remove(e->file_restart.dentry); 422 427 423 428 debugfs_remove(e->subdir); 424 429 kfree(e->txstatlog.log);
-3
drivers/net/wireless/broadcom/b43legacy/debugfs.h
··· 28 28 }; 29 29 30 30 struct b43legacy_dfs_file { 31 - struct dentry *dentry; 32 31 char *buffer; 33 32 size_t data_len; 34 33 }; ··· 48 49 49 50 /* Enabled/Disabled list for the dynamic debugging features. */ 50 51 bool dyn_debug[__B43legacy_NR_DYNDBG]; 51 - /* Dentries for the dynamic debugging entries. */ 52 - struct dentry *dyn_debug_dentries[__B43legacy_NR_DYNDBG]; 53 52 }; 54 53 55 54 int b43legacy_debug(struct b43legacy_wldev *dev,
+1 -1
drivers/net/wireless/ti/wlcore/main.c
··· 6784 6784 6785 6785 if (pdev_data->family && pdev_data->family->nvs_name) { 6786 6786 nvs_name = pdev_data->family->nvs_name; 6787 - ret = request_firmware_nowait(THIS_MODULE, FW_ACTION_HOTPLUG, 6787 + ret = request_firmware_nowait(THIS_MODULE, FW_ACTION_UEVENT, 6788 6788 nvs_name, &pdev->dev, GFP_KERNEL, 6789 6789 wl, wlcore_nvs_cb); 6790 6790 if (ret < 0) {
+1 -1
drivers/platform/x86/dell/dell_rbu.c
··· 573 573 if (!rbu_data.entry_created) { 574 574 spin_unlock(&rbu_data.lock); 575 575 req_firm_rc = request_firmware_nowait(THIS_MODULE, 576 - FW_ACTION_NOHOTPLUG, "dell_rbu", 576 + FW_ACTION_NOUEVENT, "dell_rbu", 577 577 &rbu_device->dev, GFP_KERNEL, &context, 578 578 callbackfn_rbu); 579 579 if (req_firm_rc) {
+1 -1
drivers/remoteproc/remoteproc_core.c
··· 1789 1789 * We're initiating an asynchronous firmware loading, so we can 1790 1790 * be built-in kernel code, without hanging the boot process. 1791 1791 */ 1792 - ret = request_firmware_nowait(THIS_MODULE, FW_ACTION_HOTPLUG, 1792 + ret = request_firmware_nowait(THIS_MODULE, FW_ACTION_UEVENT, 1793 1793 rproc->firmware, &rproc->dev, GFP_KERNEL, 1794 1794 rproc, rproc_auto_boot_callback); 1795 1795 if (ret < 0)
+1 -1
drivers/scsi/lpfc/lpfc_init.c
··· 13146 13146 snprintf(file_name, ELX_MODEL_NAME_SIZE, "%s.grp", phba->ModelName); 13147 13147 13148 13148 if (fw_upgrade == INT_FW_UPGRADE) { 13149 - ret = request_firmware_nowait(THIS_MODULE, FW_ACTION_HOTPLUG, 13149 + ret = request_firmware_nowait(THIS_MODULE, FW_ACTION_UEVENT, 13150 13150 file_name, &phba->pcidev->dev, 13151 13151 GFP_KERNEL, (void *)phba, 13152 13152 lpfc_write_firmware);
+8 -13
drivers/scsi/snic/snic_debugfs.c
··· 430 430 431 431 DEFINE_SEQ_ATTRIBUTE(snic_trc); 432 432 433 + #define TRC_ENABLE_FILE "tracing_enable" 434 + #define TRC_FILE "trace" 433 435 /* 434 436 * snic_trc_debugfs_init : creates trace/tracing_enable files for trace 435 437 * under debugfs 436 438 */ 437 439 void snic_trc_debugfs_init(void) 438 440 { 439 - snic_glob->trc.trc_enable = debugfs_create_bool("tracing_enable", 440 - S_IFREG | S_IRUGO | S_IWUSR, 441 - snic_glob->trc_root, 442 - &snic_glob->trc.enable); 441 + debugfs_create_bool(TRC_ENABLE_FILE, S_IFREG | S_IRUGO | S_IWUSR, 442 + snic_glob->trc_root, &snic_glob->trc.enable); 443 443 444 - snic_glob->trc.trc_file = debugfs_create_file("trace", 445 - S_IFREG | S_IRUGO | S_IWUSR, 446 - snic_glob->trc_root, NULL, 447 - &snic_trc_fops); 444 + debugfs_create_file(TRC_FILE, S_IFREG | S_IRUGO | S_IWUSR, 445 + snic_glob->trc_root, NULL, &snic_trc_fops); 448 446 } 449 447 450 448 /* ··· 451 453 void 452 454 snic_trc_debugfs_term(void) 453 455 { 454 - debugfs_remove(snic_glob->trc.trc_file); 455 - snic_glob->trc.trc_file = NULL; 456 - 457 - debugfs_remove(snic_glob->trc.trc_enable); 458 - snic_glob->trc.trc_enable = NULL; 456 + debugfs_remove(debugfs_lookup(TRC_FILE, snic_glob->trc_root)); 457 + debugfs_remove(debugfs_lookup(TRC_ENABLE_FILE, snic_glob->trc_root)); 459 458 }
-3
drivers/scsi/snic/snic_trc.h
··· 46 46 u32 rd_idx; 47 47 u32 wr_idx; 48 48 bool enable; /* Control Variable for Tracing */ 49 - 50 - struct dentry *trc_enable; /* debugfs file object */ 51 - struct dentry *trc_file; 52 49 }; 53 50 54 51 int snic_trc_init(void);
+1 -1
drivers/tty/serial/ucc_uart.c
··· 1227 1227 * kernel, then we use it. 1228 1228 */ 1229 1229 ret = request_firmware_nowait(THIS_MODULE, 1230 - FW_ACTION_HOTPLUG, filename, &ofdev->dev, 1230 + FW_ACTION_UEVENT, filename, &ofdev->dev, 1231 1231 GFP_KERNEL, &ofdev->dev, uart_firmware_cont); 1232 1232 if (ret) { 1233 1233 dev_err(&ofdev->dev,
+10 -28
fs/debugfs/file.c
··· 582 582 * This function creates a file in debugfs with the given name that 583 583 * contains the value of the variable @value. If the @mode variable is so 584 584 * set, it can be read from, and written to. 585 - * 586 - * This function will return a pointer to a dentry if it succeeds. This 587 - * pointer must be passed to the debugfs_remove() function when the file is 588 - * to be removed (no automatic cleanup happens if your module is unloaded, 589 - * you are responsible here.) If an error occurs, ERR_PTR(-ERROR) will be 590 - * returned. 591 - * 592 - * If debugfs is not enabled in the kernel, the value ERR_PTR(-ENODEV) will 593 - * be returned. 594 585 */ 595 - struct dentry *debugfs_create_ulong(const char *name, umode_t mode, 596 - struct dentry *parent, unsigned long *value) 586 + void debugfs_create_ulong(const char *name, umode_t mode, struct dentry *parent, 587 + unsigned long *value) 597 588 { 598 - return debugfs_create_mode_unsafe(name, mode, parent, value, 599 - &fops_ulong, &fops_ulong_ro, 600 - &fops_ulong_wo); 589 + debugfs_create_mode_unsafe(name, mode, parent, value, &fops_ulong, 590 + &fops_ulong_ro, &fops_ulong_wo); 601 591 } 602 592 EXPORT_SYMBOL_GPL(debugfs_create_ulong); 603 593 ··· 836 846 * This function creates a file in debugfs with the given name that 837 847 * contains the value of the variable @value. If the @mode variable is so 838 848 * set, it can be read from, and written to. 839 - * 840 - * This function will return a pointer to a dentry if it succeeds. This 841 - * pointer must be passed to the debugfs_remove() function when the file is 842 - * to be removed (no automatic cleanup happens if your module is unloaded, 843 - * you are responsible here.) If an error occurs, ERR_PTR(-ERROR) will be 844 - * returned. 845 - * 846 - * If debugfs is not enabled in the kernel, the value ERR_PTR(-ENODEV) will 847 - * be returned. 848 849 */ 849 - struct dentry *debugfs_create_bool(const char *name, umode_t mode, 850 - struct dentry *parent, bool *value) 850 + void debugfs_create_bool(const char *name, umode_t mode, struct dentry *parent, 851 + bool *value) 851 852 { 852 - return debugfs_create_mode_unsafe(name, mode, parent, value, &fops_bool, 853 + debugfs_create_mode_unsafe(name, mode, parent, value, &fops_bool, 853 854 &fops_bool_ro, &fops_bool_wo); 854 855 } 855 856 EXPORT_SYMBOL_GPL(debugfs_create_bool); ··· 961 980 /** 962 981 * debugfs_create_blob - create a debugfs file that is used to read a binary blob 963 982 * @name: a pointer to a string containing the name of the file to create. 964 - * @mode: the permission that the file should have 983 + * @mode: the read permission that the file should have (other permissions are 984 + * masked out) 965 985 * @parent: a pointer to the parent dentry for this file. This should be a 966 986 * directory dentry if set. If this parameter is %NULL, then the 967 987 * file will be created in the root of the debugfs filesystem. ··· 986 1004 struct dentry *parent, 987 1005 struct debugfs_blob_wrapper *blob) 988 1006 { 989 - return debugfs_create_file_unsafe(name, mode, parent, blob, &fops_blob); 1007 + return debugfs_create_file_unsafe(name, mode & 0444, parent, blob, &fops_blob); 990 1008 } 991 1009 EXPORT_SYMBOL_GPL(debugfs_create_blob); 992 1010
+43 -43
fs/kernfs/dir.c
··· 548 548 } 549 549 EXPORT_SYMBOL_GPL(kernfs_put); 550 550 551 - static int kernfs_dop_revalidate(struct dentry *dentry, unsigned int flags) 552 - { 553 - struct kernfs_node *kn; 554 - 555 - if (flags & LOOKUP_RCU) 556 - return -ECHILD; 557 - 558 - /* Always perform fresh lookup for negatives */ 559 - if (d_really_is_negative(dentry)) 560 - goto out_bad_unlocked; 561 - 562 - kn = kernfs_dentry_node(dentry); 563 - mutex_lock(&kernfs_mutex); 564 - 565 - /* The kernfs node has been deactivated */ 566 - if (!kernfs_active(kn)) 567 - goto out_bad; 568 - 569 - /* The kernfs node has been moved? */ 570 - if (kernfs_dentry_node(dentry->d_parent) != kn->parent) 571 - goto out_bad; 572 - 573 - /* The kernfs node has been renamed */ 574 - if (strcmp(dentry->d_name.name, kn->name) != 0) 575 - goto out_bad; 576 - 577 - /* The kernfs node has been moved to a different namespace */ 578 - if (kn->parent && kernfs_ns_enabled(kn->parent) && 579 - kernfs_info(dentry->d_sb)->ns != kn->ns) 580 - goto out_bad; 581 - 582 - mutex_unlock(&kernfs_mutex); 583 - return 1; 584 - out_bad: 585 - mutex_unlock(&kernfs_mutex); 586 - out_bad_unlocked: 587 - return 0; 588 - } 589 - 590 - const struct dentry_operations kernfs_dops = { 591 - .d_revalidate = kernfs_dop_revalidate, 592 - }; 593 - 594 551 /** 595 552 * kernfs_node_from_dentry - determine kernfs_node associated with a dentry 596 553 * @dentry: the dentry in question ··· 1029 1072 kernfs_put(kn); 1030 1073 return ERR_PTR(rc); 1031 1074 } 1075 + 1076 + static int kernfs_dop_revalidate(struct dentry *dentry, unsigned int flags) 1077 + { 1078 + struct kernfs_node *kn; 1079 + 1080 + if (flags & LOOKUP_RCU) 1081 + return -ECHILD; 1082 + 1083 + /* Always perform fresh lookup for negatives */ 1084 + if (d_really_is_negative(dentry)) 1085 + goto out_bad_unlocked; 1086 + 1087 + kn = kernfs_dentry_node(dentry); 1088 + mutex_lock(&kernfs_mutex); 1089 + 1090 + /* The kernfs node has been deactivated */ 1091 + if (!kernfs_active(kn)) 1092 + goto out_bad; 1093 + 1094 + /* The kernfs node has been moved? */ 1095 + if (kernfs_dentry_node(dentry->d_parent) != kn->parent) 1096 + goto out_bad; 1097 + 1098 + /* The kernfs node has been renamed */ 1099 + if (strcmp(dentry->d_name.name, kn->name) != 0) 1100 + goto out_bad; 1101 + 1102 + /* The kernfs node has been moved to a different namespace */ 1103 + if (kn->parent && kernfs_ns_enabled(kn->parent) && 1104 + kernfs_info(dentry->d_sb)->ns != kn->ns) 1105 + goto out_bad; 1106 + 1107 + mutex_unlock(&kernfs_mutex); 1108 + return 1; 1109 + out_bad: 1110 + mutex_unlock(&kernfs_mutex); 1111 + out_bad_unlocked: 1112 + return 0; 1113 + } 1114 + 1115 + const struct dentry_operations kernfs_dops = { 1116 + .d_revalidate = kernfs_dop_revalidate, 1117 + }; 1032 1118 1033 1119 static struct dentry *kernfs_iop_lookup(struct inode *dir, 1034 1120 struct dentry *dentry,
+9 -17
include/linux/debugfs.h
··· 112 112 u32 *value); 113 113 void debugfs_create_u64(const char *name, umode_t mode, struct dentry *parent, 114 114 u64 *value); 115 - struct dentry *debugfs_create_ulong(const char *name, umode_t mode, 116 - struct dentry *parent, unsigned long *value); 115 + void debugfs_create_ulong(const char *name, umode_t mode, struct dentry *parent, 116 + unsigned long *value); 117 117 void debugfs_create_x8(const char *name, umode_t mode, struct dentry *parent, 118 118 u8 *value); 119 119 void debugfs_create_x16(const char *name, umode_t mode, struct dentry *parent, ··· 126 126 struct dentry *parent, size_t *value); 127 127 void debugfs_create_atomic_t(const char *name, umode_t mode, 128 128 struct dentry *parent, atomic_t *value); 129 - struct dentry *debugfs_create_bool(const char *name, umode_t mode, 130 - struct dentry *parent, bool *value); 129 + void debugfs_create_bool(const char *name, umode_t mode, struct dentry *parent, 130 + bool *value); 131 131 void debugfs_create_str(const char *name, umode_t mode, 132 132 struct dentry *parent, char **value); 133 133 ··· 266 266 static inline void debugfs_create_u64(const char *name, umode_t mode, 267 267 struct dentry *parent, u64 *value) { } 268 268 269 - static inline struct dentry *debugfs_create_ulong(const char *name, 270 - umode_t mode, 271 - struct dentry *parent, 272 - unsigned long *value) 273 - { 274 - return ERR_PTR(-ENODEV); 275 - } 269 + static inline void debugfs_create_ulong(const char *name, umode_t mode, 270 + struct dentry *parent, 271 + unsigned long *value) { } 276 272 277 273 static inline void debugfs_create_x8(const char *name, umode_t mode, 278 274 struct dentry *parent, u8 *value) { } ··· 291 295 atomic_t *value) 292 296 { } 293 297 294 - static inline struct dentry *debugfs_create_bool(const char *name, umode_t mode, 295 - struct dentry *parent, 296 - bool *value) 297 - { 298 - return ERR_PTR(-ENODEV); 299 - } 298 + static inline void debugfs_create_bool(const char *name, umode_t mode, 299 + struct dentry *parent, bool *value) { } 300 300 301 301 static inline void debugfs_create_str(const char *name, umode_t mode, 302 302 struct dentry *parent,
-9
include/linux/device.h
··· 165 165 typedef void (*dr_release_t)(struct device *dev, void *res); 166 166 typedef int (*dr_match_t)(struct device *dev, void *res, void *match_data); 167 167 168 - #ifdef CONFIG_DEBUG_DEVRES 169 168 void *__devres_alloc_node(dr_release_t release, size_t size, gfp_t gfp, 170 169 int nid, const char *name) __malloc; 171 170 #define devres_alloc(release, size, gfp) \ 172 171 __devres_alloc_node(release, size, gfp, NUMA_NO_NODE, #release) 173 172 #define devres_alloc_node(release, size, gfp, nid) \ 174 173 __devres_alloc_node(release, size, gfp, nid, #release) 175 - #else 176 - void *devres_alloc_node(dr_release_t release, size_t size, 177 - gfp_t gfp, int nid) __malloc; 178 - static inline void *devres_alloc(dr_release_t release, size_t size, gfp_t gfp) 179 - { 180 - return devres_alloc_node(release, size, gfp, NUMA_NO_NODE); 181 - } 182 - #endif 183 174 184 175 void devres_for_each_res(struct device *dev, dr_release_t release, 185 176 dr_match_t match, void *match_data,
+5
include/linux/export.h
··· 140 140 #define ___cond_export_sym(sym, sec, ns, enabled) \ 141 141 __cond_export_sym_##enabled(sym, sec, ns) 142 142 #define __cond_export_sym_1(sym, sec, ns) ___EXPORT_SYMBOL(sym, sec, ns) 143 + 144 + #ifdef __GENKSYMS__ 145 + #define __cond_export_sym_0(sym, sec, ns) __GENKSYMS_EXPORT_SYMBOL(sym) 146 + #else 143 147 #define __cond_export_sym_0(sym, sec, ns) /* nothing */ 148 + #endif 144 149 145 150 #else 146 151
+2 -2
include/linux/firmware.h
··· 6 6 #include <linux/compiler.h> 7 7 #include <linux/gfp.h> 8 8 9 - #define FW_ACTION_NOHOTPLUG 0 10 - #define FW_ACTION_HOTPLUG 1 9 + #define FW_ACTION_NOUEVENT 0 10 + #define FW_ACTION_UEVENT 1 11 11 12 12 struct firmware { 13 13 size_t size;
-3
include/linux/platform_device.h
··· 66 66 devm_platform_ioremap_resource(struct platform_device *pdev, 67 67 unsigned int index); 68 68 extern void __iomem * 69 - devm_platform_ioremap_resource_wc(struct platform_device *pdev, 70 - unsigned int index); 71 - extern void __iomem * 72 69 devm_platform_ioremap_resource_byname(struct platform_device *pdev, 73 70 const char *name); 74 71 extern int platform_get_irq(struct platform_device *, unsigned int);
+3 -1
lib/devres.c
··· 157 157 dev_name(dev), res->name); 158 158 else 159 159 pretty_name = devm_kstrdup(dev, dev_name(dev), GFP_KERNEL); 160 - if (!pretty_name) 160 + if (!pretty_name) { 161 + dev_err(dev, "can't generate pretty name for resource %pR\n", res); 161 162 return IOMEM_ERR_PTR(-ENOMEM); 163 + } 162 164 163 165 if (!devm_request_mem_region(dev, res->start, size, pretty_name)) { 164 166 dev_err(dev, "can't request region for resource %pR\n", res);
+5 -5
lib/test_firmware.c
··· 260 260 len += scnprintf(buf + len, PAGE_SIZE - len, 261 261 "send_uevent:\t\t%s\n", 262 262 test_fw_config->send_uevent ? 263 - "FW_ACTION_HOTPLUG" : 264 - "FW_ACTION_NOHOTPLUG"); 263 + "FW_ACTION_UEVENT" : 264 + "FW_ACTION_NOUEVENT"); 265 265 len += scnprintf(buf + len, PAGE_SIZE - len, 266 266 "into_buf:\t\t%s\n", 267 267 test_fw_config->into_buf ? "true" : "false"); ··· 729 729 mutex_lock(&test_fw_mutex); 730 730 release_firmware(test_firmware); 731 731 test_firmware = NULL; 732 - rc = request_firmware_nowait(THIS_MODULE, FW_ACTION_NOHOTPLUG, name, 732 + rc = request_firmware_nowait(THIS_MODULE, FW_ACTION_NOUEVENT, name, 733 733 dev, GFP_KERNEL, NULL, 734 734 trigger_async_request_cb); 735 735 if (rc) { ··· 938 938 pr_info("batched loading '%s' custom fallback mechanism %u times\n", 939 939 test_fw_config->name, test_fw_config->num_requests); 940 940 941 - send_uevent = test_fw_config->send_uevent ? FW_ACTION_HOTPLUG : 942 - FW_ACTION_NOHOTPLUG; 941 + send_uevent = test_fw_config->send_uevent ? FW_ACTION_UEVENT : 942 + FW_ACTION_NOUEVENT; 943 943 944 944 for (i = 0; i < test_fw_config->num_requests; i++) { 945 945 req = &test_fw_config->reqs[i];
+3 -3
sound/soc/codecs/wm8958-dsp2.c
··· 912 912 913 913 914 914 /* We don't *require* firmware and don't want to delay boot */ 915 - request_firmware_nowait(THIS_MODULE, FW_ACTION_HOTPLUG, 915 + request_firmware_nowait(THIS_MODULE, FW_ACTION_UEVENT, 916 916 "wm8958_mbc.wfw", component->dev, GFP_KERNEL, 917 917 component, wm8958_mbc_loaded); 918 - request_firmware_nowait(THIS_MODULE, FW_ACTION_HOTPLUG, 918 + request_firmware_nowait(THIS_MODULE, FW_ACTION_UEVENT, 919 919 "wm8958_mbc_vss.wfw", component->dev, GFP_KERNEL, 920 920 component, wm8958_mbc_vss_loaded); 921 - request_firmware_nowait(THIS_MODULE, FW_ACTION_HOTPLUG, 921 + request_firmware_nowait(THIS_MODULE, FW_ACTION_UEVENT, 922 922 "wm8958_enh_eq.wfw", component->dev, GFP_KERNEL, 923 923 component, wm8958_enh_eq_loaded); 924 924