Changeset 716 for GPL/branches/uniaud32-next/lib32/devres.c
- Timestamp:
- Aug 7, 2022, 10:54:11 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/branches/uniaud32-next/lib32/devres.c
r615 r716 36 36 }; 37 37 38 #define devres_log(dev, node, op) do {} while (0) 39 38 40 /* 39 41 * Release functions for devres group. These callbacks are used only … … 75 77 76 78 #define devres_log(dev, node, op) do {} while (0) 79 80 static void add_dr(struct device *dev, struct devres_node *node) 81 { 82 devres_log(dev, node, "ADD"); 83 BUG_ON(!list_empty(&node->entry)); 84 //#ifndef TARGET_OS2 85 /* Traps here on OS/2 */ 86 list_add_tail(&node->entry, &dev->devres_head); 87 //#endif 88 } 89 90 /** 91 * devres_add - Register device resource 92 * @dev: Device to add resource to 93 * @res: Resource to register 94 * 95 * Register devres @res to @dev. @res should have been allocated 96 * using devres_alloc(). On driver detach, the associated release 97 * function will be invoked and devres will be freed automatically. 98 */ 99 void devres_add(struct device *dev, void *res) 100 { 101 /* Traps here on OS/2 */ 102 struct devres *dr = container_of(res, struct devres, data); 103 unsigned long flags; 104 spin_lock_irqsave(&dev->devres_lock, flags); 105 add_dr(dev, &dr->node); 106 spin_unlock_irqrestore(&dev->devres_lock, flags); 107 } 77 108 78 109 /** … … 273 304 return NULL; 274 305 } 306 307 /** 308 * devm_add_action() - add a custom action to list of managed resources 309 * @dev: Device that owns the action 310 * @action: Function that should be called 311 * @data: Pointer to data passed to @action implementation 312 * 313 * This adds a custom action to the list of managed resources so that 314 * it gets executed as part of standard resource unwinding. 315 */ 316 int devm_add_action(struct device *dev, void (*action)(void *), void *data) 317 { 318 return 0; 319 } 320 321 /** 322 * devm_remove_action() - removes previously added custom action 323 * @dev: Device that owns the action 324 * @action: Function implementing the action 325 * @data: Pointer to data passed to @action implementation 326 * 327 * Removes instance of @action previously added by devm_add_action(). 328 * Both action and data should match one of the existing entries. 329 */ 330 void devm_remove_action(struct device *dev, void (*action)(void *), void *data) 331 { 332 }
Note:
See TracChangeset
for help on using the changeset viewer.