include/media/media-dev-allocator.h
Source file repositories/reference/linux-study-clean/include/media/media-dev-allocator.h
File Facts
- System
- Linux kernel
- Corpus path
include/media/media-dev-allocator.h- Extension
.h- Size
- 2261 bytes
- Lines
- 64
- Domain
- Repository Root And Misc
- Bucket
- include
- Inferred role
- Repository Root And Misc: implementation source
- Status
- source implementation candidate
Why This File Exists
Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
struct usb_devicefunction media_device_delete
Annotated Snippet
#ifndef _MEDIA_DEV_ALLOCATOR_H
#define _MEDIA_DEV_ALLOCATOR_H
struct usb_device;
#if defined(CONFIG_MEDIA_CONTROLLER) && IS_ENABLED(CONFIG_USB)
/**
* media_device_usb_allocate() - Allocate and return struct &media device
*
* @udev: struct &usb_device pointer
* @module_name: should be filled with %KBUILD_MODNAME
* @owner: struct module pointer %THIS_MODULE for the driver.
* %THIS_MODULE is null for a built-in driver.
* It is safe even when %THIS_MODULE is null.
*
* This interface should be called to allocate a Media Device when multiple
* drivers share usb_device and the media device. This interface allocates
* &media_device structure and calls media_device_usb_init() to initialize
* it.
*
*/
struct media_device *media_device_usb_allocate(struct usb_device *udev,
const char *module_name,
struct module *owner);
/**
* media_device_delete() - Release media device. Calls kref_put().
*
* @mdev: struct &media_device pointer
* @module_name: should be filled with %KBUILD_MODNAME
* @owner: struct module pointer %THIS_MODULE for the driver.
* %THIS_MODULE is null for a built-in driver.
* It is safe even when %THIS_MODULE is null.
*
* This interface should be called to put Media Device Instance kref.
*/
void media_device_delete(struct media_device *mdev, const char *module_name,
struct module *owner);
#else
static inline struct media_device *media_device_usb_allocate(
struct usb_device *udev, const char *module_name,
struct module *owner)
{ return NULL; }
static inline void media_device_delete(
struct media_device *mdev, const char *module_name,
struct module *owner) { }
#endif /* CONFIG_MEDIA_CONTROLLER && CONFIG_USB */
#endif /* _MEDIA_DEV_ALLOCATOR_H */
Annotation
- Detected declarations: `struct usb_device`, `function media_device_delete`.
- Atlas domain: Repository Root And Misc / include.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.