Changeset 772 for GPL/trunk/include/linux/device.h
- Timestamp:
- Apr 19, 2025, 8:08:37 PM (4 months ago)
- Location:
- GPL/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk
- Property svn:mergeinfo changed
/GPL/branches/uniaud32-6.6-LTS (added) merged: 765,768-769 /GPL/branches/uniaud32-exp (added) merged: 735-741,743-744,748-751,753-760,762-764 /GPL/branches/uniaud32-next merged: 718-734
- Property svn:mergeinfo changed
-
GPL/trunk/include/linux/device.h
r717 r772 42 42 43 43 const struct dev_pm_ops *pm; 44 }; 45 46 struct device_dma_parameters { 47 /* 48 * a low level driver may set these to teach IOMMU code about 49 * sg limitations. 50 */ 51 unsigned int max_segment_size; 52 unsigned int min_align_mask; 53 unsigned long segment_boundary_mask; 44 54 }; 45 55 … … 67 77 void *platform_data; 68 78 struct dev_pm_info power; 79 struct device_dma_parameters *dma_parms; 69 80 struct list_head dma_pools; /* dma pools (if dma'ble) */ 70 81 struct device_driver *driver; 82 void *driver_data; /* Driver data, set and get with 83 dev_set_drvdata/dev_get_drvdata */ 71 84 struct pm_dev *pm_dev; 72 85 char bus_id[20]; 73 struct class *class;86 const struct class *class; 74 87 spinlock_t devres_lock; 75 88 struct list_head devres_head; … … 92 105 static inline const char *dev_name(const struct device *dev) 93 106 { 107 #if 0 94 108 /* Use the init name until the kobject becomes available */ 95 109 if (dev->init_name) … … 97 111 98 112 return kobject_name(&dev->kobj); 113 #else 114 return "uniaud32"; 115 #endif 99 116 } 100 117 … … 146 163 struct bus_type *bus); 147 164 148 #define dev_set_drvdata(dev,ptr) ((dev)->private_data = (ptr))149 #define dev_get_drvdata(dev) (dev)->private_data150 151 165 #define MODULE_ALIAS_CHARDEV_MAJOR(x) 152 166 … … 218 232 typedef int (*dr_match_t)(struct device *dev, void *res, void *match_data); 219 233 220 extern void *devres_alloc_node(dr_release_t release, size_t size, gfp_t gfp,221 int nid);222 234 #define NUMA_NO_NODE (-1) 223 static inline void *devres_alloc(dr_release_t release, size_t size, gfp_t gfp) 224 { 225 return devres_alloc_node(release, size, gfp, NUMA_NO_NODE); 226 } 235 void *__devres_alloc_node(dr_release_t release, size_t size, gfp_t gfp, 236 int nid, const char *name); 237 #define devres_alloc(release, size, gfp) \ 238 __devres_alloc_node(release, size, gfp, NUMA_NO_NODE, #release) 227 239 228 240 /** … … 288 300 dr_match_t match, void *match_data); 289 301 302 /* devres group */ 303 void * __must_check devres_open_group(struct device *dev, void *id, gfp_t gfp); 304 void devres_close_group(struct device *dev, void *id); 305 void devres_remove_group(struct device *dev, void *id); 306 int devres_release_group(struct device *dev, void *id); 307 290 308 /* debugging and troubleshooting/diagnostic helpers. */ 291 309 extern const char *dev_driver_string(const struct device *dev); 292 #define devm_kzalloc(A, B, C) kzalloc(B, C) 293 #define devm_kmalloc(A, B, C) kmalloc(B, C) 294 #define devm_kcalloc(A, B, C, D) kmalloc(B, C) 295 #define devm_kmalloc_array(A, B, C, D) kmalloc_array(B, C, D) 296 310 void *devm_kmalloc(struct device *dev, size_t size, gfp_t gfp); 311 312 static inline void *devm_kzalloc(struct device *dev, size_t size, gfp_t gfp) 313 { 314 return devm_kmalloc(dev, size, gfp | __GFP_ZERO); 315 } 316 317 static inline void *devm_kmalloc_array(struct device *dev, 318 size_t n, size_t size, gfp_t flags) 319 { 320 // size_t bytes; 321 322 // if (unlikely(check_mul_overflow(n, size, &bytes))) 323 // return NULL; 324 325 return devm_kmalloc(dev, n * size, flags); 326 } 327 static inline void *devm_kcalloc(struct device *dev, 328 size_t n, size_t size, gfp_t flags) 329 { 330 return devm_kmalloc_array(dev, n, size, flags | __GFP_ZERO); 331 } 297 332 298 333 /* allows to add/remove a custom action to devres stack */ 299 334 int devm_add_action(struct device *dev, void (*action)(void *), void *data); 300 335 void devm_remove_action(struct device *dev, void (*action)(void *), void *data); 336 337 static inline int dev_to_node(struct device *dev) 338 { 339 return NUMA_NO_NODE; 340 } 341 342 static inline void *dev_get_drvdata(const struct device *dev) 343 { 344 return dev->driver_data; 345 } 346 347 static inline void dev_set_drvdata(struct device *dev, void *data) 348 { 349 dev->driver_data = data; 350 } 351 352 /* Generic device matching functions that all busses can use to match with */ 353 int device_match_name(struct device *dev, const void *name); 354 int device_match_of_node(struct device *dev, const void *np); 355 356 char *devm_kasprintf(struct device *dev, gfp_t gfp, 357 const char *fmt, ...); 358 301 359 #endif /* _LINUX_DEVICE_H */ 302 360
Note:
See TracChangeset
for help on using the changeset viewer.